 |
kymon Novice
Joined: 29 Jan 2003 Posts: 40
|
Posted: Wed Jan 29, 2003 7:14 pm
check if class is enabled? |
is there a way to check by trigger if a particular class is enabled? i know there is the #class command who displays all classes and their state, but it's a bit overkill to parse that output just to get a single variable. what i would like to have is something like: "#if (class test is enabled){ do something}". is there an easy way to do so?
|
|
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Wed Jan 29, 2003 8:01 pm |
#IF (%trigger(className)) {do something}
Kjata |
|
|
|
 |
kymon Novice
Joined: 29 Jan 2003 Posts: 40
|
Posted: Wed Jan 29, 2003 8:24 pm |
i have no idea why it works, as zmud help only says : "%trigger - the line that caused the last trigger", but it DOES work!
thanks Kjata!!! |
|
|
|
 |
Kjata GURU

Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Wed Jan 29, 2003 9:26 pm |
That's the pre-defined variable %trigger, not the function. The function %trigger returns true if the class you pass as an argument is enabled and false otherwise.
Kjata |
|
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Wed Jan 29, 2003 11:03 pm |
Actually it got updated a few betas ago. It returns 1 if enabled, 0 if not enabled, and -1 if non-existent.
|
|
|
|
 |
|
|
|