;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; SILENCEEXEC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;info: ; ; by wiebe @ QuakeNet ; version 1.0 (written and tested on mIRC 6.14) ; ; ; last edit: Sat Mar 27 2004 ; ; ;What does this script do? ; ; gets the silence list for nick and sends this to an alias ; ; ;How to use this script? ; ; /silenceexec [params] ; ; possible results: ; ; 271 ; 271 is the raw numeric, you or the script can know what is being send ; is the nick as you specified when using this command ; is the mask that is on the silence list for the user ; ; 272 End of Silence List ; this marks the end of the silence list ; ; 401 No such nick ; this is send if the nick specified does not exist ; ; ; 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: ; ; //silenceexec $me echo -a ; ; gives: ; ; 271 wiebe wiebe a!b@c ; 272 wiebe wiebe End of Silence List ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS SILENCEEXEC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; /silenceexec [params] alias silenceexec { ; connected, $2 is there if ($status == connected) && ($2) { ; add to hash table hadd -m $+(silenceexec.,$cid) $silenceexec.lower($1) $1- ; request silence list .quote SILENCE $1 } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RAW 271 SILENCE LIST ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; raw 271 me nick mask raw 271:& & *:{ ; check hash table if ($hget($+(silenceexec.,$cid),$silenceexec.lower($2))) { ; set var var %t = $ifmatch ; send info to alias $gettok(%t,2-,32) 271 $gettok(%t,1,32) $3- ; stop raw haltdef } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RAW 272 SILENCE LIST END ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; raw 272 me nick :End of Silence List raw 272:& & End of Silence List*:{ ; check hash table if ($hget($+(silenceexec.,$cid),$silenceexec.lower($2))) { ; set var var %t = $ifmatch ; send info to alias $gettok(%t,2-,32) 272 $gettok(%t,1,32) End of Silence List ; remove from hash table hdel $+(silenceexec.,$cid) $silenceexec.lower($2) ; check hash table if ($hget($+(silenceexec.,$cid),0).item == 0) { ; free hash table hfree $+(silenceexec.,$cid) } ; stop raw haltdef } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RAW 401 NO SUCH NICK ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; raw 401 me nick :No such nick raw 401:& & No such nick*:{ ; check hash table if ($hget($+(silenceexec.,$cid),$silenceexec.lower($2))) { ; set var var %t = $ifmatch ; send info to alias $gettok(%t,2-,32) 401 $gettok(%t,1,32) No such nick ; remove from hash table hdel $+(silenceexec.,$cid) $silenceexec.lower($2) ; check hash table if ($hget($+(silenceexec.,$cid),0).item == 0) { ; free hash table hfree $+(silenceexec.,$cid) } ; stop raw haltdef } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS SILENCEEXEC.LOWER ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $silenceexec.lower(nick) alias -l silenceexec.lower { ; on IRC these chars are upper(lower) case of eachother: { = [, } = ], | = \, ~ = ^ ; so here we replace them to make sure we compare the right things right return $replace($1,$chr(123),$chr(91),$chr(125),$chr(93),$chr(124),$chr(92),$chr(126),$chr(94)) } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DISCONNECT EVENT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; on *:disconnect:{ ; free hash table hfree -w $+(silenceexec.,$cid) }