A script I'm working on performs /ison for one or more nicks.
The return from /ison is a space separated list.
The names I'm checking are stored in a comma separated list.
Currently I'm using the following code to check if one or more of the nicks returned from the /ison are in the comma separated list.
on *:snotice:ison*:{
if $replace($2-,$chr(32),*) iswm $hget(Invite,$+($network,.,%invite.channel,.Invites)) {
.msg $replace($2-,$chr(32),$chr(44)) $hget(Invite,$+($network,.,%invite.channel,.Decline))
haltdef
}
}
What I would like to do is to ensure that there's an exact match of the nick(s) returned from the /ison in the hash table
something like going through the list of nicks that are returned from the /ison and checking if the nick is in the hash table entry, as a $istok would do.
Just thought of this code as I was writing this post.
on *:snotice:ison*:{
tokenize 32 $2-
var %a = 1, %b = $0
while %a <= %b {
if $istok($hget(Invite,$+($network,.,%invite.channel,.Invites)),$($+($,%a),2),44) {
;send message
%a = %b
}
inc %a
}
}
While this looks like it would work, and I'll test it later, if someone has an alternative suggestion, or can see why this wouldn't work, I'd appreciate hearing.