mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
Well,
i was wondering about #groups i couldnt really understand what
they did from the help file.
so can someone please explain how to use them.

because i usually set vars for things being on and off
so i think it would be very helpful

thanks alot
smile

Joined: Nov 2003
Posts: 2,327
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Put the following in remote:

Code:
#somegroup on
alias test { echo -a 1 }
#somegroup end


Then type /test

Now type /disable somegroup

Then type /test again.

You will see that after you type /disable somegroup, you can no longer use the alias within the group, the same will happen with events, menu's, etc.


New username: hixxy
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
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 end


In 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 end


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


The $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 smile
Zyzzyx.


"All we are saying is give peace a chance" -- John Lennon
Joined: Jun 2004
Posts: 291
W
Fjord artisan
OP Offline
Fjord artisan
W
Joined: Jun 2004
Posts: 291
awesome,

thankyou both much
really great help
works cool aswell

thanks again



Link Copied to Clipboard