XDCC Autoresume/Autoqueue Stealth Script — File Browser
XDCCAutoresumeAutoqueueStealthScriptv4.2.0 / XDCCAutoresumeAutoqueueStealthScriptv4.2.0 / XDCCStealthListeners.mrc
XDCCStealthListeners.mrc — 132.01 KB — Download this file
;-------------------------------------------------------------------------
;
; Name: XDCC Autoresume/Autoqueue Stealth Script
; File: XDCCStealthListeners.mrc
; Version: 4.1.5
; Author: Werecow
; Date: 23-02-2005
;
; Contents: The remote listeners and event processors for the XDCC Stealth script
; (excluding dialogs and window events).
;
;
; WARNING: many channels will ban you for using XDCC leech scripts. While this is a silly rule,
; it is your responsibility. Use this wisely. Don't use it in such channels, or don't get caught.
; And play nice for the other people that want to use the XDCCs! If you leech em dry other people
; may be unable to get on.
;
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;--------------@XDCC_Info window input processing section-----------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
; Use editbox to navigate the XDCC window botlist.
;-------------------------------------------------------------------------
on *:INPUT:@XDCC_Info:{
if (!$ctrlenter && $botliston == TRUE && $fline(@XDCC_Info,$1- $+ *,1,1)) { /sline -ls @XDCC_Info $fline(@XDCC_Info,$1- $+ *,1,1) }
elseif (/* !iswm $1- || $ctrlenter) { /outputxdccinfo $1- }
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
; Makes nicknames and networks clickable (channels are already clickable
; by default).
;-------------------------------------------------------------------------
on ^1:HOTLINK:*¦*:@XDCC_Info:{
var %xdcchotlink = $gettok($removehotlink($1),1,166)
if ($fline(@XDCC_Info,%xdcchotlink,1,1) || $networksTable.exists(%xdcchotlink)) { return }
var %xdcchotlink = $gettok($removehotlink($1),2,166)
if ($fline(@XDCC_Info,%xdcchotlink,1,1) || $networksTable.exists(%xdcchotlink)) { return }
halt
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on 1:HOTLINK:*¦*:@XDCC_Info:{
var %xdcchotlink1 = $replace($gettok($removehotlink($1),2,166),_,?)
var %xdcchotlink2 = $replace($gettok($removehotlink($1),1,166),_,?)
if ($botliston == TRUE && $fline(@XDCC_Info,%xdcchotlink1,1,1)) { //sline -l @XDCC_Info $fline(@XDCC_Info,%xdcchotlink1,1,1) }
elseif ($botliston == TRUE && $fline(@XDCC_Info,%xdcchotlink2,1,1)) { //sline -l @XDCC_Info $fline(@XDCC_Info,%xdcchotlink2,1,1) }
elseif ($networksTable.exists(%xdcchotlink1) && $?!="Connect to network %xdcchotlink1 in new window?") { /joinnetwork %xdcchotlink1 }
elseif ($networksTable.exists(%xdcchotlink2) && $?!="Connect to network %xdcchotlink2 in new window?") { /joinnetwork %xdcchotlink2 }
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on ^1:HOTLINK:*:@XDCC_Info:{
var %xdcchotlink = $removehotlink($1)
if ($fline(@XDCC_Info,$1,1,1) || $fline(@XDCC_Info,%xdcchotlink,1,1) || $networksTable.exists(%xdcchotlink)) { return }
if ($isfile($1)) { return }
halt
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on 1:HOTLINK:*:@XDCC_Info:{
var %xdcchotlink = $removehotlink($1)
var %filelink = $remove($1,")
if ($botliston == TRUE && $fline(@XDCC_Info,$1,1,1)) { //sline -l @XDCC_Info $fline(@XDCC_Info,$1,1,1) }
elseif ($botliston == TRUE && $fline(@XDCC_Info,%xdcchotlink,1,1)) { //sline -l @XDCC_Info $fline(@XDCC_Info,%xdcchotlink,1,1) }
elseif ($networksTable.exists(%xdcchotlink) && $?!="Connect to network %xdcchotlink in new window?") { /joinnetwork %xdcchotlink }
elseif ($isfile($1)) {
if ($nofile($1) == $getdir) {
if ($?!="Open file %filelink $+ $chr(63) $crlf $+ File may be incomplete. $crlf $+ $crlf $+ (NOT RECOMMENDED IF YOU DON'T KNOW WHAT THIS FILE IS, DUE TO POSSIBLE VIRUS THREATS!)") { /run $1 }
}
elseif ($nofile($1) == $getdir && $?!="Open file %filelink $+ $chr(63) $crlf $+ (NOT RECOMMENDED IF YOU DON'T KNOW WHAT THIS FILE IS, DUE TO POSSIBLE VIRUS THREATS!)") { /run $1 }
}
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
; Clickable edonkey links.
;-------------------------------------------------------------------------
on ^1:HOTLINK:ed2k*:*:{
if ((ed2k:// !isin $1) || ($right($1,2) != $chr(124) $+ $chr(47))) /halt
return
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on 1:HOTLINK:ed2k*:*:{
/run %ed2kpath $1
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;--------------------------Remote Triggers Section------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
; RAW 401: Processes RAW command for "no such nick/channel" and colors
; nick black in @XDCC_Info window nicklist if applicable.
;-------------------------------------------------------------------------
raw 401:*No such nick/channel*:{
.timeoff $2 $network
.write -dw $+ $2 $+ ¦ $+ $network $autoresumedisablefile
if ($multisourcehandling == on && $triggerHash.exists($network, $2) != $null) {
if (!$exists($preventdoubleslash($xdccdir $+ \ $+ $replxdccfile($2) $+ .nsnc))) { /trynextsource $network $2 }
/write -a $preventdoubleslash($xdccdir $+ \ $+ $replxdccfile($2) $+ .nsnc) disabled
.timer 1 60 .remove $preventdoubleslash($xdccdir $+ \ $+ $replxdccfile($2) $+ .nsnc)
if ($botliston == TRUE) { //cline -lc1 @XDCC_Info $fline(@XDCC_Info,$2,1,1) }
}
elseif ($triggerHash.exists($network, $2) != $null) {
/outputxdccinfo 4Request failed: Bot7 $2 is currently not connected to3 $network $+ .
/outputxdccinfo
if ($botliston == TRUE) { //cline -lc1 @XDCC_Info $fline(@XDCC_Info,$2,1,1) }
}
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
; CTCP DCC SEND Event: Keeps track of the fpf file/pack associations.
;-------------------------------------------------------------------------
; Don't forget to update the pack comparison and library cleaning files
; for this one.
; Also, use for multi bot pack removal (on complete and manual request).
;-------------------------------------------------------------------------
ctcp *:*DCC SEND*:*:{
if ($triggerHash.exists($network, $nick) && (XDCC Send $chr(35) $+ * !iswm $1-)) {
if ($botliston == TRUE) { //cline -lc9 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
if ($exists($getqfilenm($network, $nick))) {
if (!$read($xdccsinprogress, wnt,$nick *)) {
//write -a $xdccsinprogress $nick $read($getqfilenm($network, $nick),nt,1)
}
}
var %pack = $gettok($1-,3- $+ $calc($numtok($1-,32) - 3),32)
var %packnum = $read($xdccsinprogress, snt,$nick )
var %k = $lines($getfpffilenm($network, $nick))
var %llen = $lines($getpfffilenm($network, $nick))
if (%k < %llen) {
while (%k < %llen) {
inc %k
//write -a $getfpffilenm($network, $nick) %k Unknown File $chr(35) $+ %k
}
}
if (!$read($getfpffilenm($network,$nick),wnt,%packnum %pack)) {
//write -l $+ %packnum $getfpffilenm($network,$nick) %packnum %pack
/outputxdccinfo 10Transfer started:3 $network 7 $+ $nick 10 $+ $1- $+ . File2 %pack associated with pack number13 %packnum (6 $+ $read($getpfffilenm($network,$nick),nt,%packnum) $+ ).
/outputxdccinfo
}
else { /outputxdccinfo 10Transfer started:3 $network 7 $+ $nick 10 $+ $1- $+ . }
/removeallwmatches $xdccsessionfailfile UnfinishedGet * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 [*]
/removeallwmatches $xdccsessionfailfile GetFail * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 [*]
/removeallwmatches $lastsessionfailfile GetFail * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 [*]
/removeallwmatches $totalfailfile GetFail * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 [*]
/write -a $xdccsessionfailfile UnfinishedGet $iif($file($filename).size != $null,$file($filename).size,0) 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 $asctime([dd/mm/yyyy][HH:nn:ss])
}
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#groupxdcc on
;-------------------------------------------------------------------------
; This TEXT trigger updates a channel for notice pack listing bots.
;-------------------------------------------------------------------------
on *:TEXT:*For a listing type*/msg * xdcc list*:#:{ /triggerHash.updateChannel $network $nick $chan }
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
; The first next few TEXT triggers catch a bot's filetrigger, whereas the
; ones after that block catch it's pack listings.
; The last one catches a message from a bot that you have been removed
; from queue. It will remove the relevant pack from your queued downloads
; for that bot.
;-------------------------------------------------------------------------
; TRIGGER CAPTURE SCHEMES:
;-------------------------------------------------------------------------
; Trigger Capture Scheme 10: $network $nick $chan 10 %xdccfilegetcommand
;-------------------------------------------------------------------------
on *:TEXT:*(*T*o request a file type*<number>*)*(*UPP*)*:#:{
if ($nick == $strip($8, burc)) {
var %xdccfilegetcommand = $replace($replxdccpack($7-),$chr(40),,$chr(41),)
/triggercapture $network $nick $chan 10 %xdccfilegetcommand
; unset %xdccfilegetcommand
}
}
;-------------------------------------------------------------------------
; Trigger Capture Scheme 1: $network $nick $chan 1 %xdccfilegetcommand
;-------------------------------------------------------------------------
on *:TEXT:*To request a file*type*:#:{
if ($nick == $strip($8,burc)) {
var %xdccfilegetcommand = $replxdccpack($gettok($7-,1,34))
/triggercapture $network $nick $chan 1 %xdccfilegetcommand
; unset %xdccfilegetcommand
}
}
on *:NOTICE:*To request a file type*"*"*:?:{
if ($nick == $strip($8,burc)) {
var %xdccfilegetcommand = $replxdccpack($gettok($7-,1,34))
if ($triggerHash.getChan($network, $nick) != $null) { /triggercapture $network $nick $triggerHash.getChan($network, $nick) 1N %xdccfilegetcommand }
else { /triggercapture $network $nick |UNKNOWN| 1N %xdccfilegetcommand }
; unset %xdccfilegetcommand
}
}
on *:TEXT:*To request a file type*"*"*:?:{
if ($nick == $strip($8,burc)) {
var %xdccfilegetcommand = $replxdccpack($gettok($7-,1,34))
if ($triggerHash.getChan($network, $nick) != $null) { /triggercapture $network $nick $triggerHash.getChan($network, $nick) 1PM %xdccfilegetcommand }
else { /triggercapture $network $nick |UNKNOWN| 1PM %xdccfilegetcommand }
; unset %xdccfilegetcommand
}
}
;-------------------------------------------------------------------------
; Trigger Capture Scheme 2: $network $nick $chan 2 %xdccfilegetcommand
;-------------------------------------------------------------------------
on *:TEXT:* request a file type*..*<number>*..*.•*«*»*•.*:#:{
if ($nick == $strip($6, burc)) {
var %xdccfilegetcommand = $replxdccpack($5-)
/triggercapture $network $nick $chan 2 %xdccfilegetcommand
; unset %xdccfilegetcommand
}
}
;-------------------------------------------------------------------------
; Trigger Capture Scheme 3: $network $nick $chan 3 %xdccfilegetcommand
;-------------------------------------------------------------------------
on *:TEXT:*To get a file type*"*"*:#:{
if ($nick == $strip($8,burc)) {
var %xdccfilegetcommand = $replxdccpack($gettok($7-,1,34))
/triggercapture $network $nick $chan 3 %xdccfilegetcommand
; unset %xdccfilegetcommand
}
}
on *:NOTICE:*To get a file type*"*"*:?:{
if ($nick == $strip($8,burc)) {
var %xdccfilegetcommand = $replxdccpack($gettok($7-,1,34))
/triggercapture $network $nick |UNKNOWN| 3N %xdccfilegetcommand
; unset %xdccfilegetcommand
}
}
;-------------------------------------------------------------------------
; Trigger Capture Scheme 4: $network $nick $chan 4 %xdccfilegetcommand
;-------------------------------------------------------------------------
on *:TEXT:*Usage*pack number*:#:{
if (*Send*Queue*Record*Description* !iswm $1-) {
if ($nick == $strip($3,burc)) {
if (/msg isin $1- || /ctcp isin $1- || /notice isin $1-) {
var %xdccfilegetcommand = $replace($strip($2-,burc)," **, ,**,,$chr(35) $+ x,$chr(35),$chr(35) $+ $chr(60) $+ pack number $+ $chr(62),$chr(35),",)
%xdccfilegetcommand = $replace(%xdccfilegetcommand,$chr(60) $+ pack number $+ $chr(62),$chr(35))
/triggercapture $network $nick $chan 4 %xdccfilegetcommand
; unset %xdccfilegetcommand
}
}
}
}
;-------------------------------------------------------------------------
; Trigger Capture Scheme 5: $network $nick $chan 5 %xdccfilegetcommand
;-------------------------------------------------------------------------
on *:TEXT:*Type*XDCC Send*pack number*:#:{
if ($nick isin $1-) {
if (/msg $nick isin $1-) { var %xdccfilegetcommand = /msg $nick XDCC Send $chr(35) }
if (/ctcp $nick isin $1-) { var %xdccfilegetcommand = /ctcp $nick XDCC Send $chr(35) }
if (/notice $nick isin $1-) { var %xdccfilegetcommand = /notice $nick XDCC Send $chr(35) }
if (%xdccfilegetcommand != $null) {
/triggercapture $network $nick $chan 5 %xdccfilegetcommand
; unset %xdccfilegetcommand
}
}
}
;-------------------------------------------------------------------------
; Trigger Capture Scheme 6: $network $nick $chan 6 %xdccfilegetcommand
;-------------------------------------------------------------------------
on *:TEXT:*«*«*Syntax*DCCALLOW*And*pack*number*:#:{
if ($nick isin $strip($4,burc) && $nick == $strip($7,burc)) {
var %xdccfilegetcommand = $replxdccpack($6-)
/triggercapture $network $nick $chan 6 %xdccfilegetcommand
; unset %xdccfilegetcommand
}
}
;-------------------------------------------------------------------------
; Trigger Capture Scheme 7: $network $nick $chan 7 %xdccfilegetcommand
;-------------------------------------------------------------------------
on *:TEXT:*-*Syntax*pack*number*:#:{
if ($nick == $strip($4,burc)) {
var %xdccfilegetcommand = $replxdccpack($3-)
/triggercapture $network $nick $chan 7 %xdccfilegetcommand
; unset %xdccfilegetcommand
}
}
;-------------------------------------------------------------------------
; Trigger Capture Scheme 8: $network $nick $chan 8 %xdccfilegetcommand
;-------------------------------------------------------------------------
on *:TEXT:*»*»*receive file*pack*number*:#:{
if ($nick == $strip($5,burc)) {
var %xdccfilegetcommand = $replxdccpack($4-)
/triggercapture $network $nick $chan 8 %xdccfilegetcommand
; unset %xdccfilegetcommand
}
}
;-------------------------------------------------------------------------
; Trigger Capture Scheme 9: $network $nick $chan 8 %xdccfilegetcommand
;-------------------------------------------------------------------------
on *:TEXT:*request a file type*number*:#:{
if ($nick == $strip($7,burc)) {
var %xdccfilegetcommand = $replxdccpack($6-)
/triggercapture $network $nick $chan 9 %xdccfilegetcommand
; unset %xdccfilegetcommand
}
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
; PACK CAPTURE SCHEMES:
;-------------------------------------------------------------------------
; Pack Capture Scheme 1: $network $nick $chan 1 1 $1-
;-------------------------------------------------------------------------
on *:TEXT:*(*)*[*]*-*-*:#:{ /packcapture $network $nick $chan 1 1 $1- }
on *:NOTICE:*(*)*[*]*-*-*:?:{
if ($triggerHash.exists($network, $nick) != $null) { /packcapture $network $nick $triggerHash.getChan($network, $nick) 1N 1 $1- }
}
;-------------------------------------------------------------------------
; Pack Capture Scheme 12: $network $nick $chan 12 1 $1-
;-------------------------------------------------------------------------
on *:TEXT:*[*]*(*|*x*)*(*F*ile*)*:#:{ /packcapture $network $nick $chan 12 2 $1- }
;-------------------------------------------------------------------------
; Pack Capture Scheme 2: $network $nick $chan 2 1 $1-
;-------------------------------------------------------------------------
on *:TEXT:*[*]* F*ile*..*..*S*ize*..*..*:#:{ /packcapture $network $nick $chan 2 1 $1- }
;-------------------------------------------------------------------------
; Pack Capture Scheme 3: $network $nick $chan 3 1 $1-
;-------------------------------------------------------------------------
on *:TEXT:*[*]*[*]*-*[*Get*]*:#:{ /packcapture $network $nick $chan 3 1 $1- }
;-------------------------------------------------------------------------
; Pack Capture Scheme 4: $network $nick $chan 4 2 $1-
;-------------------------------------------------------------------------
on *:TEXT:*(*)*-*(*get*)*:#:{ /packcapture $network $nick $chan 4 2 $1- }
;-------------------------------------------------------------------------
; Pack Capture Scheme 5: $network $nick $chan 5 1 $1-
;-------------------------------------------------------------------------
on *:TEXT:*«*»*[*]*(*get*)*:#:{ /packcapture $network $nick $chan 5 1 $1- }
;-------------------------------------------------------------------------
; Pack Capture Scheme 6: $network $nick $chan 6 2 $1-
;-------------------------------------------------------------------------
on *:TEXT:*««*[*]*(*)*-*:#:{ /packcapture $network $nick $chan 6 2 $1- }
;-------------------------------------------------------------------------
; Pack Capture Scheme 7: $network $nick $chan 7 1 $1-
;-------------------------------------------------------------------------
on *:TEXT:*#*x*[*]*:#:{ /packcapture $network $nick $chan 7 1 $1- }
on *:NOTICE:*#*x*[*]*:?:{
if ($triggerHash.exists($network, $nick) != $null) { /packcapture $network $nick $triggerHash.getChan($network, $nick) 7N 1 $1- }
}
;-------------------------------------------------------------------------
; Pack Capture Scheme 8: $network $nick $chan 8 1 $1-
;-------------------------------------------------------------------------
on *:TEXT:*[*]*(*|*)*-*:#:{ /packcapture $network $nick $chan 8 1 $1- }
on *:NOTICE:*[*]*(*|*)*-*:?:{
if ($triggerHash.exists($network, $nick) != $null) { /packcapture $network $nick $triggerHash.getChan($network, $nick) 8N 1 $1- }
}
;-------------------------------------------------------------------------
; Pack Capture Scheme 9: $network $nick $chan 9 1 $1-
;-------------------------------------------------------------------------
on *:TEXT:*(*)*[*]*»*»*-*(*x*)*:#:{ /packcapture $network $nick $chan 9 1 $1- }
;-------------------------------------------------------------------------
; Pack Capture Scheme 10: $network $nick $chan 10 1 $1-
;-------------------------------------------------------------------------
on *:TEXT:.* *x [*] *:#:{
if ($triggerHash.getTrigger($network, $nick) == $null) { /triggercapture $network $nick $chan default /ctcp $nick xdcc get $chr(35) }
/packcapture $network $nick $chan 10 1 $1-
}
;-------------------------------------------------------------------------
; Pack Capture Scheme 11: $network $nick $chan 11 1 $1-
;-------------------------------------------------------------------------
on *:TEXT:*«*»*- (*gets)*:#:{ /packcapture $network $nick $chan 11 1 $1- }
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
; Pack Capture Scheme Default: $network $nick $chan default $findtok($1-,$matchtok($1-,$chr(35),1,32),1,32) $1-
;-------------------------------------------------------------------------
on *:TEXT:*#*:#:{
if ($triggerHash.exists($network,$nick)) { /packcapture $network $nick $chan default $findtok($1-,$matchtok($1-,$chr(35),1,32),1,32) $1- }
/debuglog $scriptline $+ : ON *:TEXT:*#*:#: TRIGGER: $network $chan $nick $+ : Unclassified $chr(35) text encountered (Attempting pack capture): $1-
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#groupxdcc end
#groupautoremove on
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:TEXT:*Removed you from the queue for*"*"*waited*:?:{
if ($get($nick).status != active && $botliston == TRUE) { //cline -lc7 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
if ($read($getpfffilenm($network, $nick), wnt, * $+ $remvqnotice($7) $+ *)) {
var %packnum = $gettok($read($getpfffilenm($network, $nick), $readn), 1, 32)
if ($read($getqfilenm($network, $nick), wnt, %packnum)) {
.removefromq $nick $network %packnum
/outputxdccinfo You removed $remvqnotice($7) from queue for3 $network $+ ¦7 $+ $nick (Pack number %packnum $+ ), removing that pack from this bot's queue file.
}
else { /outputxdccinfo Pack %packnum not in queue for3 $network $+ ¦7 $+ $nick $+ . }
}
else { /outputxdccinfo You removed a pack from queue for3 $network $+ ¦7 $+ $nick $+ , $remvqnotice($7) (Pack number unknown). }
if ($exists($xdccqueueposfile) && $read($xdccqueueposfile, wnt, $nick $+ ¦ $+ * $+ ¦ $+ *)) {
/write -dw $+ $nick $+ ¦* $xdccqueueposfile
}
/outputxdccinfo
}
;-------------------------------------------------------------------------
on *:NOTICE:*Removed you from the queue for*"*"*waited*:?:{
if ($get($nick).status != active && $botliston == TRUE) { //cline -lc7 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
if ($read($getpfffilenm($network, $nick), wnt, * $+ $remvqnotice($7) $+ *)) {
var %packnum = $gettok($read($getpfffilenm($network, $nick), $readn), 1, 32)
if ($read($getqfilenm($network, $nick), wnt, %packnum)) {
.removefromq $nick $network %packnum
/outputxdccinfo You removed $remvqnotice($7) from queue for3 $network $+ ¦7 $+ $nick (Pack number %packnum $+ ), removing that pack from this bot's queue file.
}
else { /outputxdccinfo Pack %packnum not in queue for3 $network $+ ¦7 $+ $nick $+ . }
}
else { /outputxdccinfo You removed a pack from queue for3 $network $+ ¦7 $+ $nick $+ , $remvqnotice($7) (Pack number unknown). }
if ($exists($xdccqueueposfile) && $read($xdccqueueposfile, wnt, $nick $+ ¦ $+ * $+ ¦ $+ *)) {
/write -dw $+ $nick $+ ¦* $xdccqueueposfile
}
/outputxdccinfo
}
#groupautoremove end
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;on *:TEXT:*:#:{
; if ($triggerHash.exists($network, $nick) != $null) {
; /debuglog $scriptline $+ : ON *:TEXT:*:#: TRIGGER: $network $chan $nick $+ : Unknown public msg text by bot: $1-
; }
;}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;on *:TEXT:*:?:{
; if ($triggerHash.exists($network, $nick) != $null) {
; /debuglog $scriptline $+ : ON *:TEXT:*:?: TRIGGER: $network $nick $+ : Unknown private msg text by bot: $1-
; }
;}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#groupxdcc on
;-------------------------------------------------------------------------
; The first few NOTICE triggers write information to a %xdccsinprogress
; file about what file transfers are currently active. This info is used
; by the autoresume function. It notes the botname and packnumber. Note
; that the second trigger must guess the pack number from the q file.
; Unfortunatly that's the best i can do for now.
; The sixth-last auto re-requests a file after a few minutes if the bot
; queue is full. The fifth last one is to react to a demand that you be in a
; channel with the bot to request a pack. It triggers an alias that joins
; the appropriate channel and re-requests the pack.
; The ones after that will attempt to re-request a pack after a given
; number of minutes if the owner of the bot has requested that no new
; connections be made for that time period.
; The next one will process a notice that informs you that you've been
; added to a bot's queue.
; The next two are meant for the version checker.
; The last ones keep track of (changing) queue positions.
;-------------------------------------------------------------------------
on *:notice:*Sending You Pack*which is*:?:{
if ($botliston == TRUE && $triggerHash.exists($network, $nick)) { //cline -lc9 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
if ($read($xdccsinprogress, s, $nick)) { /write -ds $+ $nick $xdccsinprogress }
if ($read($networkfile($network), wn, * $nick *)) { /write -dw"* $nick *" $networkfile($network) }
if (!$read($xdccsinprogress, wnt,$nick $replace($5,$chr(35),))) {
//write -a $xdccsinprogress $nick $replace($5,$chr(35),)
}
/outputxdccinfo 12Pack13 $replace($5,$chr(35),) 12sent by7 $nick on3 $network $+ .
if ($exists($xdccqueueposfile) && $read($xdccqueueposfile, wnt, $nick $+ ¦ $+ * $+ ¦ $+ *)) {
/write -dw $+ $nick $+ ¦* $xdccqueueposfile
}
if ($exists($tempbotqueuefile) && $read($tempbotqueuefile,snt,$nick)) {
/write -ds $+ $nick $tempbotqueuefile
}
.timeoff $nick $network
if ($botqueuehandling == on && $testnumoftransferspeed == on && $botqueuemode == bandwidth) { .timexdcctransferstest }
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*Sending You Your Queued Pack Which Is*:?:{
if ($botliston == TRUE && $triggerHash.exists($network, $nick)) { //cline -lc9 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
if ($exists($getqfilenm($network, $nick))) {
if (!$read($xdccsinprogress, wnt,$nick $read($getqfilenm($network, $nick), 0))) {
//write -a $xdccsinprogress $nick $read($getqfilenm($network, $nick), 0)
}
/outputxdccinfo 12Pack13 $gettok($read($getqfilenm($network, $nick), 0),1,32) 12sent by7 $nick on3 $network (6Pack number had to be guessed from queue file and will be used by autoresume).
}
else {
/outputxdccinfo 12Pack sent by7 $nick on3 $network (4Pack number unknown $+ $chr(58) no autoresume possible).
}
if ($exists($xdccqueueposfile) && $read($xdccqueueposfile, wnt, $nick $+ ¦ $+ * $+ ¦ $+ *)) {
/write -dw $+ $nick $+ ¦* $xdccqueueposfile
}
if ($exists($tempbotqueuefile) && $read($tempbotqueuefile,snt,$nick)) {
/write -ds $+ $nick $tempbotqueuefile
}
.timeoff $nick $network
if ($botqueuehandling == on && $testnumoftransferspeed == on && $botqueuemode == bandwidth) { .timexdcctransferstest }
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*DCC Send*(*)*:?:{
if ($botliston == TRUE && $triggerHash.exists($network, $nick)) { //cline -lc9 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
if ($read($getpfffilenm($network, $nick), wnt, * $remvextent($3) *)) {
var %readn = $readn
if (!$read($xdccsinprogress, wnt,$nick $gettok($read($getpfffilenm($network, $nick), %readn),1,32))) {
//write -a $xdccsinprogress $nick $gettok($read($getpfffilenm($network, $nick), %readn),1,32)
}
/outputxdccinfo 12Pack13 $gettok($read($getpfffilenm($network, $nick), %readn),1,32) 12sent by7 $nick on3 $network (6Pack number had to be guessed from pack listing file and will be used by autoresume).
}
elseif ($exists($getqfilenm($network, $nick))) {
/outputxdccinfo 12Pack13 $gettok($read($getqfilenm($network, $nick), 0),1,32) 12sent by7 $nick on3 $network (6Pack number had to be guessed from queue file and will be used by autoresume).
}
else {
/outputxdccinfo 12Pack sent by7 $nick on3 $network (4Pack number unknown $+ $chr(58) no autoresume possible).
}
if ($exists($xdccqueueposfile) && $read($xdccqueueposfile, wnt, $nick $+ ¦ $+ * $+ ¦ $+ *)) {
/write -dw $+ $nick $+ ¦* $xdccqueueposfile
}
if ($exists($tempbotqueuefile) && $read($tempbotqueuefile,snt,$nick)) {
/write -ds $+ $nick $tempbotqueuefile
}
.timeoff $nick $network
if ($botqueuehandling == on && $testnumoftransferspeed == on && $botqueuemode == bandwidth) { .timexdcctransferstest }
/outputxdccinfo
}
#groupxdcc end
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#groupautoxdccresume on
on *:notice:*There are too many send in progress right now and all queue slots are used*:?:{
if ($get($nick).status != active && $botliston == TRUE) { //cline -lc5 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
/queuefullrerequest $network $nick
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*All Slots Full*queue*Full*Try Again Later*:?:{
if ($get($nick).status != active && $botliston == TRUE) { //cline -lc5 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
/queuefullrerequest $network $nick
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*XDCC*Sorry*all send and queue slots are full*:?:{
if ($triggerHash.exists($network, $nick) && $get($nick).status != active && $botliston == TRUE) { //cline -lc5 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
/queuefullrerequest $network $nick
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*Sorry*there are too many send in progress right now and all the queue slots are in use*:?:{
if ($triggerHash.exists($network, $nick) && $get($nick).status != active && $botliston == TRUE) { //cline -lc5 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
/queuefullrerequest $network $nick
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*sorry*all*queue slots are in use*:?:{
if ($triggerHash.exists($network, $nick) && $get($nick).status != active && $botliston == TRUE) { //cline -lc5 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
/queuefullrerequest $network $nick
}
#groupautoxdccresume end
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*There are too many send in progress right now and all queue slots are used*:?:{
/outputxdccinfo 13Queue full for bot3 $network $+ ¦7 $+ $nick $+ , 4NOT auto re-requesting.
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*All Slots Full*queue*Full*Try Again Later*:?:{
/outputxdccinfo 13Queue full for bot3 $network $+ ¦7 $+ $nick $+ , 4NOT auto re-requesting.
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*XDCC*Sorry*all send and queue slots are full*:?:{
/outputxdccinfo 13Queue full for bot3 $network $+ ¦7 $+ $nick $+ , 4NOT auto re-requesting.
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*Sorry*there are too many send in progress right now and all the queue slots are in use*:?:{
/outputxdccinfo 13Queue full for bot3 $network $+ ¦7 $+ $nick $+ , 4NOT auto re-requesting.
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*sorry*all*queue slots are in use*:?:{
/outputxdccinfo 13Queue full for bot3 $network $+ ¦7 $+ $nick $+ , 4NOT auto re-requesting.
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#groupautojoinxdcc on
on *:notice:*SEND denied*must be on*known channel*request*:?:{
if ($triggerHash.exists($network, $nick) && $get($nick).status != active && $botliston == TRUE) { //cline -lc13 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
if ($triggerHash.exists($network, $nick) && $triggerHash.getChan($network, $nick) != |UNKNOWN|) {
var %rand.bt = $rand(3, 30)
/outputxdccinfo 7 $+ $nick 5refused to send you a pack because you are not in the same channel. 3Joining12 $triggerHash.getChan($network, $nick) in %rand.bt seconds.
if ($me !ison $triggerHash.getChan($network, $nick)) {
/timerxdccjoin $+ $nick $+ $triggerHash.getChan($network, $nick) 1 %rand.bt /timejoin1 $nick $network
}
else { /outputxdccinfo 4ERROR: Already in channel listed for $nick $+ . Bot most likely disabled or malfunctioning. }
}
else {
/outputxdccinfo 7 $+ $nick 5refused to send you a pack because you are not in the same channel. Make sure you have that channel on autojoin (No channels linked to7 $nick $+ ).
}
/outputxdccinfo
}
#groupautojoinxdcc end
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*SEND denied*must be on*known channel*request*:?:{
if ($triggerHash.getChan($network, $nick)) {
/outputxdccinfo 7 $+ $nick 5refused to send you a pack because you are not in the same channel. Autojoin function OFF. Make sure you have that channel on autojoin on connect, or have the script autojoin function ON if you want to prevent this from happening in the future. Suggested channel:12 $triggerHash.getChan($network, $nick) $+ .
}
else {
/outputxdccinfo 7 $+ $nick 5refused to send you a pack because you are not in the same channel. Make sure you have that channel on autojoin (No channels linked to7 $nick $+ ).
}
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#groupnonewconnects on
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*The Owner Has Requested That No New Connections Are Made In The Next * Minutes:?:{
if ($triggerHash.exists($network, $nick) && $get($nick).status != active && $botliston == TRUE) { //cline -lc6 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
var %timeoffset = $calc($calc($15 * 60) + $rand($minnoconnect,$maxnoconnect))
if ($exists($getqfilenm($network, $nick))) {
var %trigger = $triggerHash.getTrigger($network, $nick) $+ $read($getqfilenm($network, $nick), tn, 1)
/outputxdccinfo 4Pack send 13 $gettok($read($getqfilenm($network, $nick), 0),1,32) 4refused by7 $nick on3 $network (6Pack number had to be guessed from queue file and will be used by autoresume). 4Reason: The bot owner has requested that no new connections be made for the next $15 minutes. 3Re-requesting file in %timeoffset seconds (2 $+ %trigger $+ ).
}
else {
/outputxdccinfo 4Pack send refused by7 $nick on3 $network (4Pack number unknown $+ $chr(58) no autoresume possible). 4Reason: The bot owner has requested that no new connections be made for the next $15 minutes.
}
if ($exists($tempbotqueuefile) && $read($tempbotqueuefile,snt,$nick)) {
/write -ds $+ $nick $tempbotqueuefile
}
if ($gettok(%trigger, 1, 32) == /msg) { /timerxdccnonewconnect $+ $nick $+ 2 -o 1 %timeoffset /msg $gettok(%trigger, 2-, 32) }
elseif ($gettok(%trigger, 1, 32) == /ctcp) { /timerxdccnonewconnect $+ $nick $+ 2 -o 1 %timeoffset /ctcp $gettok(%trigger, 2-, 32) }
elseif ($gettok(%trigger, 1, 32) == /notice) { /timerxdccnonewconnect $+ $nick $+ 2 -o 1 %timeoffset /notice $gettok(%trigger, 2-, 32) }
else { /outputxdccinfo 4ERROR: Unknown trigger type ( $+ %trigger $+ ). }
.timer -o 1 %timeoffset /outputxdccinfo 4Re-requesting d/l after %timeoffset seconds:3 $network $+ ¦7 $+ $nick (owner requested that no connections be made prior to now).
.timer -o 1 %timeoffset /outputxdccinfo
/outputxdccinfo
}
#groupnonewconnects end
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*The Owner Has Requested That No New Connections Are Made In The Next * Minutes:?:{
/outputxdccinfo 4Pack send refused by7 $nick on3 $network $+ . 4Reason: The bot owner has requested that no new connections be made for the next $15 minutes. 4Not Retrying Request: Auto Retry on No New Connections Notice OFF.
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*All Slots Full, Added you to the main queue in position*:?:{
if ($triggerHash.exists($network, $nick) && $get($nick).status != active && $botliston == TRUE) { //cline -lc3 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
if ($strip($remove($13,$chr(35),$chr(46),$chr(44)),burc) isnum) {
/outputxdccinfo 12Pack succesfully queued for7 $nick on3 $network in XDCC bot's queue at position13 $strip($remove($13,$chr(35),$chr(46),$chr(44)),burc) $+ .
}
else {
/outputxdccinfo 12Pack succesfully queued for7 $nick on3 $network $+ .
}
if ($exists($tempbotqueuefile) && $read($tempbotqueuefile,snt,$nick)) {
/write -ds $+ $nick $tempbotqueuefile
}
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*XDCC*Adding your file to queue slot*The file will send when the next send slot is open*:?:{
if ($triggerHash.exists($network, $nick) && $get($nick).status != active && $botliston == TRUE) { //cline -lc3 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
if ($strip($remove($8,$chr(35),$chr(46),$chr(44)),burc) isnum) {
/outputxdccinfo 12Pack succesfully queued for7 $nick on3 $network in XDCC bot's queue at position13 $strip($remove($8,$chr(35),$chr(46),$chr(44)),burc) $+ .
}
else {
/outputxdccinfo 12Pack succesfully queued for7 $nick on3 $network $+ .
}
if ($exists($tempbotqueuefile) && $read($tempbotqueuefile,snt,$nick)) {
/write -ds $+ $nick $tempbotqueuefile
}
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*Queuing*(*)*.*It has been placed in queue slot *, it will send when sends are available.*:?:{
if ($triggerHash.exists($network, $nick) && $get($nick).status != active && $botliston == TRUE) { //cline -lc3 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
if ($strip($remove($11,$chr(35),$chr(46),$chr(44)),burc) isnum) {
/outputxdccinfo 12Pack succesfully queued for7 $nick on3 $network in XDCC bot's queue at position13 $strip($remove($11,$chr(35),$chr(46),$chr(44)),burc) $+ .
}
else {
/outputxdccinfo 12Pack succesfully queued for7 $nick on3 $network $+ .
}
if ($exists($tempbotqueuefile) && $read($tempbotqueuefile,snt,$nick)) {
/write -ds $+ $nick $tempbotqueuefile
}
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#groupcheckversion off
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:Your version is up to date.:?:{
/outputxdccinfo 14 $+ $nick replied to versioncheck. Your version is up to date.
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:New XDCC script version available.:?:{
/outputxdccinfo 14 $+ $nick replied to versioncheck. Your version is outdated. New version available.
/timerxdccversionrequest1 1 0 /timeversionrequest $nick
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#groupcheckversion end
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*Server Notice*This server is using an alternate send method, please make sure your DCC Server is active and set to port*/dccserver * on *:?:{
if ($remove($strip($23,burc),$chr(46)) == $remove($strip($27,burc),$chr(46)) && $strip($24,burc) == /dccserver) {
if ($exists($alternatedccserverfile) && $read($alternatedccserverfile, snt,$network $nick)) { /write -ds $+ $network $nick $alternatedccserverfile }
/write -a alternatedccserverfile $network $nick $remove($strip($24-),$chr(46))
var %rand.bt = $calc(30 + $rand($minresumedelay, $maxresumedelay))
.timerxdccautoresume 1 %rand.bt /alternatesendcheck $network $nick
/outputxdccinfo 7 $+ $nick 8 on 3 $+ $network 8requires an alternate DCC server setting. Setting dcc server in %rand.bt seconds ( $+ $remove($strip($24-),$chr(46)) $+ ).
/outputxdccinfo
}
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#grouptrackqueuepos on
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*Your request for*is now number*in my send queue*If you would like to remove your queues at a later time Type*:?:{
if ($triggerHash.exists($network, $nick) && $get($nick).status != active && $botliston == TRUE) { //cline -lc3 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
var %strippedtrigger = $replace($strip($1-,burc),Your request for ,,is now number,¦,in my send queue,¦,If you would like to remove your queues at a later time Type,¦,$chr(46),,$chr(58),,",,$chr(40),,$chr(41),,$chr(44),$chr(32),$chr(32) $+ $chr(32),$chr(32),$chr(32) $+ ¦,¦,¦ $+ $chr(32),¦)
var %presentqueuepos = $replace($gettok(%strippedtrigger,2,166),$chr(46),)
var %removetrigger = $replace($gettok(%strippedtrigger,3,166),$chr(46),)
var %packdescript = $gettok(%strippedtrigger,1,166)
if (!$exists($xdccqueueposfile) || !$read($xdccqueueposfile, wnt, $nick $+ ¦ $+ %presentqueuepos $+ ¦ $+ %removetrigger)) {
.write -dw $+ $nick $+ ¦* $xdccqueueposfile
.write -a $xdccqueueposfile $nick $+ ¦ $+ %presentqueuepos $+ ¦ $+ %removetrigger
/outputxdccinfo 5Bot $nick queue position changed. Present position %presentqueuepos $+ . Pack description: ' $+ %packdescript $+ '. To remove yourself type " $+ %removetrigger $+ " on the appropriate network.
/outputxdccinfo
}
.timeoff $nick $network
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*You have been queued for*for*currently in main queue position*Estimated remaining time is*or*To remove yourself type*:?:{
if ($triggerHash.exists($network, $nick) && $get($nick).status != active && $botliston == TRUE) { //cline -lc3 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
var %strippedtrigger = $replace($strip($1-,burc),You have been queued for,, for ",¦, currently in main queue position,¦, Estimated remaining time is,¦,To remove yourself type ",¦,",,$chr(44),$chr(32),$chr(32) $+ $chr(32),$chr(32),$chr(32) $+ ¦,¦,¦ $+ $chr(32),¦)
var %presentqueuepos = $replace($gettok(%strippedtrigger,3,166),$chr(46),)
var %queuedtime = $replace($gettok(%strippedtrigger,1,166),$chr(46),)
var %remainingtime = $replace($gettok(%strippedtrigger,4,166),$chr(46),)
var %removetrigger = $replace($gettok(%strippedtrigger,5,166),$chr(46),)
var %packdescript = $gettok(%strippedtrigger,2,166)
if (!$exists($xdccqueueposfile) || !$read($xdccqueueposfile, wnt, $nick $+ ¦ $+ $gettok(%presentqueuepos,1,32) * $+ ¦ $+ %removetrigger)) {
.write -dw $+ $nick $+ ¦* $xdccqueueposfile
.write -a $xdccqueueposfile $nick $+ ¦ $+ %presentqueuepos $+ ¦ $+ %removetrigger
/outputxdccinfo 5Bot $nick queue position changed. Queued for %queuedtime $+ , present position %presentqueuepos $+ . Estimated remaining time %remainingtime $+ . Pack description: ' $+ %packdescript $+ '. To remove yourself type " $+ %removetrigger $+ " on the appropriate network.
/outputxdccinfo
}
.timeoff $nick $network
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*You have been queued for*currently in main queue position*Estimated remaining time is*or*To remove yourself type*:?:{
if ($triggerHash.exists($network, $nick) && $get($nick).status != active && $botliston == TRUE) { //cline -lc3 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
var %strippedtrigger = $replace($strip($1-,burc),You have been queued for,, for ",¦, currently in main queue position,¦, Estimated remaining time is,¦,To remove yourself type ",¦,",,$chr(46),$chr(32),$chr(44),$chr(32),$chr(32) $+ $chr(32),$chr(32),$chr(32) $+ ¦,¦,¦ $+ $chr(32),¦)
var %presentqueuepos = $replace($gettok(%strippedtrigger,2,166),$chr(46),)
var %queuedtime = $replace($gettok(%strippedtrigger,1,166),$chr(46),)
var %remainingtime = $replace($gettok(%strippedtrigger,3,166),$chr(46),)
var %removetrigger = $replace($gettok(%strippedtrigger,4,166),$chr(46),)
if (!$exists($xdccqueueposfile) || !$read($xdccqueueposfile, wnt, $nick $+ ¦ $+ $gettok(%presentqueuepos,1,32) * $+ ¦ $+ %removetrigger)) {
.write -dw $+ $nick $+ ¦* $xdccqueueposfile
.write -a $xdccqueueposfile $nick $+ ¦ $+ %presentqueuepos $+ ¦ $+ %removetrigger
/outputxdccinfo 5Bot $nick queue position changed. Queued for %queuedtime $+ , present position %presentqueuepos $+ . Estimated remaining time %remainingtime $+ . To remove yourself type " $+ %removetrigger $+ " on the appropriate network.
/outputxdccinfo
}
.timeoff $nick $network
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*Queued*for*in position*or less remaining*:?:{
if ($triggerHash.exists($network, $nick) && $get($nick).status != active && $botliston == TRUE) { //cline -lc3 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
var %strippedtrigger = $replace($strip($1-,burc),Queued ,, for ",¦, in position,¦, or less remaining,¦,",,$chr(46),$chr(166),$chr(44),$chr(166),$chr(32) $+ $chr(32),$chr(32),$chr(32) $+ ¦,¦,¦ $+ $chr(32),¦,¦¦,¦)
var %presentqueuepos = $replace($gettok(%strippedtrigger,$calc($numtok(%strippedtrigger,166) - 1),166),$chr(46),)
var %queuedtime = $replace($gettok(%strippedtrigger,1,166),$chr(46),)
var %remainingtime = $replace($gettok(%strippedtrigger,$numtok(%strippedtrigger,166),166),$chr(46),)
var %packdescript = $null
var %i = 2
var %packdescriptsize = $calc($numtok(%strippedtrigger,166) - 1)
while (%i < %packdescriptsize) {
set %packdescript %packdescript $gettok(%strippedtrigger,%i,166)
inc %i
}
if (!$exists($xdccqueueposfile) || !$read($xdccqueueposfile, wnt, $nick $+ ¦ $+ $gettok(%presentqueuepos,1,32) * $+ ¦ $+ *)) {
.write -dw $+ $nick $+ ¦* $xdccqueueposfile
.write -a $xdccqueueposfile $nick $+ ¦ $+ %presentqueuepos $+ ¦ $+ /msg $nick xdcc remove
/outputxdccinfo 5Bot $nick queue position changed. Queued for %queuedtime $+ , present position %presentqueuepos $+ . Estimated remaining time %remainingtime $+ . Pack description: ' $+ %packdescript $+ '.
/outputxdccinfo
}
.timeoff $nick $network
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#grouptrackqueuepos end
#groupdccpendingerror on
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*You have a DCC pending*Set your client to receive the transfer*seconds remaining until timeout*:?:{
if ($get($nick).status != active) {
var %secs = $remove($14,$chr(40))
.timeoff $nick $network
/outputxdccinfo 5Bot3 $network $+ 5¦7 $+ $nick 5has given a DCC pending timeout warning (timeout in %secs seconds). Bot may be defective. 4Disabling re-request timers to prevent detection.
/outputxdccinfo
}
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*Closing Connection*DCC Timeout*(*Sec Timeout)*:?:{
if ($get($nick).status != active) {
var %secs = $remove($6,$chr(40))
.timeoff $nick $network
if (!$read($autoresumedisablefile, wnt, $nick $+ ¦ $+ $network)) {
/write -a $autoresumedisablefile $nick $+ ¦ $+ $network
}
if ($exists($tempbotqueuefile) && $read($tempbotqueuefile,snt,$nick)) {
/write -ds $+ $nick $tempbotqueuefile
}
if ($exists($botqueuefile) && $read($botqueuefile,snt,$nick)) {
/write -ds $+ $nick $botqueuefile
}
if ($triggerHash.exists($network, $nick) && $botliston == TRUE) { //cline -lc2 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
/outputxdccinfo 5Bot3 $network $+ 5¦7 $+ $nick 5has given a DCC timeout error (timeout after %secs seconds). Bot may be defective. 4Disabling re-request timers to prevent detection and suspending queues.
/outputxdccinfo
}
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#groupdccpendingerror end
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*All Slots Full*Denied*You already have that item queued*:?:{
if ($get($nick).status == active) {
if ($triggerHash.exists($network, $nick) && $botliston == TRUE) { //cline -lc9 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
/outputxdccinfo 4Excess request: Pack already transfering for bot3 $network $+ ¦7 $+ $nick $+ .
}
else {
if ($triggerHash.exists($network, $nick) && $botliston == TRUE) { //cline -lc3 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
/outputxdccinfo 4Excess request: Pack already queued for bot3 $network $+ ¦7 $+ $nick $+ .
}
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*You already requested that pack*:?:{
if ($get($nick).status == active) {
if ($triggerHash.exists($network, $nick) && $botliston == TRUE) { //cline -lc9 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
/outputxdccinfo 4Excess request: Pack already transfering for bot3 $network $+ ¦7 $+ $nick $+ .
}
else {
if ($triggerHash.exists($network, $nick) && $botliston == TRUE) { //cline -lc3 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
/outputxdccinfo 4Excess request: Pack already queued for bot3 $network $+ ¦7 $+ $nick $+ .
}
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:notice:*There are too many sends in progress right now and have used all your queue slots*:?:{
if ($get($nick).status == active) {
if ($triggerHash.exists($network, $nick) && $botliston == TRUE) { //cline -lc9 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
/outputxdccinfo 4Excess request: Pack already transfering for bot3 $network $+ ¦7 $+ $nick $+ .
}
else {
if ($triggerHash.exists($network, $nick) && $botliston == TRUE) { //cline -lc3 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
/outputxdccinfo 4Excess request: Pack already queued for bot3 $network $+ ¦7 $+ $nick $+ .
}
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;on *:notice:*:?:{
; if ($triggerHash.exists($network, $nick) != $null) {
; /debuglog $scriptline $+ : ON *:NOTICE:*:?: TRIGGER: $network $nick $+ : Unknown notice sent by bot: $1-
; }
;}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#groupautoxdccq on
;-------------------------------------------------------------------------
; If autoqueue is on:
; If a file is succesfully received, this trigger checks if a queue file
; exists for the given bot, and if so, queues up the next packnumber in
; the .q file after running a timer with a random number of seconds
; between 1 sec and 2 mins. It also removes the completed transfer from
; the active transfers file and adds newly completed downloads to the
; completed transfers file.
;-------------------------------------------------------------------------
; If Autoqueue is off:
; When a file is succesfully received, this trigger removes that transfer
; from the active transfers file and adds the newly completed download to
; the completed transfers file.
;-------------------------------------------------------------------------
on *:FILERCVD:*:{
if ($botliston == TRUE && $triggerHash.exists($network, $nick)) {
if ($me ison $triggerHash.getChan($network, $nick) && $nick ison $triggerHash.getChan($network, $nick)) { //cline -lc7 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
elseif ($server == $null && $network == $triggerHash.network($nick)) { //cline -lc14 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
elseif ($network == $triggerHash.network($nick)) { //cline -lc10 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
}
if ($read($xdccsinprogress, s, $nick)) { /write -ds $+ $nick $xdccsinprogress }
if ($read($networkfile($network), wnt, * $nick *)) {
if ($lines($networkfile($network)) <= 1) { .remove $networkfile($network) }
else { /write -dw"* $nick *" $networkfile($network) }
}
/outputxdccinfo 6Dequeueing all packs for3 $network $+ ¦7 $nick matching13 * $+ $remvextent($nopath($filename)) $+ *, or first pack in queue if no matching packs are found.
if ($read($getpfffilenm($network, $nick),wtn, * $+ $remvextent($nopath($filename)) $+ *)) {
var %i = 0
var %llen = $lines($getpfffilenm($network, $nick))
while (%i <= %llen) {
if (* $+ $remvextent($nopath($filename)) $+ * iswm $read($getpfffilenm($network, $nick),%i)) {
.removefromq $nick $network $gettok($read($getpfffilenm($network, $nick), %i),1, 32)
}
inc %i
}
if ($lines($getqfilenm($network, $nick)) < 1) { .remove $getqfilenm($network, $nick) }
}
else {
if ($lines($getqfilenm($network, $nick)) <= 1) { .remove $getqfilenm($network, $nick) }
else { /write -dl1 $getqfilenm($network, $nick) }
}
if ($clearallqueuesoncomplete == on) { /removepackfromallbots $replxdccfile($nick $network) $filename }
if ($botqueuehandling == on && $shouldstartmaxbotq == $null) {
;-------------------------------------------------------------------------------------------
;If the maximum number of sends is in progress, add the next queue for this bot to the temp
;bot queue. If no queue items exist, the script will start a normal bot queue on next file
;completion.
;-------------------------------------------------------------------------------------------
if ($exists($getqfilenm($network, $nick))) {
/write -a $tempbotqueuefile $nick $read($getqfilenm($network, $nick), t, 0)
/outputxdccinfo 9Transfer Completed: Got2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) from7 $nick $+ . $activesends transfers active, $activeautoresumesends transfers waiting for auto resume: 4Maximum send slots in use ( $+ $maxtransfers $+ ): Adding7 $nick to temporary botqueue.
}
else {
/outputxdccinfo 9Transfer Completed: Got2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) from7 $nick $+ , no more queues exist for this bot. $activesends transfers active, $%activeautoresumesends transfers waiting for auto resume: 4Maximum send slots in use ( $+ $maxtransfers $+ ): Waiting for next XDCC Get to complete, then moving on to next bot in Bot Queue file..
}
}
else {
if ($botqueuehandling == on && $read($tempbotqueuefile, nt, 1) != $null) {
;-------------------------------------------------------------------------------------------
;First we attempt the Temporary bot queue. if there is a temp bot queue file, take the next
;bot in line and start it's queue, and remove it from the temp bot queue.
;-------------------------------------------------------------------------------------------
var %rand.bt = $rand($minautoqdelay, $maxautoqdelay)
/outputxdccinfo 9Transfer Completed: Got2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) from7 $nick $+ . Temporary Bot Queue exists. Moving to next bot in Temporary Bot Queue file in %rand.bt seconds (7 $+ $read($tempbotqueuefile, 1) $+ ).
.timerxdccstartbotq $+ $gettok($read($tempbotqueuefile,1),1,32) $+ 3 1 %rand.bt /startqueue $gettok($read($tempbotqueuefile, nt, 1),1,32)
if (!$read($xdccsinprogress,snt,$nick) && $exists($getqfilenm($network, $nick))) { /write -a $xdccsinprogress $nick $read($getqfilenm($network, $nick), t, 0) }
/write -dl1 $tempbotqueuefile
}
elseif ($exists($getqfilenm($network, $nick))) {
;-------------------------------------------------------------------------------------------
;If there is no temp bot queue, move to the next queued item for this bot.
;-------------------------------------------------------------------------------------------
var %packnum = $read($getqfilenm($network, $nick), t, 0)
var %trigger = $triggerHash.getTrigger($network, $nick) $+ %packnum
var %rand.bt = $rand($minautoqdelay, $maxautoqdelay)
if ($checkFPF($network, $nick, %packnum) == false) {
/outputxdccinfo 9Transfer Completed: Got2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) from7 $nick $+ . 3Auto-requesting next pack in %rand.bt seconds ( $+ %trigger $+ ).
if ($gettok(%trigger, 1, 32) == /msg) { /timerxdccstartq $+ $nick $+ 2 1 %rand.bt /msg $gettok(%trigger, 2-, 32) }
elseif ($gettok(%trigger, 1, 32) == /ctcp) { /timerxdccstartq $+ $nick $+ 2 1 %rand.bt /ctcp $gettok(%trigger, 2-, 32) }
elseif ($gettok(%trigger, 1, 32) == /notice) { /timerxdccstartq $+ $nick $+ 2 1 %rand.bt /notice $gettok(%trigger, 2-, 32) }
else { /outputxdccinfo 4ERROR: Unknown trigger type ( $+ %trigger $+ ) }
if (!$read($xdccsinprogress, wnt,$nick $read($getqfilenm($network, $nick), t, 0))) {
//write -a $xdccsinprogress $nick $read($getqfilenm($network, $nick), t, 0)
}
}
elseif (($lines($getqfilenm($network,$nick)) > 1) && $botqueuehandling == on) {
/write -a $getqfilenm($network,$nick) $read($getqfilenm($network,$nick),nt,1)
/write -dl1 $getqfilenm($network,$nick)
/write -i1 $tempbotqueuefile $nick $read($getqfilenm($network,$nick),nt,1)
/write -dw $+ $nick $+ ¦ $+ $network $autoresumedisablefile
/outputxdccinfo File is 9already transfering for3 $network $+ ¦7 $+ $nick pack13 %packnum $+ . Moving to next pack in queue in %rand.bt seconds.
/timerxdccstartq $+ $nick $+ 2 1 %rand.bt /startbotqueues 1
}
else {
if (!$read($xdccsinprogress,snt,$nick)) { //write -a $xdccsinprogress $nick %packnum }
/outputxdccinfo File is 9already transfering for3 $network $+ ¦7 $+ $nick pack13 %packnum $+ .
}
}
elseif ($botqueuehandling == on) {
;-------------------------------------------------------------------------------------------
;Here we must move to the bot queue. if there is a bot queue file, take the next bot in line
;and start it's queue, and remove it from the bot queue.
;-------------------------------------------------------------------------------------------
/removebotqueue $nick
if ($exists($botqueuefile)) {
var %rand.bt = $rand($minautoqdelay, $maxautoqdelay)
/outputxdccinfo 9Transfer Completed: Got2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) from7 $nick $+ , no more queues exist for this bot. Moving to next bot in Bot Queue file in %rand.bt seconds (7 $+ $read($botqueuefile, 1) $+ ).
.timerxdccstartbotq $+ $read($botqueuefile, 1) $+ 1 1 %rand.bt /startqueue $read($botqueuefile, 1)
}
else {
/outputxdccinfo 9Transfer Completed: Got2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) from7 $nick $+ , no more queues exist for this bot. No Bot Queue file exists.
}
}
else { /outputxdccinfo 9Transfer Completed: Got2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) from7 $nick $+ , no more queues exist for this bot. 4Bot Queue Handling OFF. }
}
if (!$exists($xdccsessiongetfile) || !$read($xdccsessiongetfile, wnt,$file($filename).size 7 $+ * $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 [*])) {
/write -a $xdccsessiongetfile $file($filename).size 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 $asctime([dd/mm/yyyy][HH:nn:ss])
}
if (!$exists($xdcctotalgetfile) || !$read($xdcctotalgetfile, wnt,$file($filename).size 7 $+ * $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 [*])) {
/write -a $xdcctotalgetfile $file($filename).size 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 $asctime([dd/mm/yyyy][HH:nn:ss])
}
/removeallwmatches $xdccsessionfailfile GetFail * 7 $+ * $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $xdccsessionfailfile UnfinishedGet * 7 $+ * $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $lastsessionfailfile GetFail * 7 $+ * $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $totalfailfile GetFail * 7 $+ * $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
if ($exists($xdccqueueposfile) && $read($xdccqueueposfile, wnt, $nick $+ ¦ $+ * $+ ¦ $+ *)) {
/write -dw $+ $nick $+ ¦* $xdccqueueposfile
}
if ($botqueuehandling == on && testnumoftransferspeed == on && $botqueuemode == bandwidth) { .timexdcctransferstest }
inc %filesgettotal
var %filename = $null
if ($xdccautomove == on) {
var %movepath = $null
var %extension = $right($nopath($filename),- $+ $pos($nopath($filename),$chr(46),$pos($nopath($filename),$chr(46),0)))
;if ($xdccautoextraction != on || (%extension != rar && %extension != zip && %extension != tar)) {
if ($exists($xdccautomovepathfile) && $read($xdccautomovepathfile,snt,%extension)) {
var %movepath = $read($xdccautomovepathfile,snt,%extension)
}
elseif ($exists($xdccautomovepathfile) && $read($xdccautomovepathfile,snt,$chr(42))) {
var %movepath = $read($xdccautomovepathfile,snt,$chr(42))
}
if (%movepath != $null) {
if (!$exists($preventdoubleslash(%movepath $+ \ $+ $nopath($filename)))) {
set %filename $preventdoubleslash(%movepath $+ \ $+ $nopath($filename))
.rename " $+ $filename $+ " " $+ %filename $+ "
/outputxdccinfo 3Renamed file2 " $+ $filename $+ " 3to2 " $+ %filename $+ ".
}
else { /outputxdccinfo 4Can't rename file: target already exists. }
}
;}
}
if ($xdccautoextraction == on) {
if (%filename == $null) { set %filename $filename }
if ($winrarexe != $null) {
if (*.rar iswm $nopath(%filename) || *.tar iswm $nopath(%filename) || *.zip iswm $nopath(%filename)) {
/outputxdccinfo 10Unrarring2 %filename 10to2 $xdccextractpath $+ 10...
//run $winrarexe x $unrarflags %filename $xdccextractpath
}
}
else {
/outputxdccinfo 4Can't locate winrar exe, please set the proper executable path.
}
}
/outputxdccinfo
}
#groupautoxdccq end
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:FILERCVD:*:{
if ($botliston == TRUE && $triggerHash.exists($network, $nick)) {
if ($me ison $triggerHash.getChan($network, $nick) && $nick ison $triggerHash.getChan($network, $nick)) { //cline -lc7 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
elseif ($server == $null && $network == $triggerHash.network($nick)) { //cline -lc14 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
else { //cline -lc10 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
}
if ($read($xdccsinprogress, s, $nick)) { /write -ds $+ $nick $xdccsinprogress }
if ($read($networkfile($network), wn, * $nick *)) {
if ($lines($networkfile($network)) <= 1) { .remove $networkfile($network) }
else { /write -dw"* $nick *" $networkfile($network) }
}
/outputxdccinfo 6Dequeueing all packs for3 $network $+ ¦7 $nick matching13 * $+ $remvextent($nopath($filename)) $+ *, or first pack in queue if no matching packs are found.
if ($read($getpfffilenm($network, $nick),wtn, * $+ $remvextent($nopath($filename)) $+ *)) {
var %i = 0
var %llen = $lines($getpfffilenm($network, $nick))
while (%i <= %llen) {
if (* $+ $remvextent($nopath($filename)) $+ * iswm $read($getpfffilenm($network, $nick),%i)) {
.removefromq $nick $network $gettok($read($getpfffilenm($network, $nick), %i),1, 32)
}
inc %i
}
}
else {
if ($lines($getqfilenm($network, $nick)) <= 1) { .remove $getqfilenm($network, $nick) }
else { /write -dl1 $getqfilenm($network, $nick) }
}
if ($clearallqueuesoncomplete == on) { /removepackfromallbots $replxdccfile($nick $network) $filename }
if (!$exists($xdccsessiongetfile) || !$read($xdccsessiongetfile, wnt,$file($filename).size 7 $+ * $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 [*])) {
/write -a $xdccsessiongetfile $file($filename).size 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 $asctime([dd/mm/yyyy][HH:nn:ss])
}
if (!$exists($xdcctotalgetfile) || !$read($xdcctotalgetfile, wnt,$file($filename).size 7 $+ * $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 [*])) {
/write -a $xdcctotalgetfile $file($filename).size 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 $asctime([dd/mm/yyyy][HH:nn:ss])
}
/removeallwmatches $xdccsessionfailfile GetFail * 7 $+ * $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $xdccsessionfailfile UnfinishedGet * 7 $+ * $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $lastsessionfailfile GetFail * 7 $+ * $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $totalfailfile GetFail * 7 $+ * $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
if ($exists($xdccqueueposfile) && $read($xdccqueueposfile, wnt, $nick $+ ¦ $+ * $+ ¦ $+ *)) {
/write -dw $+ $nick $+ ¦* $xdccqueueposfile
}
inc %filesgettotal
var %filename = $null
if ($xdccautomove == on) {
var %movepath = $null
var %extension = $right($nopath($filename),- $+ $pos($nopath($filename),$chr(46),$pos($nopath($filename),$chr(46),0)))
;if ($xdccautoextraction != on || (%extension != rar && %extension != zip && %extension != tar)) {
if ($exists($xdccautomovepathfile) && $read($xdccautomovepathfile,snt,%extension)) {
var %movepath = $read($xdccautomovepathfile,snt,%extension)
}
elseif ($exists($xdccautomovepathfile) && $read($xdccautomovepathfile,snt,$chr(42))) {
var %movepath = $read($xdccautomovepathfile,snt,$chr(42))
}
if (%movepath != $null) {
if (!$exists($preventdoubleslash(%movepath $+ \ $+ $nopath($filename)))) {
set %filename $preventdoubleslash(%movepath $+ \ $+ $nopath($filename))
.rename " $+ $filename $+ " " $+ %filename $+ "
/outputxdccinfo 3Renamed file2 " $+ $filename $+ " 3to2 " $+ %filename $+ ".
}
else { /outputxdccinfo 4Can't rename file: target already exists. }
}
;}
}
/outputxdccinfo 9Transfer Completed: Got2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) from7 $nick $+ . Autoqueue OFF.
if ($xdccautoextraction == on) {
if (%filename == $null) { set %filename $filename }
if ($winrarexe != $null) {
if (*.rar iswm $nopath(%filename) || *.tar iswm $nopath(%filename) || *.zip iswm $nopath(%filename)) {
/outputxdccinfo 10Unrarring2 %filename 10to2 $xdccextractpath $+ 10...
//run $winrarexe x $unrarflags %filename $xdccextractpath
}
}
else {
/outputxdccinfo 4Can't locate winrar exe, please set the proper executable path.
}
}
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#groupautoxdccresume on
;-------------------------------------------------------------------------
; If autoresume is on:
; This trigger detects a failed transfer and sets a timer between 1 and 30
; seconds. After the timer finishes, the trigger and packnumber are sent
; to the bot in question (if that bot is in the library) to get a resume.
; It then deactivates the autoresume for that bot temporarily by writing
; it to a "disabled bots" file. This is because a fileserver that keeps
; timing out may cause the script to infinitly request the file, which
; will look VERY suspicious to any bot owner.
;-------------------------------------------------------------------------
; If autoresume is not on:
; Remove a failed download from the currently active transfers list.
;-------------------------------------------------------------------------
on *:GETFAIL:*:{
if ($triggerHash.exists($network, $nick) && $botliston == TRUE) { //cline -lc4 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
/outputxdccinfo 4GET fail from7 $nick on3 $network occured.
var %filegetinprogress = $null
var %i = 1
while (%i <= $get(0)) {
if ($get(%i).file == $nopath($filename) && $get(%i).status == active) { //set %filegetinprogress $get(%i) }
inc %i
}
var %rand.bt = $rand($minresumedelay ,$maxresumedelay)
if ($xdccpreemptivejoin == on) { preemptiveJoin $network $nick }
if (%filegetinprogress == $null) {
if (!$exists($autoresumedisablefile) || !$read($autoresumedisablefile, wnt, $nick $+ ¦ $+ $network)) {
if ($triggerHash($network, $nick)) {
var %trigger = $null
if ($read($xdccsinprogress,snt,$nick)) {
set %trigger $triggerHash.getTrigger($network, $nick) $+ $read($xdccsinprogress,snt,$nick)
}
elseif ($exists($getqfilenm($network, $nick))) {
set %trigger $triggerHash.getTrigger($network, $nick) $+ $read($getqfilenm($network, $nick), nt, 1)
}
if (%trigger != $null) {
if ($exists($dccallownetworkfile) && $read($dccallownetworkfile,wnt,$network)) { /DCCALLOW + $+ $nick }
if ($exists($alternatedccserverfile) && $read($alternatedccserverfile,snt,$network $nick)) { $read($alternatedccserverfile,snt,$network $nick) }
/outputxdccinfo I 4failed to get the file2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ ) from7 $nick ( $+ %trigger $+ ), 3re-requesting in %rand.bt seconds
if ($gettok(%trigger, 1, 32) == /msg) { /timerxdccautoresume $+ $nick $+ 1 1 %rand.bt /msg $gettok(%trigger, 2-, 32) }
elseif ($gettok(%trigger, 1, 32) == /ctcp) { /timerxdccautoresume $+ $nick $+ 1 1 %rand.bt /ctcp $gettok(%trigger, 2-, 32) }
elseif ($gettok(%trigger, 1, 32) == /notice) { /timerxdccautoresume $+ $nick $+ 1 1 %rand.bt /notice $gettok(%trigger, 2-, 32) }
else { /outputxdccinfo 4ERROR: unknown trigger type ( $+ %trigger $+ ) }
/outputxdccinfo 14Disabling group2 autoxdccresume for7 $nick for $calc($resumedelay + %rand.bt) seconds to prevent repetitive request.
.timer -o 1 $calc($resumedelay + %rand.bt) /write -dw $+ $nick $+ ¦ $+ $network $autoresumedisablefile
if (!$read($autoresumedisablefile, wnt, $nick $+ ¦ $+ $network)) {
/write -a $autoresumedisablefile $nick $+ ¦ $+ $network
}
.timer -o 1 $calc($resumedelay + %rand.bt + 1) /outputxdccinfo 2Autoresume14 reenabled for3 $network $+ 7 $nick $+ .
.timer -o 1 $calc($resumedelay + %rand.bt + 1) /outputxdccinfo
}
else { /outputxdccinfo 4Cannot autoresume:3 $network $+ 7 $nick not in XDCC sends file, no queue file available, pack number unknown. }
}
else { /outputxdccinfo 4Cannot autoresume:3 $network $+ 7 $nick not in XDCC bot library. }
}
else {
/outputxdccinfo 4Not resuming pack for3 $network $+ 7 $nick $+ : Autoresume temporarily disabled for this bot to avoid bot flooding. This could be caused by a defective or unwilling bot or by setting a very long autoresume time interval.
if ($shouldstartmaxbotq != $null) {
if ($botqueuehandling == on) {
/startbotqueues 1
}
if ($read($xdccsinprogress , s, $nick)) { /write -i1 $tempbotqueuefile $nick $read($xdccsinprogress , s, $nick) }
elseif ($exists($getqfilenm($network, $nick))) { /write -i1 $tempbotqueuefile $nick $read($getqfilenm($network, $nick), nt, 1) }
}
}
}
else {
.timeoff $nick $network
if (!$read($autoresumedisablefile, wnt, $nick $+ ¦ $+ $network)) {
/write -a $autoresumedisablefile $nick $+ ¦ $+ $network
}
if ($exists($tempbotqueuefile) && $read($tempbotqueuefile,snt,$nick)) {
/write -ds $+ $nick $tempbotqueuefile
}
if ($exists($botqueuefile) && $read($botqueuefile,snt,$nick)) {
/write -ds $+ $nick $botqueuefile
}
if (($lines($getqfilenm($network,$nick)) > 1) && $botqueuehandling == on) {
/write -a $getqfilenm($network,$nick) $read($getqfilenm($network,$nick),nt,1)
/write -dl1 $getqfilenm($network,$nick)
/write -i1 $tempbotqueuefile $nick $read($getqfilenm($network,$nick),nt,1)
/write -dw $+ $nick $+ ¦ $+ $network $autoresumedisablefile
/outputxdccinfo I 4failed to get the file2 $nofile($filename) $+ 13 $+ $nopath($filename) $+ from7 $nick ( $+ $triggerHash.getTrigger($network,$nick) $+ ). Bot7 %filegetinprogress on network3 $network is already 9transfering. 7Not re-requesting file. Moving to next pack in bot's queue (13 $+ $read($getqfilenm($network,$nick),nt,1) $+ ) in %rand.bt seconds and circulating current pack to end of bot's queue file.
/timerxdccautoresume $+ $nick $+ 1 1 %rand.bt /startbotqueues 1
}
else {
if (!$read($xdccsinprogress,snt,$nick)) { //write -a $xdccsinprogress $nick $read($getqfilenm($network,$nick),nt,1) }
/outputxdccinfo I 4failed to get the file2 $nofile($filename) $+ 13 $+ $nopath($filename) $+ from7 $nick ( $+ $triggerHash.getTrigger($network,$nick) $+ ). Bot7 %filegetinprogress on network3 $network is already 9transfering. 7Not re-requesting file. No other queues for this bot.
}
}
if ($botqueuehandling == on && testnumoftransferspeed == on && $botqueuemode == bandwidth) { .timexdcctransferstest }
/removeallwmatches $xdccsessionfailfile UnfinishedGet * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $xdccsessionfailfile GetFail * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $lastsessionfailfile GetFail * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $totalfailfile GetFail * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/write -a $xdccsessionfailfile GetFail $iif($file($filename).size != $null,$file($filename).size,0) 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) $asctime([dd/mm/yyyy][HH:nn:ss])
/write -a $totalfailfile GetFail $iif($file($filename).size != $null,$file($filename).size,0) 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) $asctime([dd/mm/yyyy][HH:nn:ss])
/outputxdccinfo
}
#groupautoxdccresume end
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:GETFAIL:*:{
if ($triggerHash.exists($network, $nick) && $botliston == TRUE) { //cline -lc4 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
/outputxdccinfo 4GET fail from7 $nick on3 $network occured. 4Not resuming pack for3 $network $+ 7 $nick $+ : Autoresume disabled.
if ($read($xdccsinprogress, s, $nick)) { /write -ds $+ $nick $xdccsinprogress }
/removeallwmatches $xdccsessionfailfile UnfinishedGet * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $xdccsessionfailfile GetFail * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $lastsessionfailfile GetFail * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $totalfailfile GetFail * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/write -a $xdccsessionfailfile GetFail $iif($file($filename).size != $null,$file($filename).size,0) 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) $asctime([dd/mm/yyyy][HH:nn:ss])
/write -a $totalfailfile GetFail $iif($file($filename).size != $null,$file($filename).size,0) 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) $asctime([dd/mm/yyyy][HH:nn:ss])
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#groupautosendresume on
;-------------------------------------------------------------------------
; This should resume a failed upload with the given bandwidth limit if the
; autoresume send group is ON, and disable further upload retries for that
; recipient for a time period.
;-------------------------------------------------------------------------
on *:SENDFAIL:*:{
if (!$read($autoresumesenddisablefile, wnt,$nick)) {
var %rand.bt = $rand(0,$sendresumetime)
/outputxdccinfo I 4failed to send the file2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ ) to7 $nick $+ , 3re-sending in %rand.bt seconds
/outputxdccinfo 14Disabling group2 Auto Send Resume for7 $nick for $calc($resumedelay + %rand.bt) seconds to prevent unwanted resends.
.timer -o 1 $calc($sendresumedelay + %rand.bt) /write -dw $+ $nick $autoresumesenddisablefile
if (!$read($autoresumesenddisablefile, wnt,$nick)) {
/write -a $autoresumesenddisablefile $nick
}
.timer -o 1 $calc($sendresumedelay + %rand.bt) /outputxdccinfo 2Auto Send Resume14 reenabled for7 $nick $+ .
.timer -o 1 $calc($sendresumedelay + %rand.bt) /outputxdccinfo
if ($sendlimit isnum) {
/timerxdccsendresume $+ $nick 1 %rand.bt /dcc send -cl $+ $sendlimit $nick $filename
}
else {
/timerxdccsendresume $+ $nick 1 %rand.bt /dcc send -c $nick $filename
}
}
else {
/outputxdccinfo 4Not resuming SEND for7 $nick $+ : Auto Send Resume temporarily disabled for this recipient to avoid unwanted resends. This could be caused by a defective or unwilling recipient or by setting a very long auto send resume time interval.
}
/removeallwmatches $xdccsessionfailfile UnfinishedSend * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $xdccsessionfailfile SendFail * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $lastsessionfailfile SendFail * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $totalfailfile SendFail * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/write -a $xdccsessionfailfile SendFail $iif($file($filename).size != $null,$file($filename).size,0) 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) $asctime([dd/mm/yyyy][HH:nn:ss])
/write -a $totalfailfile SendFail $iif($file($filename).size != $null,$file($filename).size,0) 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) $asctime([dd/mm/yyyy][HH:nn:ss])
/outputxdccinfo
}
#groupautosendresume end
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:SENDFAIL:*:{
/removeallwmatches $xdccsessionfailfile UnfinishedSend * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $xdccsessionfailfile SendFail * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $lastsessionfailfile SendFail * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $totalfailfile SendFail * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/write -a $xdccsessionfailfile SendFail $iif($file($filename).size != $null,$file($filename).size,0) 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) $asctime([dd/mm/yyyy][HH:nn:ss])
/write -a $totalfailfile SendFail $iif($file($filename).size != $null,$file($filename).size,0) 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) $asctime([dd/mm/yyyy][HH:nn:ss])
/outputxdccinfo I 4failed to SEND the file2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ ) to7 $nick $+ . 4Not resuming send for7 $nick $+ : Autoresume Send disabled.
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
; Outputs a comment to the xdcc script output window if a file was
; succesfully sent, and adds that file and the recipient's nickname to the
; completed uploads file.
;-------------------------------------------------------------------------
on *:FILESENT:*:{
if (!$exists($xdccsessionsendfile) || !$read($xdccsessionsendfile, wnt, * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 [*])) {
/write -a $xdccsessionsendfile $file($filename).size 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 $asctime([dd/mm/yyyy][HH:nn:ss])
}
if (!$exists($xdcctotalsendfile) || !$read($xdcctotalsendfile, wnt, * 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 [*])) {
/write -a $xdcctotalsendfile $file($filename).size 7 $+ $nick $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename)) $+ 15 $asctime([dd/mm/yyyy][HH:nn:ss])
}
/removeallwmatches $xdccsessionfailfile SendFail * 7 $+ * $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $xdccsessionfailfile UnfinishedSend * 7 $+ * $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $lastsessionfailfile SendFail * 7 $+ * $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
/removeallwmatches $totalfailfile SendFail * 7 $+ * $+ 2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ 15) [*]
inc %filessenttotal
/outputxdccinfo 3Succesfully SENT2 $replace($filename,$nopath($filename),13 $+ $nopath($filename) $+ ) to7 $nick $+ 15 $address
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#groupautoxdccresumejoin on
;-------------------------------------------------------------------------
; The on join should resume a file that was unfinished if the appropriate
; bot comes online.
;-------------------------------------------------------------------------
on *:JOIN:#:{
if ($nick == $me) {
/outputxdccinfo Joined channel12 $chan on network3 $network $+ .
if ($colorbotlist == on && $botliston == TRUE) { .timer 1 3 /colorchannicks $chan }
/outputxdccinfo
}
elseif ($triggerHash.exists($network, $nick) != $null) {
var %requested = 0
if ($exists($autoresumedisablefile) && $read($autoresumedisablefile, wnt, $nick $+ ¦ $+ $network)) {
/outputxdccinfo 4Not resuming pack for3 $network $+ 7 $nick $+ :7 $nick just rejoined12 $chan $+ . Autoresume temporarily disabled for this bot to avoid bot flooding. This could be caused by a defective or unwilling bot or by setting a very long autoresume time interval, or because you suspended autoresume and queue features for this bot (14you can reenable these features by restarting the bot's queue manually).
/outputxdccinfo
}
elseif ($exists($xdccsinprogress) && $get($nick).status != active) {
if ($read($xdccsinprogress, snt, $nick)) {
if ($botqueuehandling == off || $shouldstartmaxbotq != $null) {
var %packnum = $read($xdccsinprogress, snt, $nick)
var %trigger = $triggerHash.getTrigger($network, $nick) $+ $read($xdccsinprogress, snt, $nick)
var %rand.bt = $rand($minresumedelay, $maxresumedelay)
if ($checkFPF($network, $nick, %packnum) == false) {
/outputxdccinfo 7 $+ $nick ( $+ %trigger $+ ) just joined12 $chan and has an unfinished transfer listed in the general transfers file, 3re-requesting in %rand.bt seconds.
if ($exists($dccallownetworkfile) && $read($dccallownetworkfile,wnt,$network)) { /DCCALLOW + $+ $nick }
if ($exists($alternatedccserverfile) && $read($alternatedccserverfile,snt,$network $nick)) { $read($alternatedccserverfile,snt,$network $nick) }
if ($gettok(%trigger, 1, 32) == /msg) { /timerxdccautoresume $+ $nick $+ 1 1 %rand.bt /msg $gettok(%trigger, 2-, 32) }
elseif ($gettok(%trigger, 1, 32) == /ctcp) { /timerxdccautoresume $+ $nick $+ 1 1 %rand.bt /ctcp $gettok(%trigger, 2-, 32) }
elseif ($gettok(%trigger, 1, 32) == /notice) { /timerxdccautoresume $+ $nick $+ 1 1 %rand.bt /notice $gettok(%trigger, 2-, 32) }
else { /outputxdccinfo 4ERROR: unknown trigger type ( $+ %trigger $+ ) }
set %requested 1
/outputxdccinfo 14Disabling group2 autoxdccresume for7 $nick for $calc($resumedelay + %rand.bt) seconds to prevent repetitive request.
/outputxdccinfo
.timer -o 1 $calc($resumedelay + %rand.bt) /write -dw $+ $nick $+ ¦ $+ $network $autoresumedisablefile
if (!$read($autoresumedisablefile, wnt, $nick $+ ¦ $+ $network)) {
/write -a $autoresumedisablefile $nick $+ ¦ $+ $network
}
.timer -o 1 $calc($resumedelay + %rand.bt + 1) /outputxdccinfo 2Autoresume14 reenabled for3 $network $+ 7 $nick $+ .
.timer -o 1 $calc($resumedelay + %rand.bt + 1) /outputxdccinfo
}
elseif (($lines($getqfilenm($network,$nick)) > 1) && $botqueuehandling == on) {
/write -a $getqfilenm($network,$nick) $read($getqfilenm($network,$nick),nt,1)
/write -dl1 $getqfilenm($network,$nick)
/write -i1 $tempbotqueuefile $nick $read($getqfilenm($network,$nick),nt,1)
/write -dw $+ $nick $+ ¦ $+ $network $autoresumedisablefile
/outputxdccinfo File is 9already transfering for3 $network $+ ¦7 $+ $nick pack13 %packnum $+ . Moving to next pack in queue in %rand.bt seconds.
/timerxdccautoresume $+ $nick $+ 1 1 %rand.bt /startbotqueues 1
set %requested 1
}
else {
if (!$read($xdccsinprogress,snt,$nick)) { //write -a $xdccsinprogress $nick %packnum }
/outputxdccinfo File is 9already transfering for3 $network $+ ¦7 $+ $nick pack13 %packnum $+ .
/outputxdccinfo
}
}
elseif ($get($nick).status != active && $exists($xdccsinprogress) && $read($xdccsinprogress , s, $nick)) {
var %trigger = $null
var %trigger = $read($xdccsinprogress, w, $nick *)
/outputxdccinfo 7 $+ $nick ( $+ %trigger $+ ) just joined12 $chan and has an unfinished transfer listed in the general transfers file, 4all send slots in use. Adding $nick to Temp Bot Queue file.
if (%trigger != $null && !$read($tempbotqueuefile, snt,$nick)) { /write -i1 $tempbotqueuefile %trigger }
}
}
elseif ($exists($networkfile($network)) && %requested != 1 && $get($nick).status != active) {
if ($read($networkfile($network), wnt,* $nick *)) {
if ($botqueuehandling == off || $shouldstartmaxbotq != $null) {
var %trigger = $read($networkfile($network),wnt,* $nick *)
var %packnum = $remove($gettok(%trigger,$numtok(%trigger,32),32),$chr(35))
var %rand.bt = $rand($minresumedelay , $maxresumedelay)
if ($checkFPF($network, $nick, %packnum) == false) {
/outputxdccinfo 7 $+ $nick ( $+ %trigger $+ ) just joined12 $chan and has an unfinished transfer listed in the3 $network network specific transfers file, 3re-requesting in %rand.bt seconds
if ($exists($dccallownetworkfile) && $read($dccallownetworkfile,wnt,$network)) { /DCCALLOW + $+ $nick }
if ($exists($alternatedccserverfile) && $read($alternatedccserverfile,snt,$network $nick)) { $read($alternatedccserverfile,snt,$network $nick) }
if ($gettok(%trigger, 1, 32) == /msg) { /timerxdccautoresume $+ $nick $+ 1 1 %rand.bt /msg $gettok(%trigger, 2-, 32) }
elseif ($gettok(%trigger, 1, 32) == /ctcp) { /timerxdccautoresume $+ $nick $+ 1 1 %rand.bt /ctcp $gettok(%trigger, 2-, 32) }
elseif ($gettok(%trigger, 1, 32) == /notice) { /timerxdccautoresume $+ $nick $+ 1 1 %rand.bt /notice $gettok(%trigger, 2-, 32) }
else { /outputxdccinfo 4ERROR: unknown trigger type ( $+ %trigger $+ ) }
/outputxdccinfo 14Disabling group2 autoxdccresume for7 $nick for $calc($resumedelay + %rand.bt) seconds to prevent repetitive request.
/outputxdccinfo
.timer -o 1 $calc($resumedelay + %rand.bt) /write -dw $+ $nick $+ ¦ $+ $network $autoresumedisablefile
if (!$read($autoresumedisablefile, wnt, $nick $+ ¦ $+ $network)) {
/write -a $autoresumedisablefile $nick $+ ¦ $+ $network
}
.timer -o 1 $calc($resumedelay + %rand.bt + 1) /outputxdccinfo 2Autoresume14 reenabled for3 $network $+ 7 $nick $+ .
.timer -o 1 $calc($resumedelay + %rand.bt + 1) /outputxdccinfo
}
elseif (($lines($getqfilenm($network,$nick)) > 1) && $botqueuehandling == on) {
/write -a $getqfilenm($network,$nick) $read($getqfilenm($network,$nick),nt,1)
/write -dl1 $getqfilenm($network,$nick)
/write -i1 $tempbotqueuefile $nick $read($getqfilenm($network,$nick),nt,1)
/write -dw $+ $nick $+ ¦ $+ $network $autoresumedisablefile
/outputxdccinfo File is 9already transfering for3 $network $+ ¦7 $+ $nick pack13 %packnum $+ . Moving to next pack in queue in %rand.bt seconds.
/timerxdccautoresume $+ $nick $+ 1 1 %rand.bt /startbotqueues 1
}
else {
if (!$read($xdccsinprogress,snt,$nick)) { //write -a $xdccsinprogress $nick %packnum }
/outputxdccinfo File is 9already transfering for3 $network $+ ¦7 $+ $nick pack13 %packnum $+ .
/outputxdccinfo
}
}
elseif ($get($nick).status != active) {
var %trigger = $null
var %trigger = $nick $read($getqfilenm($network,$nick))
/outputxdccinfo 7 $+ $nick ( $+ %trigger $+ ) just joined12 $chan and has an unfinished transfer listed in the general transfers file, 4all send slots in use. Adding $nick to Temp Bot Queue file.
if (%trigger != $null && !$read($tempbotqueuefile, snt,$nick)) { /write -i1 $tempbotqueuefile %trigger }
}
}
}
;else { /outputxdccinfo No unfinished packs listed for $network and no unspecified unfinished packs listed in "xdcc in progres file". }
}
if ($colorbotlist == on && $get($nick).status != active && $botliston == TRUE) { //cline -lc7 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
}
}
#groupautoxdccresumejoin end
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
ON *:JOIN:#:{
if ($nick == $me) {
/outputxdccinfo Joined channel12 $chan on network3 $network $+ .
if ($colorbotlist == on) { .timer 1 3 /colorchannicks $chan }
/outputxdccinfo
}
elseif ($colorbotlist == on && $triggerHash.exists($network, $nick) && $get($nick).status != active && $botliston == TRUE) { //cline -lc7 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
; When a known bot changes it's nickname, copy it's entire profile.
;-------------------------------------------------------------------------
#groupnickchangedetect off
on 1:NICK:{
if ($triggerHash.exists($network,$nick)) {
if (!$triggerHash.exists($network,$newnick)) {
/outputxdccinfo Bot7 $nick on3 $network changed nickname to7 $newnick $+ . Copying profile and swapping timers.
//triggerHash.add $network $newnick $replace($gettok($hget($triggerHash, $network $+ ¦ $+ $nick),3-,32),$chr(32) $+ $nick $+ $chr(32),$chr(32) $+ $newnick $+ $chr(32))
//aline -lc7 @XDCC_Info $newnick
}
else {
/outputxdccinfo Bot7 $nick on3 $network changed nickname to7 $newnick $+ . Profile for7 $newnick exists, overwriting.
}
if ($exists($getpfffilenm($network,$nick))) { .copy -o $getpfffilenm($network,$nick) $getpfffilenm($network,$newnick) }
if ($exists($getqfilenm($network,$nick))) { .copy -o $getqfilenm($network,$nick) $getqfilenm($network,$newnick) }
if ($exists($getfpffilenm($network,$nick))) { .copy -o $getfpffilenm($network,$nick) $getfpffilenm($network,$newnick) }
if ($exists($getoldfilenm($network,$nick))) { .copy -o $getoldfilenm($network,$nick) $getoldfilenm($network,$newnick) }
if ($exists($specalternatebotsfile($network,$nick))) { .copy -o $specalternatebotsfile($network,$nick) $specalternatebotsfile($network,$newnick) }
if ($exists($replace($specalternatebotsfile($network,$nick),.aq,.aqt))) { .copy -o $replace($specalternatebotsfile($network,$nick),.aq,.aqt) $replace($specalternatebotsfile($network,$newnick),.aq,.aqt) }
; Copy all timers.
var %i = 1
var %llen = $timer(0)
while (%i <= %llen) {
if ($isXDCCTimer(%i) && * $+ $nick $+ * isin $timer(%i).com) {
/timer $+ $replace($timer(%i),$nick,$newnick) 1 $calc($timer(%i).sec + 3) $replace($timer(%i),$nick,$newnick))
;if ((* $+ $nick $+ ¦ $+ $network * $autoresumedisablefile * !iswm $timer(%i).com) && (* $+ $nick * $autoresumesenddisablefile * !iswm $timer(%i).com)) { /timer $+ $timer(%i) off }
}
inc %i
}
; Copy entries in general files:
; -xdccinprogressfile,
if ($exists($xdccsinprogress) && !$read($xdccsinprogress,wnt,$newnick *)) {
var %i = 1
var %llen = $lines($xdccsinprogress)
while (%i <= %llen && $read($xdccsinprogress,snt,$nick,%i)) {
//write -a $xdccsinprogress $newnick $read($xdccsinprogress,snt,$nick,%i)
set %i $readn
inc %i
}
}
; -xdccdisabledfile, remove entry for $nick.
if ($exists($autoresumedisablefile) && !$read($autoresumedisablefile,wnt,$newnick $+ ¦ $+ $network) && $read($autoresumedisablefile,wnt,$nick $+ ¦ $+ $network)) {
//write -a $autoresumedisablefile $newnick $+ ¦ $network
}
; -$network.apq,
if ($exists($networkfile($network))) {
var %i = 1
var %llen = $lines($networkfile($network))
while (%i <= %llen && $read($networkfile($network),wnt,* $nick *,%i)) {
//write -a $networkfile($network) $replace($read($networkfile($network),wnt,* $nick *,%i),$nick,$newnick)
set %i $readn
inc %i
}
}
; -alternatebotsfile,
if ($exists($alternatebotsfile)) {
var %i = 1
var %llen = $lines($alternatebotsfile)
while (%i <= %llen && $read($alternatebotsfile,wnt,$network $nick $specalternatebotsfile($network,$nick),%i)) {
//write -a $alternatebotsfile $replace($read($alternatebotsfile,wnt,$network $nick $specalternatebotsfile($network,$newnick),%i),$nick,$newnick)
set %i $readn
inc %i
}
}
; -alternatedccserverfile
if ($exists($alternatedccserverfile)) {
var %i = 1
var %llen = $lines($alternatedccserverfile)
while (%i <= %llen && $read($alternatedccserverfile,wnt,$network $nick *,%i)) {
//write -a $alternatedccserverfile $replace($read($alternatedccserverfile,wnt,$network $nick *,%i),$nick,$newnick)
set %i $readn
inc %i
}
}
; Move entries in (tmp)botq
if ($exists($tempbotqueuefile)) {
var %i = 1
var %llen = $lines($tempbotqueuefile)
while (%i <= %llen && $read($tempbotqueuefile,wnt,$nick *)) {
//write -a $tempbotqueuefile $replace($read($tempbotqueuefile,wnt,$nick *),$nick,$newnick)
//write -dw" $+ $replace($read($tempbotqueuefile,wnt,$nick *),$nick,$newnick) $+ " $tempbotqueuefile
dec %llen
inc %i
}
}
if ($exists($botqueuefile)) {
var %i = 1
var %llen = $lines($botqueuefile)
while (%i <= %llen && $read($botqueuefile,wnt,$nick)) {
//write -a $botqueuefile $replace($read($botqueuefile,wnt,$nick),$nick,$newnick)
//write -dw $+ $read($botqueuefile,wnt,$nick) $botqueuefile
dec %llen
inc %i
}
}
if ($exists($xdccqueueposfile)) {
var %i = 1
var %llen = $lines($xdccqueueposfile)
while (%i <= %llen && $read($xdccqueueposfile,wnt,$nick $+ ¦ $+ * $nick *)) {
//write -a $xdccqueueposfile $replace($read($xdccqueueposfile,wnt,$nick $+ ¦ $+ * $nick *),$nick,$newnick)
//write -dw $+ $read($xdccqueueposfile,wnt,$nick $+ ¦ $+ * $nick *) $xdccqueueposfile
dec %llen
inc %i
}
}
if ($exists($autoresumesenddisablefile)) {
var %i = 1
var %llen = $lines($autoresumesenddisablefile)
while (%i <= %llen && $read($autoresumesenddisablefile,wnt,$nick)) {
//write -a $autoresumesenddisablefile $replace($read($autoresumesenddisablefile,wnt,$nick),$nick,$newnick)
//write -dw $+ $read($autoresumesenddisablefile,wnt,$nick) $autoresumesenddisablefile
dec %llen
inc %i
}
}
if ($exists($xdccsessionfailfile)) {
var %i = 1
var %llen = $lines($xdccsessionfailfile)
while (%i <= %llen && $read($xdccsessionfailfile,wnt,* $nick *)) {
//write -a $xdccsessionfailfile $replace($read($xdccsessionfailfile,wnt,* $nick *),$nick,$newnick)
//write -dw $+ $read($xdccsessionfailfile,wnt,* $nick *) $xdccsessionfailfile
dec %llen
inc %i
}
}
if ($exists($lastsessionfailfile)) {
var %i = 1
var %llen = $lines($lastsessionfailfile)
while (%i <= %llen && $read($lastsessionfailfile,wnt,* $nick *)) {
//write -a $lastsessionfailfile $replace($read($lastsessionfailfile,wnt,* $nick *),$nick,$newnick)
//write -dw $+ $read($lastsessionfailfile,wnt,* $nick *) $lastsessionfailfile
dec %llen
inc %i
}
}
if ($exists($totalfailfile)) {
var %i = 1
var %llen = $lines($totalfailfile)
while (%i <= %llen && $read($totalfailfile,wnt,* $nick *)) {
//write -a $totalfailfile $replace($read($totalfailfile,wnt,* $nick *),$nick,$newnick)
//write -dw $+ $read($totalfailfile,wnt,* $nick *) $totalfailfile
dec %llen
inc %i
}
}
if ($colorbotlist == on && $botliston == TRUE) { //cline -lc1 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
if ($colorbotlist == on && $botliston == TRUE) {
if ($get($newnick).status != active) { cline -lc7 @XDCC_Info $fline(@XDCC_Info,$newnick,1,1) }
else { cline -lc7 @XDCC_Info $fline(@XDCC_Info,$newnick,1,1) }
}
/outputxdccinfo
}
elseif ($triggerHash.exists($network,$newnick)) {
if (!$triggerHash.exists($network,$nick)) {
/outputxdccinfo Bot7 $newnick on3 $network appears to be an alternate ego of7 $nick (No support for this nickname transition yet).
//triggerHash.add $network $nick $replace($gettok($hget($triggerHash, $network $+ ¦ $+ $newnick),3-,32),$chr(32) $+ $newnick $+ $chr(32),$chr(32) $+ $nick $+ $chr(32))
//aline -lc7 @XDCC_Info $nick
}
else {
/outputxdccinfo Bot7 $newnick on3 $network appears to be an alternate ego of7 $nick . Profile for7 $nick exists, overwriting.
}
if ($exists($getpfffilenm($network,$newnick))) { .copy -o $getpfffilenm($network,$newnick) $getpfffilenm($network,$nick) }
if ($exists($getqfilenm($network,$newnick))) { .copy -o $getqfilenm($network,$newnick) $getqfilenm($network,$nick) }
if ($exists($getfpffilenm($network,$newnick))) { .copy -o $getfpffilenm($network,$newnick) $getfpffilenm($network,$nick) }
if ($exists($getoldfilenm($network,$newnick))) { .copy -o $getoldfilenm($network,$newnick) $getoldfilenm($network,$nick) }
if ($exists($specalternatebotsfile($network,$newnick))) { .copy -o $specalternatebotsfile($network,$newnick) $specalternatebotsfile($network,$nick) }
if ($exists($replace($specalternatebotsfile($network,$newnick),.aq,.aqt))) { .copy -o $replace($specalternatebotsfile($network,$newnick),.aq,.aqt) $replace($specalternatebotsfile($network,$nick),.aq,.aqt) }
; Copy entries in general files:
; -xdccinprogressfile,
if ($exists($xdccsinprogress) && !$read($xdccsinprogress,wnt,$nick *)) {
var %i = 1
var %llen = $lines($xdccsinprogress)
while (%i <= %llen && $read($xdccsinprogress,snt,$newnick,%i)) {
//write -a $xdccsinprogress $nick $read($xdccsinprogress,snt,$newnick,%i)
set %i $readn
inc %i
}
}
if ($colorbotlist == on && $botliston == TRUE) { //cline -lc1 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
if ($colorbotlist == on && $botliston == TRUE) {
if ($get($newnick).status != active) { cline -lc7 @XDCC_Info $fline(@XDCC_Info,$newnick,1,1) }
else { cline -lc7 @XDCC_Info $fline(@XDCC_Info,$newnick,1,1) }
}
/outputxdccinfo
}
}
#groupnickchangedetect end
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
;on 1:NICK:{
; if ($triggerHash.exists($network,$nick)) {
; /outputxdccinfo Bot7 $nick on3 $network changed nickname to7 $newnick $+ . Nickname change tracking OFF, not copying profile.
; /outputxdccinfo
; }
; elseif ($triggerHash.exists($network,$newnick)) {
; /outputxdccinfo Bot7 $newnick on3 $network appears to be an alternate ego of7 $nick (No support for this nickname transition yet).
; /outputxdccinfo
; }
;}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#grouppackchangedetect on
;-------------------------------------------------------------------------
; This deactivates a pack change detector timer when a bot goes offline,
; and resets the packfile. If $me is the one exiting the channel, it will
; stop all timers for that chan. If the bot quitting has an xdcc queue,
; it will notify the script owner.
;-------------------------------------------------------------------------
on *:QUIT:{
if ($triggerHash.exists($network, $nick) != $null) {
if ($colorbotlist == on && $triggerHash.exists($network, $nick) != $null && $get($nick).status != active && $botliston == TRUE) { //cline -lc1 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
if ($timer(packcapturetest $+ $nick) != $null) {
.timer $+ packcapturetest $+ $nick off
if ($exists($getoldfilenm($network, $nick))) {
.copy -o $getoldfilenm($network, $nick) $getpfffilenm($network, $nick)
}
}
if ($exists($getqfilenm($network, $nick))) {
/outputxdccinfo 14Bot with XDCC queue just went offline (3 $+ $network $+ 14¦7 $+ $nick $+ 14).
/outputxdccinfo
}
if ($exists($tempbotqueuefile) && $read($tempbotqueuefile,snt,$nick) && (!$exists($xdccsinprogress) || !$read($xdccsinprogress,snt,$gettok($read($tempbotqueuefile,wnt,$nick *),1,32)))) {
/write -i1 $xdccsinprogress $read($tempbotqueuefile,wnt,$nick *)
/write -ds $+ $nick $tempbotqueuefile
}
}
elseif ($nick == $me) {
/outputxdccinfo 14Quit: Stopping all pack capture tests for channel $chan $+ .
if ($colorbotlist == on && $botliston == TRUE) {
var %i = 1
var %llen = $triggerHash.items
while (%i <= %llen) {
if ($get($triggerHash.item.nick(%i)).status != active) { //cline -lc14 @XDCC_Info $fline(@XDCC_Info,$triggerHash.item.nick(%i),1,1) }
inc %i
}
}
var %i = 1
var %llen = $findfile($XDCCdir,*.pff.old,0,1)
while (%i <= %llen) {
var %botnick = $remove($gettok($nopath($findfile($XDCCdir,*.pff.old,%i,1)),2,166),.pff.old)
if ($timer(packcapturetest $+ %botnick) != $null) {
.timer $+ packcapturetest $+ %botnick off
.copy -o $findfile($XDCCdir,*.pff.old,%i,1) $getpfffilenm($network, %botnick)
}
inc %i
}
if ($exists($tempbotqueuefile) && $lines($tempbotqueuefile) > 0) {
var %i = 1
while (%i <= $lines($tempbotqueuefile)) {
if (!$exists($xdccsinprogress) || !$read($xdccsinprogress,snt,$gettok($read($tempbotqueuefile, %i),1,32))) { /write -i1 $xdccsinprogress $read($tempbotqueuefile, %i) }
inc %i
}
.remove $tempbotqueuefile
}
/triggerHash.free
/networksTable.free
/outputxdccinfo
/debuglog.sessionend
}
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:PART:#:{
if ($triggerHash.exists($network, $nick) != $null) {
if ($get($nick).status != active && $botliston == TRUE) { //cline -lc1 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
if ($timer(packcapturetest $+ $nick) != $null) {
.timer $+ packcapturetest $+ $nick off
if ($exists($getoldfilenm($network, $nick))) {
.copy -o $getoldfilenm($network, $nick) $getpfffilenm($network, $nick)
}
}
if ($exists($tempbotqueuefile) && $read($tempbotqueuefile,snt,$nick) && (!$exists($xdccsinprogress) || !$read($xdccsinprogress,snt,$gettok($read($tempbotqueuefile,wnt,$nick *),1,32)))) {
/write -i1 $xdccsinprogress $read($tempbotqueuefile,wnt,$nick *)
/write -ds $+ $nick $tempbotqueuefile
}
if ($exists($getqfilenm($network, $nick))) {
/outputxdccinfo 14Bot with XDCC queue just parted $chan (3 $+ $network $+ 14¦7 $+ $nick $+ 14).
/outputxdccinfo
}
}
elseif ($nick == $me) {
/outputxdccinfo 14Parted channel $chan $+ : Stopping all pack capture tests for channel $chan $+ .
if ($colorbotlist == on && $botliston == TRUE) {
var %i = 1
var %llen = $triggerHash.items
while (%i <= %llen) {
if ($chan isin $triggerHash.item.chans(%i) && $triggerHash.item.network(%i) == $network && $get($triggerHash.item.nick(%i)).status != active) {
//cline -lc10 @XDCC_Info $fline(@XDCC_Info,$triggerHash.item.nick(%i),1,1)
}
inc %i
}
}
var %i = 1
var %llen = $findfile($XDCCdir,$network $+ *.pff.old,0,1)
while (%i <= %llen) {
var %botnick = $remove($gettok($nopath($findfile($XDCCdir,$network $+ *.pff.old,%i,1)),2,166),.pff.old)
if ($timer(packcapturetest $+ %botnick) != $null) {
.timer $+ packcapturetest $+ %botnick off
.copy -o $findfile($XDCCdir,$network $+ *.pff.old,%i,1) $getpfffilenm($network, %botnick)
}
inc %i
}
if ($exists($tempbotqueuefile) && $lines($tempbotqueuefile) > 0) {
var %i = 1
while (%i <= $lines($tempbotqueuefile)) {
if ((!$exists($xdccsinprogress) || !$read($xdccsinprogress,snt,$gettok($read($tempbotqueuefile, %i),1,32))) && ($chan isin $triggerHash.getChans($network, $gettok($read($tempbotqueuefile, %i),1,32)))) {
/write -i1 $xdccsinprogress $read($tempbotqueuefile, %i)
/write -dl $+ %i $tempbotqueuefile
dec %i
}
inc %i
}
}
/outputxdccinfo
}
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:DISCONNECT:{
if ($nick == $me) {
/outputxdccinfo 14Disconnected from server $server $+ : Stopping all pack capture tests for network $network $+ .
if ($colorbotlist == on && $botliston == TRUE) {
var %i = 1
var %llen = $triggerHash.items
while (%i <= %llen) {
if ($triggerHash.item.network(%i) == $network && $get($triggerHash.item.nick(%i)).status != active) {
//cline -lc14 @XDCC_Info $fline(@XDCC_Info,$triggerHash.item.nick(%i),1,1)
}
inc %i
}
}
var %i = 1
var %llen = $findfile($XDCCdir,$network $+ *.pff.old,0,1)
while (%i <= %llen) {
var %botnick = $remove($gettok($nopath($findfile($XDCCdir,$network $+ *.pff.old,%i,1)),2,166),.pff.old)
if ($timer(packcapturetest $+ %botnick) != $null) {
.timer $+ packcapturetest $+ %botnick off
.copy -o $findfile($XDCCdir,$network $+ *.pff.old,%i,1) $getpfffilenm($network, %botnick)
}
inc %i
}
if ($exists($tempbotqueuefile) && $lines($tempbotqueuefile) > 0) {
var %i = 1
while (%i <= $lines($tempbotqueuefile)) {
if ((!$exists($xdccsinprogress) || !$read($xdccsinprogress,snt,$gettok($read($tempbotqueuefile, %i),1,32))) && ($triggerHash.network($nick) == $network)) {
/write -i1 $xdccsinprogress $read($tempbotqueuefile, %i)
/write -dl $+ %i $tempbotqueuefile
dec %i
}
inc %i
}
}
/outputxdccinfo
}
elseif ($colorbotlist == on && $triggerHash.exists($network, $nick) && $get($nick).status != active && $botliston == TRUE) { //cline -lc1 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#grouppackchangedetect end
on *:QUIT:{
if ($colorbotlist == on && $triggerHash.exists($network, $nick) != $null && $get($nick).status != active && $botliston == TRUE) { //cline -lc1 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
elseif ($nick == $me) {
if ($botliston == TRUE && $colorbotlist == on) {
var %i = 1
var %llen = $triggerHash.items
while (%i <= %llen) {
if ($get($triggerHash.item.nick(%i)).status != active) { //cline -lc14 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
inc %i
}
}
/triggerHash.free
/networksTable.free
/debuglog.sessionend
}
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:PART:{
if ($colorbotlist == on && $triggerHash.exists($network, $nick) != $null && $get($nick).status != active && $botliston == TRUE) { //cline -lc1 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
elseif ($nick == $me) {
if ($colorbotlist == on && $botliston == TRUE) {
var %i = 1
var %llen = $triggerHash.items
while (%i <= %llen) {
if ($chan isin $triggerHash.item.chans(%i) && $triggerHash.item.network(%i) == $network && $get($triggerHash.item.nick(%i)).status != active) { //cline -lc10 @XDCC_Info $fline(@XDCC_Info,$triggerHash.item.nick(%i),1,1) }
inc %i
}
}
}
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:DISCONNECT:{
if ($nick == $me) {
if ($colorbotlist == on && $botliston == TRUE) {
var %i = 1
var %llen = $triggerHash.items
while (%i <= %llen) {
if ($triggerHash.item.network(%i) == $network && $get($triggerHash.item.nick(%i)).status != active) { //cline -lc14 @XDCC_Info $fline(@XDCC_Info,$triggerHash.item.nick(%i),1,1) }
inc %i
}
}
}
elseif ($colorbotlist == on && $triggerHash.exists($network, $nick) != $null && $get($nick).status != active && $botliston == TRUE) { //cline -lc1 @XDCC_Info $fline(@XDCC_Info,$nick,1,1) }
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#groupautoresumestart on
;-------------------------------------------------------------------------
; If auto resume at start is on:
; If the answer to the query box is yes, this checks whether a network
; queue file exists for the currently connected network. If it does, it
; sets all triggers in that file on different random timers and starts
; them one by one.
;-------------------------------------------------------------------------
; If auto resume at start is off:
; This removes the network queue file for the appropriate network.
;-------------------------------------------------------------------------
on *:CONNECT:{
if (!$networksTable.exists($network)) {
/networksTable.add $network
/outputxdccinfo
}
if ($colorbotlist == on) {
var %f = 1
var %llen = $triggerHash.items
while (%f <= %llen) {
if ($triggerHash.item.network(%f) == $network && $get($triggerHash.item.nick(%i)).status != active && $botliston == TRUE) { //cline -lc10 @XDCC_Info $fline(@XDCC_Info,$triggerHash.item.nick(%f),1,1) }
inc %f
}
}
if ($exists($networkfile($network)) && $lines($networkfile($network)) > 0) {
var %i = 1
while (%i <= $lines($networkfile($network))) {
var %botnick = $gettok($read($networkfile($network), %i), 2, 32)
var %bt.rand = $calc($rand($minresumedelay, $maxresumedelay) + $startresumeoffset)
var %packnum = $remove($gettok($read($networkfile($network), %i), $numtok($read($networkfile($network), %i),32), 32),$chr(35))
if ($botqueuehandling == off || $shouldstartmaxbotq != $null) {
if ($xdccpreemptivejoin == on) { preemptiveJoin $network %botnick }
if ($checkFPF($network, %botnick, %packnum) == false && $get(%botnick).status != active) {
if ($exists($dccallownetworkfile) && $read($dccallownetworkfile,wnt,$network)) { /DCCALLOW + $+ %botnick }
if ($exists($alternatedccserverfile) && $read($alternatedccserverfile,snt,$network %botnick)) { $read($alternatedccserverfile,snt,$network %botnick) }
/outputxdccinfo Auto resume at start ON, requesting transfers for network3 $network in %bt.rand seconds ( $+ $read($networkfile($network), %i) || 14//timerxdccautoresume $+ $network $+ %botnick $+ %i $+ )
if ($gettok($read($networkfile($network), %i), 1, 32) == /msg) { //timerxdccautoresume $+ $network $+ %botnick $+ %i 1 %bt.rand /msg $gettok($read($networkfile($network), %i), 2-, 32) }
elseif ($gettok($read($networkfile($network), %i), 1, 32) == /ctcp) { //timerxdccautoresume $+ $network $+ %botnick $+ %i 1 %bt.rand /ctcp $gettok($read($networkfile($network), %i), 2-, 32) }
elseif ($gettok($read($networkfile($network), %i), 1, 32) == /notice) { //timerxdccautoresume $+ $network $+ %botnick $+ %i 1 %bt.rand /notice $gettok($read($networkfile($network), %i), 2-, 32) }
else { /outputxdccinfo 4ERROR: Unknown trigger type ( $+ $read($networkfile($network), %i) $+ ). }
}
elseif (($lines($getqfilenm($network,%botnick)) > 1) && $botqueuehandling == on) {
/outputxdccinfo Auto resume at start ON, requesting transfers for network3 $network in %bt.rand seconds ( $+ $read($networkfile($network), %i) || 14//timerxdccautoresume $+ $network $+ %botnick $+ %i $+ )
/write -a $getqfilenm($network,%botnick) $read($getqfilenm($network,%botnick),nt,1)
/write -dl1 $getqfilenm($network,%botnick)
/write -i1 $tempbotqueuefile %botnick $read($getqfilenm($network,%botnick),nt,1)
/write -dw $+ %botnick $+ ¦ $+ $network $autoresumedisablefile
/outputxdccinfo File is 9already transfering for3 $network $+ ¦7 $+ %botnick pack13 %packnum $+ . Moving to next pack in queue in %bt.rand seconds.
//timerxdccautoresume $+ $network $+ %botnick $+ %i 1 %bt.rand /startbotqueues 1
}
else {
if (!$read($xdccsinprogress,snt,%botnick)) { //write -a $xdccsinprogress %botnick %packnum }
/outputxdccinfo Pack is9 already transfering (3 $+ $network $+ ¦7 $+ %botnick $+ ,13 %packnum ,2 $read($getfpffilenm($network,$nick)) $+ ).
}
}
else {
/outputxdccinfo Auto resume at start ON, too many sends or requests in progress. Temp queueing packs for3 $network ( $+ $read($networkfile($network), %i) || 14//timerxdccautoresume $+ $network $+ %botnick $+ %i $+ )
var %trigger = $read($getqfilenm($network, %botnick),nt,1)
if (!$exists($tempbotqueuefile) || !$read($tempbotqueuefile,snt,%botnick)) { //write -a $tempbotqueuefile %botnick %trigger }
}
inc %i
}
}
else { /outputxdccinfo No requests for autoresume known for this network (3 $+ $network $+ ). }
if ($exists($joinchansfile($network)) && $lines($joinchansfile($network)) != 0) {
var %i = 0
while (%i < $lines($joinchansfile($network))) {
.timer 1 3 .join -n $read($joinchansfile($network),nt,%i)
inc %i
}
.remove $joinchansfile($network)
}
/outputxdccinfo
}
#groupautoresumestart end
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:CONNECT:{
if (!$networksTable.exists($network)) {
/networksTable.add $network
/outputxdccinfo
}
if ($colorbotlist == on) {
var %llen = $triggerHash.items
var %i = 1
while (%i <= %llen) {
if ($triggerHash.item.network(%i) == $network && $get($triggerHash.item.nick(%i)).status != active && $botliston == TRUE) { //cline -lc10 @XDCC_Info $fline(@XDCC_Info,$triggerHash.item.nick(%i),1,1) }
inc %i
}
}
/outputxdccinfo Not resuming aborted transfers (3 $+ $network $+ ).
if ($exists($networkfile($network))) {
.remove $networkfile($network)
}
if ($exists($joinchansfile($network)) && $lines($joinchansfile($network)) != 0) {
var %i = 0
while (%i < $lines($joinchansfile($network))) {
.timer 1 3 .join -n $read($joinchansfile($network),nt,%i)
inc %i
}
.remove $joinchansfile($network)
}
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
#groupautoresumeatstart on
;-------------------------------------------------------------------------
; If auto resume at start is on:
; Enables the resume at start connect listener and creates separate
; network queue files for each network found listed in the "currently
; downloading" file. Afterwards, it removes the general file. It also
; notifies the owner which networks have unfinished transfers. Finally,
; it removes a couple of session specific files.
;-------------------------------------------------------------------------
; If auto resume at start is off:
; Just removes a couple of session specific files.
;-------------------------------------------------------------------------
on *:START:{
/debuglog.sessionstart
/triggerHash.init
/networksTable.init
if ($exists($lastsessionfailfile)) { .remove $lastsessionfailfile }
if ($exists($xdccsessionfailfile)) {
.rename $xdccsessionfailfile $lastsessionfailfile
var %i = 1
while (%i <= $lines($lastsessionfailfile )) {
if ((UnfinishedGet * iswm $read($lastsessionfailfile,nt,%i)) || (UnfinishedSend * iswm $read($lastsessionfailfile,nt,%i))) {
//write -l $+ %i $lastsessionfailfile $replace($read($lastsessionfailfile,nt,%i),UnfinishedGet,GetFail,UnfinishedSend,SendFail)
//write -a $totalfailfile $replace($read($lastsessionfailfile,nt,%i),UnfinishedGet,GetFail,UnfinishedSend,SendFail)
}
inc %i
}
}
if ($exists($autoresumedisablefile)) {
.remove $autoresumedisablefile
}
if ($exists($autoresumesenddisablefile)) {
.remove $autoresumesenddisablefile
}
if ($exists($lastxdccsessiongetfile)) { .remove $lastxdccsessiongetfile }
if ($exists($xdccsessiongetfile)) { .rename $xdccsessiongetfile $lastxdccsessiongetfile }
if ($exists($lastxdccsessionsendfile)) { .remove $lastxdccsessionsendfile }
if ($exists($xdccsessionsendfile)) { .rename $xdccsessionsendfile $lastxdccsessionsendfile }
if ($exists($xdccqueueposfile)) {
.remove $xdccqueueposfile
}
if ($exists($statsfile(1))) {
.remove $xdccdir $+ \ $+ $statsfile(1)
}
if ($exists($statsfile(2))) {
.remove $xdccdir $+ \ $+ $statsfile(2)
}
if ($exists($tempbotqueuefile) && $lines($tempbotqueuefile) > 0) {
var %i = 1
var %llen = $lines($tempbotqueuefile)
while (%i <= %llen) {
if (!$exists($xdccsinprogress) || !$read($xdccsinprogress,snt,$gettok($read($tempbotqueuefile, %i),1,32))) { //write -i1 $xdccsinprogress $read($tempbotqueuefile, %i) }
inc %i
}
.remove $tempbotqueuefile
}
var %allnetworks = $null
if ($exists($xdccsinprogress) && $lines($xdccsinprogress) > 0) {
.enable #groupautoresumestart
var %i = 1
var %llen = $lines($xdccsinprogress)
while (%i <= %llen) {
var %botnick = $gettok($read($xdccsinprogress, %i), 1, 32)
var %botnetwork = $triggerHash.network(%botnick)
if (%botnetwork !isin %allnetworks) { set %allnetworks %allnetworks %botnetwork }
var %trigger = $triggerHash.getTrigger(%botnetwork, %botnick) $+ $read($xdccsinprogress , s, %botnick)
if (!$read($networkfile(%botnetwork), wn, * $+ %trigger $+ *) && %botnetwork != $null) {
/write -a $networkfile(%botnetwork) %trigger
}
if (!$read($networksendfile, wn, %botnetwork) && %botnetwork != $null) {
/write -a $networksendfile %botnetwork
}
inc %i
}
.remove $xdccsinprogress
}
var %i = 1
while ($findfile($xdccdir,*.apq,%i)) {
if ($lines($findfile($xdccdir,*.apq,%i)) > 0 && $remove($nopath($findfile($xdccdir,*.apq,%i)),.apq) !isin %allnetworks) { set %allnetworks %allnetworks $remove($nopath($findfile($xdccdir,*.apq,%i)),.apq) }
inc %i
}
if (%allnetworks != $null) { /outputxdccinfo You have potential transfers waiting on at least the following networks:3 %allnetworks $+ . }
else { /outputxdccinfo No aborted transfers waiting. }
if ($connectnetsatstart == on && $exists($autoconnectfile) && $lines($autoconnectfile) > 0) {
if ($read($autoconnectfile,nt,1) != $null) {
/server $read($autoconnectfile,nt,1)
/outputxdccinfo 14Connecting to network3 $read($autoconnectfile,nt,1) $+ 14.
}
var %i = 2
while (%i <= $lines($autoconnectfile)) {
if ($read($autoconnectfile,nt,%i) != $null) { /joinnetwork $read($autoconnectfile,nt,%i) }
inc %i
}
}
if ($connectxdccnetsatstart == on) {
var %i = 1
while (%i <= $numtok(%allnetworks,32)) {
if ($gettok(%allnetworks,%i,32) != $null) { /joinnetwork $gettok(%allnetworks,%i,32) }
inc %i
}
}
if ($autocleanatstart == on) {
/cleanxdcclib
}
if ($botqueuehandling == on && $testnumoftransferspeed == on) { /timexdcctransferstest }
/outputxdccinfo
}
#groupautoresumeatstart end
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------
on *:START:{
/debuglog.sessionstart
/triggerHash.init
/networksTable.init
if ($exists($lastsessionfailfile)) { .remove $lastsessionfailfile }
if ($exists($xdccsessionfailfile)) { .rename $xdccsessionfailfile $lastsessionfailfile }
if ($exists($autoresumedisablefile)) {
.remove $autoresumedisablefile
}
if ($exists($autoresumesenddisablefile)) {
.remove $autoresumesenddisablefile
}
if ($exists($lastxdccsessiongetfile)) { .remove $lastxdccsessiongetfile }
if ($exists($xdccsessiongetfile)) {
.rename $xdccsessiongetfile $lastxdccsessiongetfile
var %i = 1
while (%i <= $lines($lastsessionfailfile)) {
if ((UnfinishedGet * iswm $read($lastsessionfailfile,nt,%i)) || (UnfinishedSend * iswm $read($lastsessionfailfile,nt,%i))) {
//write -l $+ %i $lastsessionfailfile $replace($read($lastsessionfailfile,nt,%i),UnfinishedGet,GetFail,UnfinishedSend,SendFail)
//write -a $totalfailfile $replace($read($lastsessionfailfile,nt,%i),UnfinishedGet,GetFail,UnfinishedSend,SendFail)
}
inc %i
}
}
if ($exists($lastxdccsessionsendfile)) { .remove $lastxdccsessionsendfile }
if ($exists($xdccsessionsendfile)) { .rename $xdccsessionsendfile $lastxdccsessionsendfile }
if ($exists($xdccqueueposfile)) {
.remove $xdccqueueposfile
}
if ($exists($statsfile(1))) {
.remove $xdccdir $+ \ $+ $statsfile(1)
}
if ($exists($statsfile(2))) {
.remove $xdccdir $+ \ $+ $statsfile(2)
}
if ($exists($tempbotqueuefile) && $lines($tempbotqueuefile) > 0) {
var %i = 1
var %llen = $lines($tempbotqueuefile)
while (%i <= %llen) {
if (!$exists($xdccsinprogress) || !$read($xdccsinprogress,snt,$gettok($read($tempbotqueuefile, %i),1,32))) { /write -i1 $xdccsinprogress $read($tempbotqueuefile, %i) }
inc %i
}
.remove $tempbotqueuefile
}
if ($connectnetsatstart == on && $exists($autoconnectfile) && $lines($autoconnectfile) > 0) {
if ($read($autoconnectfile,nt,1) != $null) {
/server $read($autoconnectfile,nt,1)
/outputxdccinfo 14Connecting to network3 $read($autoconnectfile,nt,1) $+ 14.
}
var %i = 2
while (%i <= $lines($autoconnectfile)) {
if ($read($autoconnectfile,nt,%i) != $null) { /joinnetwork $read($autoconnectfile,nt,%i) }
inc %i
}
}
if ($connectxdccnetsatstart == on) {
/outputxdccinfo Auto XDCC network join is on, Auto Resume at Start is off, no additional networks to join.
}
if ($autocleanatstart == on) {
/cleanxdcclib
}
if ($botqueuehandling == on && $testnumoftransferspeed == on) { /timexdcctransferstest }
/outputxdccinfo 14Not resuming failed transfers: Auto Resume At Start OFF.
/outputxdccinfo
}
;-------------------------------------------------------------------------
;-------------------------------------------------------------------------