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
nutsnbolts
Apprentice


Joined: 01 May 2002
Posts: 188
Location: USA

PostPosted: Sun Mar 05, 2006 9:51 pm   

Efficient Triggers and scripting?
 
Quick question...

I have a trigger let's say, that would put something into a variable.

Code:
#trigger {An image is casted on you.} {#var imageflag %1}


I would use this for a purpose for something like scripting...

Let's say at another given point in time, I decided, ooooh, I can actually substitute this line for easy readible purpose.

So I create a CLASS (for organizational purposes) named, substitutes and create the following trigger.

Code:
#trigger {An image is casted on you.} {#substitute %ansi(bold,yellow) --- IMAGE IS CASTED ON YOURSELF ---}


Obviously, in time, I would have multiple triggers for the same text but in different locations and for different purposes.

Are there any difference in efficiency, speedwise, error wise, if I just did something like this instead.

Code:
#trigger {An image is casted on you.} {#substitute %ansi(bold,yellow) --- IMAGE IS CASTED ON YOURSELF ---};#var imageflag %1


I'm looking to organize my triggers more but was wondering if one way is better than the other or it doesn't really matter.

Thanks!
_________________
Thank you for everything, it's always appreciated.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5187

PostPosted: Sun Mar 05, 2006 10:39 pm   
 
The single trigger will be faster for a number of reasons. In fact they are too many to name, and thier effect are small yet very cumulative. Error wise you might also have problems with the 2 seperate triggers if you ever shared the script, or had to export and reimport, as the order of the trigger could become different causing the variable storage to never happen.
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
BlackSmith
Apprentice


Joined: 08 Dec 2002
Posts: 152

PostPosted: Fri Mar 24, 2006 7:56 pm   Re: Efficient Triggers and scripting?
 
Code:
#trigger {An image is casted on you.} {
 #var imageflag %1
 #If (@Substitute_boolean) {
  #substitute %ansi(bold,yellow) --- IMAGE IS CASTED ON YOURSELF ---
 }
}

Now you add a nice variable named Substitute_boolean some where there and make even a toggle button for it if you turn it on/off a lot.
when you want to see additional text, you keep it true, if you dont you keep it false.
_________________
BatMUD Best MMORPG around since 1990 telnet://bat.org:23
~ Magic & Mind beats Chrome & Meat anytime ~
Pattern(s) in PERL. Using Cmud 1.34/2.09 & BatClient.
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