/*_____________________________________________________________________________ |/ / Perform add-on by David "Saturn" van Moolenbroek | Version 0.1-alpha, released 30-09-2003 -- support on #help.script/Quakenet | Use/modify however you want, but please keep my name in it. Thank you! | | Keywords: perform, groups, single-server | | This is a very simple perform script. It works, but it does not support | mIRC's own built-in perform system, nor multiple server connections. Its | purpose is to be used in scripts that require manipulation and possibly | retrieval of the list of auto-joined channels. The script does support | channel keys. | | The script defines the following commands/identifiers: | | /perform [on|off] | | This will turn both mIRC's perform section, and this script, on or off. | By default, this script is on, regardless of mIRC's perform section - | there is no way to tell the status of the latter from within a script. | | /perform [add|del] [] | | This will add or delete the specified channel from the list of channels | that this script will make mIRC join when it connects to a server. The | channel key is optional - if the channel to add already exists, the key | will be replaced. As indicated above, you can not delete or replace | channels or keys for channels that were not added with this command. | | /perform list | | This will display the channels that this script has on auto-join, in | the current window. | | $perform | | This identifier returns "on" or "off", indicating whether this script | is enabled or not. | | $perform(#chan/N) | | Properties: key | | This identifier returns information about perform entries. It returns | the name of the given channel if it is in the perform list, or the name | of the Nth channel in the perform list, unless N is zero, in which case | it returns the number of queues. If the "key" property is specified, | the identifier will return the stored key instead. | | Simple examples | | on friend:TEXT:!perform *:#:{ .perform add $2- | join $2- } | on friend:TEXT:!unperform *:#:{ .perform del $2 | part $2- } | | ; this trigger will auto-update the key of existing perform entries | on *:MODE:#:if ($perform($chan)) .perform add $chan $chan($chan).key \ _\_____________________________________________________________________________ */ #perform on on *:CONNECT:if (%perform.chans) join %perform.chans $remove(%perform.keys,$nullkey) #perform end alias -l nullkey return - - alias perform { if ($isid) { ; $perform if (!$0) return $group(#perform).status ; $perform(0) if (!$1) return $numtok(%perform.chans,44) ; $perform(N) [.key] if ($1 isnum) { if ($prop == key) return $iif($gettok(%perform.keys,$1,44) != $nullkey,$ifmatch) return $gettok(%perform.chans,$1,44) } ; $perform(#chan) [.key] if ($findtok(%perform.chans,$1,44)) { var %i = $ifmatch if ($prop == key) return $iif($gettok(%perform.keys,%i,44) != $nullkey,$ifmatch) else return $gettok(%perform.chans,%i,44) } return $null } ; /perform [on|off] if ((!$0) || ($1 == on) || ($1 == off)) { if ($1 == on) .enable #perform elseif ($1 == off) .disable #perform perform $1- } ; /perform add [key] elseif ($1 == add) { if ($0 < 2) { echo $color(info) -aeq * /perform: insufficient parameters return } if (($left($2,1) !isin $chantypes) || ($chr(44) isin $2)) { echo $color(info) -aeq * /perform: invalid parameters return } if (!$istok(%perform.chans,$2,44)) { set %perform.chans $addtok(%perform.chans,$2,44) set %perform.keys $instok(%perform.keys,$iif($3 != $null,$3,$nullkey),0,44) echo $color(info2) -aeq * Added ' $+ $2 $+ ' to perform list } else { if ($0 >= 3) set %perform.keys $puttok(%perform.keys,$3,$findtok(%perform.chans,$2,44),44) echo $color(info2) -aeq * Updated ' $+ $2 $+ ' in perform list } } ; /perform del elseif ($1 == del) { if ($0 < 2) { echo $color(info) -aeq * /perform: insufficient parameters return } if ($findtok(%perform.chans,$2,44)) { set %perform.chans $deltok(%perform.chans,$ifmatch,44) set %perform.keys $deltok(%perform.keys,$ifmatch,44) echo $color(info2) -aeq * Deleted ' $+ $2 $+ ' from perform list } else echo $color(info) -aeq * /perform: no such channel ' $+ $2 $+ ' } ; /perform list elseif ($1 == list) { if (!%perform.chans) { echo $color(info) -aeq * No performed channels return } echo -aeq - var %i = 1 while (%i <= $numtok(%perform.chans,44)) { echo $color(info) -aq * $gettok(%perform.chans,%i,44) $& $iif($gettok(%perform.keys,%i,44) != $nullkey,(key: $ifmatch $+ ) ) inc %i } echo -aeq - } }