Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
kymon
Novice


Joined: 29 Jan 2003
Posts: 40

PostPosted: 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?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: Wed Jan 29, 2003 8:01 pm   
 
#IF (%trigger(className)) {do something}

Kjata
Reply with quote
kymon
Novice


Joined: 29 Jan 2003
Posts: 40

PostPosted: 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!!!
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: 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
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net