;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PUSHJOIN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;info: ; ; by wiebe @ QuakeNet ; version 1.0 (written and tested on mIRC 6.14) ; ; last edit: Thu Mar 25 2004 ; ; ;What does this script do? ; ; puts channels in a queue and joins them slowly one by one ; ; ;How to use this script? ; ; /pushjoin [key] ; ; ;Why is this script good? ; ; using /join #chan1,#chan2,#chan3,#chan4,#chan5 may seem faster ; but for every channel you join, mIRC sends a /mode chan to get the modes ; and mIRC also does this when you get opped. ; so joining 5 channels where you get auto-opped, makes 5 commands on join and 5 commands on op ; making the server proces your commands slower (lag) ; besides that other scripts may sends commands on join/op aswell ; you can however specify multiple channels/keys with this script ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHJOIN.DELAY ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set here the delay (seconds) pushjoin should have the first time it is called alias -l pushjoin.delay { !return 1 } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHJOIN.RESTART ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set here the delay (seconds) pushjoin should have between multiple join lines ; this is used when pushjoin send a join change and there are items left in the queue, ; it will send a join again after N seconds alias -l pushjoin.restart { !return 8 } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHJOIN.DELAY ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; set this to 1 if you want pushjoin to join the channels minimized alias -l pushjoin.min { !return 1 } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHJOIN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; /pushjoin chan key alias pushjoin { ; check if it is a channel if ($left($1,1) isin $chantypes) { ; add to the queue pushjoin.queue $+(pushjoin.,$cid) $pushjoin.lower($1) $2- ; timer does not already run if (!$timer($+($cid,.pushjoin))) { ; start the timer .!timer $+ $cid $+ .pushjoin 1 $$pushjoin.delay pushjoin.dump } } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHJOIN.DUMP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; alias pushjoin.dump { ; save the next item in a var var %next = $pushjoin.queue($+(pushjoin.,$cid)).next while ($pushjoin.queue($+(pushjoin.,$cid)).size > 0) && ($me ison %next) { ; save the next item in a var var %next = $pushjoin.queue($+(pushjoin.,$cid)).next } if (%next != $null) { .!join $iif($pushjoin.min && $window(%next) != $active,-n) %next $chan($gettok(%next,1,32)).key } ; check if there are items in the queue if ($pushjoin.queue($+(pushjoin.,$cid)).size > 0) { ; start the timer .!timer $+ $cid $+ .pushjoin. $+ $hash($1,32) 1 $$pushjoin.restart pushjoin.dump $1 } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHJOIN.LOWER ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $pushjoin.lower(nick/chan) alias -l pushjoin.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)) } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS PUSHJOIN.QUEUE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $1 = table, $2- = chan [key] alias -l pushjoin.queue { ; there is a 2nd parameter and '$2 *' is not already in the queue if ($2 != $null) && ($hfind($1,$2,0,w).data == 0) && ($hfind($1,$2 *,0,w).data == 0) { ; increase item 'last' !hinc -m $1 last ; add join '$2-' to the hashtable with item name that 'last' has !hadd -m $1 $hget($1,last) $2- } elseif ($3 != $null) && ($hfind($1,$2,0,w).data == 1) { !hadd $1 $hfind($1,$2,1,w).data $2- } elseif ($3 != $null) && ($hfind($1,$2 *,0,w).data == 1) { !hadd $1 $hfind($1,$2,1,w).data $2- } ; called as identifier ($alias) and propertie is next ($alias().next) and hash table '$1' exists elseif ($isid) && ($prop == next) && ($hget($1)) { ; increase item 'first' !hinc -m $1 first ; 'first' is smaller or equal to 'last' if ($hget($1,first) <= $hget($1,last)) { ; store next item in var '%next' !var %next = $hget($1,$hget($1,first)) ; delete this item from the hashtable ;!hdel $1 $hget($1,first) ; this is the last item if ($hget($1,first) >= $hget($1,last)) { ; free the hash table !hfree $1 } ; return '%next' !return %next } } ; called as identifier ($alias) and propertie is size ($alias().size) elseif ($isid) && ($prop == size) { ; decrease number of items with 1, (1 item in queue, and last is there) !return $iif($calc($hget($1,0).item -1) >= 0,$ifmatch,0) } ; called as identifier ($alias) and propertie is clear ($alias().clear) elseif ($isid) && ($prop == clear) { ; free hashtables that match $1 !hfree -w $1 } } ; EXAMPLE ; ;on *:connect: { ; pushjoin #chan1 ; pushjoin #chan2 key ; pushjoin #chan3 ; pushjoin #chan4 key ; pushjoin #chan5,#chan6 ;}