alias gethost { .userhost $ | .enable #uh }
#uh off
raw 302:*:{
set %uh $gettok($2,2,64)
.disable #uh
}
#uh end
That code should work on all servers, there is a simpler way which you just need to use $address or $mask, but some servers won't let you do that, so yeah, that one should be good.
Userhost can have more than one nick (up to 5 nicks) in one line, so you need to loop.
Code:
raw 302:*: {
var %i = 1
while $gettok($2-,%i,32) {
var %a = $replace($ifmatch,=+,!,=-,!,*=+,!,*=-,!)
set %address $+ $gettok(%a,1,33) %a
echo -s Do something with the address:-> %a
inc %i
}
halt
}
Edit: Changed $remove($replace($ifmatch,=,!),+,-,*) to $replace($ifmatch,=+,!,=-,!,*=+,!,*=-,!) Thanks for pointingt that out Online