Group Names
 
with special thanks to TWWOTN
 

Groups, a great thing about MSN is that it allows you to make an on/off switch for certain commands
one of their best features I would say.

here is the syntax

#GroupName [on/off]
[CODE]
#GroupName end

e.g

#Voice_On_Join on
on *:JOIN:*: {
/mode # +v $nick
}
#Voice_On_Join end

now I declared that to be [on] so it will work,
whenever a user comes into my room my script will unspec them, however if I would of written

#Voice_On_Join off
on *:JOIN:*: {
/mode # +v $nick
}
#Voice_On_Join end

Its Default state would be "off", so users will not be unspecced.
Now yes, there is a way to toggle the on/off switches, like this

/enable #GroupName
/disable #GroupName

now if I done /enable #Voice_On_Join it will change the current "off" into an "on"
So the enabling and disabling is all about changing the [on/off] command in the code.

so if you want a command to be able to to be enabled and disabled by a switch (In A Popup) you can use a group.

I hope this seems fairly easy to you, instead of putting the code in a file and constantly having to load and unload which is a lot messier than grouping commands.

Now with the switches i suggest you use Popups, something like this

Groups
.Voice On Join
..Enable Voice On Join:/enable #Voice_On_Join
..Disable Voice On Join:/disable #Voice_On_Join
.De Owner Protection
..Enable...


You get the picture.

Now here is another cool and nifty trick you can use...
( $+ $group(#GroupName) $+ )
This returns [on/off] depending on whether the group has been disabled or enabled, now say our
Voice_On_Join was currently on, and I had this for a popup

Groups.
.Voice On Join ( $+ $group(#Voice_On_Join) $+ )
..Enable:/enable #Voice_On_Join
..Disable:/disable #Voice_On_Join

If it was on, and in say.... Menubar popups, and I clicked the menubar I would see this :

[Groups]
[Voice On Join (on)] >

( > ) being the arrow that allows you to see the Enable / Disable switch, so say I then disabled it,, it would write the file the group is in, and change the "on" to "off" and say we went back to our Menu Bar popup.

I would see

[Groups]
[Voice On Join (off)] >


And you get the picture.
Here are a few other commands you can use with the group....
Try adding this to the Popup,

.Voice On Join ( $+ $group(#voj) $+ )
..What File Is It In:/echo -a 9Found In 4[ 15 $+ $group(#voj).fname $+ 4]
..Enable Voice On Join:/enable #voj
..Disable Voice On Join:/disable #voj

and this to remote

#voj off
on *:JOIN:*: { mode # +v $nick }
#voj end

that is what I use...... now if you go to popups and click "What file is it in?"
That looks for the file and returns the file name, I get this when I click it

Found In [D:\RESTORED\A\IRC\XCHATTING\Groups.txt]

With of course the cool fancy colors :)

I hope you learned how to use groups now, there are a lot of other options you can use such as..

$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 group

Try them out and give them a whirl, you just learned a great new way to enhance your script!
 

 

Hosted by www.Geocities.ws

1