/*_____________________________________________________________________________ |/ / Isupport add-on by David "Saturn" van Moolenbroek | Version 0.1, released 31-10-2003 -- support on #help.script/Quakenet | Use/modify however you want, but please keep my name in it. Thank you! | | Keywords: isupport, raw 005, hashtables, multi-server | | This script allows you to easily retrieve the isupport tokens from the | nowadays globally supported server numeric 005. The script saves the | isupport tokens on connect, and allows you to retrieve them with the | $isupport identifier. The tokens are saved in hashtables, one for each | server connection you have running. | | The script defines the following commands/identifiers: | | $isupport(token/N) | | Properties: data | | This identifier returns the isupport tokens the server sent to you when | you just connected. If a token name is specified, its associated data | will be returned, or "$true" if the token did not have any data. If a | number N is specified, it will return the Nth support token name, or | the data of this token if the "data" property is used; unless N is zero, | in which case it returns the number of support entries. | | Simple example | | ; request access to a channel (knock) if you couldn't join | raw *:*Cannot join*:if ($numeric != 474) && ($isupport(KNOCK)) knock $2 \ _\_____________________________________________________________________________ */ alias isupport { if (!$isid) { raw -q ISUPPORT $1- return } if ((!$0) || ($1 == 0)) return $hget($table,0).item if ($1 isnum) { if ($prop == data) return $hget($table,$1).data else return $hget($table,$1).item } return $hget($table,$1) } alias -l table return isupport. $+ $cid alias -l element { if ($regex($1-,/^(.+?)=(.+)$/)) hadd -m $table $regml(1) $regml(2) else hadd -m $table $1 $true } on *:LOGON:*:hfree -w $table on *:DISCONNECT:hfree -w $table raw 005:*:{ if ($regex($gettok($rawmsg,4-,32),(.*) :)) { tokenize 32 $regml(1) element $* } }