A group activates or deactivates a code. It might be just a part of it or the whole script. While the group is off, everything in it will be ignored and will not respond. Not even aliases.
#GroupName off
alias join { join -n $$1- }
on me:*:join:#: msg $chan Hi!
#GroupName endIn the case above, the group is
off. To turn iton, type
/enable #GroupName (command can be silented with a .). To turn it back off, use
/disable #GroupName. Right now, since it is off, both the alias /join and the ON Join event will not work. By turning them on, they will.
I use groups mostly when dealing with protection scripts. Swear Kick ON, Swear Kick OFF; Flood Kick ON, Flood Kick OFF, etc. By disabling a group you can be sure that it will not affect anything, despite what the code says.
alias swear {
if ($$1 == on) { .enable #SwearKick }
elseif ($$1 == off) { .disable #SwearKick }
}
#SwearKick on
on @+1:text:*[censored]*:#: kick # $nick bye!
#SwearKick endIn the swear kick example above you can see that I did not include the /swear alias in the group. Why? Because if I did, I would not be able to turn it back on again, since the thing would be OFF and, thus, would not respond. Popup menus, ON and OFF aliases and configuration aliases should *not* be included in the #Group, for then they would not work when the thing was off.
$group(N/#) (taken from the help file)Returns the the name or status of a #group in a script.
Properties: status, name, fname
$group(0) returns the number of groups
$group(1) returns the name of the first group
$group(1).status returns on or off for the first group
$group(#test) returns on or off for group #test
$group(#test).fname returns the script filename in which the group exists
$group(3).name returns the name of the 3rd groupThe
$group idenfitier can work as an indicator of that group's status. A line that I often use is:
$upper($group(#name))Here it checks whether the group is on or off and shows it (probably in a popup menu) with the upper form: ON and OFF.
I hope this can help you out a bit
Zyzzyx.