; ; leech.mrc ; ; This script is not perfect or works 100% of the time, but it's VERY efficient and easy so that weighs up for the lack in other places. ; ; To begin, load the script "/load -rs leech.mrc" and type /leechconf to configure it and then /leech to run it. ; ; IMPORTANT, READ THIS! ; ; Any message to a channel from anyone that matches what you have entered into the Ad list is considered an Ad, everything else is IGNORED. ; What you enter here must be in the form of a wildcard (like *ad* or *ad*s*), nothing else works. ; ; Next, the Display list chooses what you want to see displayed in the Leech window. If you're looking for something special add a wildcard ; for *XXX* or perhaps *playboy* to only see Ads that matches those lines. ; ; Finally, the script will try to download automatically any matching Ads found in the download list. Also wildcard, simple? :) ; ; The last four options are simple, and the fifth one should probably be left alone unless you KNOW WHAT YOU ARE DOING. It's the command by ; which the script tries to download Ads. If you change this it can no longer download if you change it to something wrong. Be careful. ; ; Ok now my hands hurt from typing, just use the script and be happy. ; ; Btw, to quickly download a displayed ad just doubleclick on the '/scid' part of the download string...voila! :) ; ; ; -- ; Faile ; alias leech { if ($group(#leech).status == on) { .disable #leech echo -a [ Leech ] Leech has been disabled. } else { .enable #leech echo -a [ Leech ] Leech has been enabled. Use '/leechconf' to configure it. } } alias leechconf { dialog -m leech leech } dialog leech { title "Leech" size -1 -1 241 150 option dbu button "Done", 100, 3 135 37 12, ok check "Put messages in @Messages", 101, 6 80 80 10 check "Put notices in @Notices", 102, 6 89 67 10 check "Dont show displayed ads again in ", 103, 6 98 90 10 edit "", 104, 96 98 22 9 text "seconds", 105, 120 99 21 8 check "Log all ads to Leech.log", 106, 6 107 67 10 text "Download command:", 107, 6 118 51 8 edit "", 108, 57 117 180 9, autohs text "version 0.01", 199, 203 140 37 8, center box "Ad", 200, 4 2 75 75 box "Display", 300, 83 2 75 75 box "Download", 400, 162 2 75 75 list 201, 7 9 69 50, size button "Add", 202, 7 62 30 12 button "Remove", 203, 46 62 30 12 list 301, 86 9 69 50, size button "Add", 302, 86 62 30 12 button "Remove", 303, 125 62 30 12 list 401, 165 9 69 50, size button "Add", 402, 165 62 30 12 button "Remove", 403, 204 62 30 12 } on *:dialog:leech:init:*:{ if (%leech_messages == 1) { did -c $dname 101 } if (%leech_notices == 1) { did -c $dname 102 } did -b $dname 103 did -b $dname 104 did -b $dname 105 if (%leech_log == 1) { did -c $dname 106 } did -ar $dname 108 %leech_downloadcommand var %i = 1 while (%i <= $numtok(%leech_ad,32)) { did -a $dname 201 $gettok(%leech_ad,%i,32) | inc %i } set %i 1 while (%i <= $numtok(%leech_display,32)) { did -a $dname 301 $gettok(%leech_display,%i,32) | inc %i } set %i 1 while (%i <= $numtok(%leech_download,32)) { did -a $dname 401 $gettok(%leech_download,%i,32) | inc %i } } on *:dialog:leech:sclick:101:{ if ($did(101).state == 0) { set %leech_messages 0 } else { set %leech_messages 1 } } on *:dialog:leech:sclick:102:{ if ($did(102).state == 0) { set %leech_notices 0 } else { set %leech_notices 1 } } on *:dialog:leech:sclick:106:{ if ($did(106).state == 0) { set %leech_log 0 } else { set %leech_log 1 } } on *:dialog:stfu:edit:108:{ if ($did(108).text != $null) { set %leech_downloadcommand $did(108).text } } on *:dialog:leech:sclick:202:{ var %i $$?="Ad?" did -a $dname 201 %i set %leech_ad $addtok(%leech_ad,%i,32) } on *:dialog:leech:sclick:203:{ set %leech_ad $remtok(%leech_ad,$did(201).seltext,32) did -d $dname 201 $did(201).sel } on *:dialog:leech:sclick:302:{ var %i $$?="Display?" did -a $dname 301 %i set %leech_display $addtok(%leech_display,%i,32) } on *:dialog:leech:sclick:303:{ set %leech_display $remtok(%leech_display,$did(301).seltext,32) did -d $dname 301 $did(301).sel } on *:dialog:stfu:sclick:303:{ did -d $dname 102 $did(201).sel set %leech_ad $deltok(%leech_ad,$did(201).seltext,32) } on *:dialog:leech:sclick:402:{ var %i $$?="Download?" did -a $dname 401 %i set %leech_download $addtok(%leech_download,%i,32) } on *:dialog:leech:sclick:403:{ set %leech_download $remtok(%leech_download,$did(401).seltext,32) did -d $dname 401 $did(401).sel } menu @leech { Leech .Enable/Disable:leech .- ..Configure:leechconf .- ..Leech.log:run notepad.exe leech.log } #leech on on ^*:hotlink:/scid:@leech:{} on *:hotlink:/scid:@leech:{ $strip($gettok($hotline,2-,47)) } on ^*:notice:*:?:{ if (%leech_notices == 1) { haltdef if (!$window(@notices)) { window -ek[0]nz @Notices } echo -mt @notices < $+ $nick $+ > $1- } } on ^*:open:?:{ if (%leech_messages == 1) { haltdef if (!$window(@messages)) { window -ek[0]nz @Messages } echo -mt @messages < $+ $nick $+ > $1- } } on *:text:*:#:{ var %i = 1 while (%i <= $numtok(%leech_ad,32)) { if ($gettok(%leech_ad,%i,32) iswm $1-) { var %j = 1, %k = 1 if (%leech_log == 1) { write Leech.log [[ $date / $time / $network / $chan / $nick ] $1- } while (%j <= $numtok(%leech_display,32)) { if ($gettok(%leech_display,%j,32) iswm $1-) { if (!$window(@leech)) { window -ek[0]nz @Leech } echo -mt @leech * echo -t @leech * File: echo -t @leech * 12 $1- echo -t @leech * echo -t @leech * Download: echo -t @leech * 4 /SCID $CID [ [ %leech_downloadcommand ] ] echo -t @leech * set %j $numtok(%leech_display,32) } inc %j } if ((%leech_flood == $null) || (%leech_flood < 60)) { while (%k <= $numtok(%leech_download,32)) { if ($gettok(%leech_download,%k,32) iswm $1-) { if (!$window(@leech)) { window -ek[0]nz @Leech } scid $cid [ [ %leech_downloadcommand ] ] echo -t @leech * 3Download: $4- matches $gettok(%leech_download,%j,32) -- sent download command. echo -t @leech * inc -z %LeechDownloadFlood 12 set %k $numtok(%leech_download,32) } inc %k } } set %i $numtok(%leech_ad,32) } inc %i } } #leech end on *:load:{ echo -a Loaded $script $+ . echo -a Type /leechconf to configure, echo -a then type /leech to enable it. echo -a To unload type "/unload -rs $script $+ ". set %leech_ad *#*[*]* set %leech_display * set %leech_download nothing set %leech_messages 1 set %leech_notices 1 set %leech_log 0 set %leech_downloadcommand /MSG $!NICK XDCC SEND $!REMOVE($1,$CHR(40),$CHR(41),$CHR(91),$CHR(93)) } on *:unload:{ echo -a Unloaded $script $+ . echo -a * Removing any temporary variables used... unset %leech_* echo -a * ...done! }