;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; GLINEEXEC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;info: ; ; by wiebe @ QuakeNet ; version 1.0 (written and tested on mIRC 6.14) ; ; works on ircu (UnderNet and QuakeNet), no idea about other IRC servers ; ; last edit: Sat Mar 27 2004 ; ; ;What does this script do? ; ; looks up gline info and returns this to an alias ; ; ;How to use this script? ; ; /glineexec [params] ; ; sends to the alias: ; 280 ; ; 280 is the raw numeric ; is the G-line mask you send ; is the G-line mask returned by the server ; is the time when the gline expires ; is the server on which the gline is set, a * for a global gline ; returns a + for active and a - for inactive ; is the reason for the gline ; ; 512 No such gline ; ; 512 is the raw numeric ; mask is the part that was asked for ; ; WARNING: DO NOT USE HALT IN AN ALIAS, USE RETURN! ; halt also halts the calling alias/event, return only stops the current alias ; and gives control back to the calling alias/event ; using halt in alias'es that are called from this script can cause it not to work 100% ; ; example at end of script ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS GLINEEXEC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; /glineexec [params..] alias glineexec { ; $2 is there, on irc, add to hash table, request gline info if ($2) && ($status == connected) { hadd -m $+(glineexec.,$cid) $+(*,$1,*) $2- quote gline $1 } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RAW 280 GLINE INFO ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; raw 280 me host time server active(+/-) :reason raw 280:*:{ ; check hash table if ($hfind($+(glineexec.,$cid),$2,0,Ww)) { ; loop, send info to alias, remove from hash table while ($hfind($+(glineexec.,$cid),$2,1,Ww)) { $hget($+(glineexec.,$cid),$hfind($+(glineexec.,$cid),$2,1,Ww)) $numeric $hfind($+(glineexec.,$cid),$2,1,Ww) $2- hdel $+(glineexec.,$cid) $hfind($+(glineexec.,$cid),$2,1,Ww) } ; add to hash table, stop raw hadd $+(glineexec.,$cid) $2 end haltdef } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RAW 512 NO SUCH GLINE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;raw 512 me host :No such gline raw 512:& & No such gline*:{ ; check hash table if ($hfind($+(glineexec.,$cid),$2,0,Ww)) { ; loop, send info to alias, remove from hash table while ($hfind($+(glineexec.,$cid),$2,1,Ww)) { $hget($+(glineexec.,$cid),$hfind($+(glineexec.,$cid),$2,1,Ww)) $numeric $2- hdel $+(glineexec.,$cid) $hfind($+(glineexec.,$cid),$2,1,Ww) ; check hash table, free hash table if ($hget($+(glineexec.,$cid),0).item == 0) { hfree $+(glineexec.,$cid) } } haltdef } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RAW 281 GLINE END ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; raw 281 me :End of G-line List raw 281:& End of G*line list*:{ ; check hash table, remove from hash table if ($hfind($+(glineexec.,$cid),end,1).data) { hdel $+(glineexec.,$cid) $hfind($+(glineexec.,$cid),end,1).data ; check hash table, free hash table if ($hget($+(glineexec.,$cid),0).item == 0) { hfree $+(glineexec.,$cid) } haltdef } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; EXAMPLE SCRIPT 1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; public !gline command on *:text:!gline *:#channel:{ glineexec $2 glinepub $chan } alias -l glinepub { if ($2 == 280) { msg $1 GLINE for $4 $+ , set until $asctime($5) (expires in $gettok($duration($calc($5 - $ctime)),1-2,32) $+ ), GLINE set on $6 ( $+ $iif($6 == *,global,local) $+ ), GLINE is $7 ( $+ $iif($7 == +,active,inactive) $+ ), reason: $8- } if ($2 == 512) { msg $1 GLINE none found for: $3 } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; EXAMPLE SCRIPT 2 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; /gline alias, shows the result in active window alias gline { glineexec $1- gline_echo } alias -l gline_echo { if ($1 == 280) { echo -a GLINE for $3 $+ , set until $asctime($4) (expires in $gettok($duration($calc($4 - $ctime)),1-2,32) $+ ), GLINE set on $5 ( $+ $iif($5 == *,global,local) $+ ), GLINE is $6 ( $+ $iif($6 == +,active,inactive) $+ ), reason: $7- } if ($1 == 512) { echo -a GLINE none found for: $2 } }