 |
nutsnbolts Apprentice
Joined: 01 May 2002 Posts: 188 Location: USA
|
Posted: 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. |
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: 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 |
|
|
 |
BlackSmith Apprentice

Joined: 08 Dec 2002 Posts: 152
|
Posted: 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. |
|
|
 |
|
|