;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; HOSTCHANGE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;info: ; ; by wiebe @ QuakeNet ; version 1.0 (written and tested on mIRC 6.12) ; ; last edit Mon Jan 19 2004 ; ; ;What does this script do? ; ; host changes are shown in 1 line, instead of a quit, a join and possible mode change(s) ; ; here is what you see normally: ; [16:22:48] * Quits: @wiebe (wiebe@1234567890.abc.isp.com) (registered) ; [16:22:48] * Joins: wiebe (wiebe@Wiebe.users.quakenet.org) ; [16:22:48] * port80a.se.quakenet.org sets mode: +vo wiebe wiebe ; ; here is what this script makes of that: ; [16:26:26] * Hostchange: @wiebe (wiebe@1234567890.abc.isp.com) -> (wiebe@Wiebe.users.quakenet.org) ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS HOSTCHANGE.REASON ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; alias -l hostchange.reason { ; set here the quit reason people (can) have when they change host, ; seperate them with , return registered,host change,virtual host } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; QUIT EVENT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; on ^*:quit: { ; check if the quit reason is in '$hostchange.reason' alias if ($istok($hostchange.reason,$1-,44)) { ; add item '$nick' with value '$address' (user@host) to a '$cid' specifc hash table ; for 1 second, these events happen really all at once hadd -mu1 $+(hostchange.,$cid) $nick $address ; stop mIRC from showing the quit haltdef } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; JOIN EVENT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; on !^*:join:#: { ; check if '$nick' is an item in the hash table ; and compare this value to the new '$address' (user@host) if ($hget($+(hostchange.,$cid),$nick)) && ($hget($+(hostchange.,$cid),$nick) != $address) { ; use a timer to start the 'hostchange.join' alias ; delay with 0 seconds, because these events happen all at once .timer 1 0 hostchange.join $nick $chan $hget($+(hostchange.,$cid),$nick) $address ; stop mIRC from showing the join haltdef } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; RAWMODE EVENT ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; on ^*:rawmode:#: { ; check that '$nick' is not on the channel ; and there is a '.' in '$nick' if ($nick !ison $chan) && (. isin $nick) { ; the length of '$1' is equal to '$0' ; why? ; irc.server.com sets mode: +ovh nick nick nick ; $nick $1 $2 $3 $4 ; means that '$0' is here 4, and 3 modes plus the '+' sign makes 4 for the length of '$1' ; how many times '$2' occurs in '$2-' is equal to '$0' minus 1 ; in the example above, '$2' is nick, which occurs 3 times in '$2-' ; this is to check that only modes are changed by the server for the same user ; final check is, '$2' is in the hash table if ($len($1) == $0) && ($count($2-,$2) == $calc($0 -1)) && ($hget($+(hostchange.,$cid),$2)) { ; stop mIRC from showing the mode change haltdef } } } ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ALIAS HOSTCHANGE.JOIN ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; $1 = nick, $2 = #channel, $3 = old user@host, $4 = new user@host alias -l hostchange.join { ; you can change here how things look ; like remove the old (user@host) for example ; we read here, if mode prefixes are shown or not ; alt+o > IRC > Show mode prefix if ($gettok($readini($mircini,options,n2),30,44) == 1) { ; echo the hostchange echo $color(join) -t $2 * Hostchange: $left($remove($nick($2,$1).pnick,$1),1) $+ $1 ( $+ $3 $+ ) -> ( $+ $4 $+ ) } ; do not show a mode prefix else { ; echo the hostchange echo $color(join) -t $2 * Hostchange: $1 ( $+ $3 $+ ) -> ( $+ $4 $+ ) } }