So I am helping someone update their script and I wanted to check a few things since this falls to the internals really.
1) When you have a trigger like this:
^(Hi how are you|hello how are you|yo whats up)\.$
Does Mushclient basically do 3 seperate evaluations for this? So would it be faster to do like.. ^(\w+ how are you)\.$ and then a second trigger or is the above the fastest option?
2) Similar to one when a trigger uses options like (him|her) for instance...
Happily, (he|she) gives you a warm smile.
Is it faster to use that or \w+ instead?
3) If a trigger looks something like this.....
^You try to cleanse your aura (.*)\.$
Does that only evaluate once? So then you could put if "%1" == "but nothing happens" then
blah
elseif "%1" == "and you feel your body purged of disease" then
Wondering how efficient that option is, given it can match on alot of things but that is ok. Would that still mean 1 trigger that could match alot of related lines for the sake of processing?
4) Last one!
Right now I know some people use toggles based on a characters class... for instance whether you need to cast heal or sip healing. Right now that looks like...
if GetVariable("healer") == "cast healing" then
Send("cast healing")
else
Send("sip healing")
end
In an effort to get rid of comparisons (in some instances there can be 4 or more if's involved) would it be more efficient to change it to something like...
Execute(GetVariable("healer"))
On the theory that it would do a lookup and do it right now instead of making a checkup and then calling based on a tree?
Hopefully those all make sense, one of the Iron Realms Games has enormous systems and we are trying to shave time off the processing (1700 triggers right now looking to cut back).
1) When you have a trigger like this:
^(Hi how are you|hello how are you|yo whats up)\.$
Does Mushclient basically do 3 seperate evaluations for this? So would it be faster to do like.. ^(\w+ how are you)\.$ and then a second trigger or is the above the fastest option?
2) Similar to one when a trigger uses options like (him|her) for instance...
Happily, (he|she) gives you a warm smile.
Is it faster to use that or \w+ instead?
3) If a trigger looks something like this.....
^You try to cleanse your aura (.*)\.$
Does that only evaluate once? So then you could put if "%1" == "but nothing happens" then
blah
elseif "%1" == "and you feel your body purged of disease" then
Wondering how efficient that option is, given it can match on alot of things but that is ok. Would that still mean 1 trigger that could match alot of related lines for the sake of processing?
4) Last one!
Right now I know some people use toggles based on a characters class... for instance whether you need to cast heal or sip healing. Right now that looks like...
if GetVariable("healer") == "cast healing" then
Send("cast healing")
else
Send("sip healing")
end
In an effort to get rid of comparisons (in some instances there can be 4 or more if's involved) would it be more efficient to change it to something like...
Execute(GetVariable("healer"))
On the theory that it would do a lookup and do it right now instead of making a checkup and then calling based on a tree?
Hopefully those all make sense, one of the Iron Realms Games has enormous systems and we are trying to shave time off the processing (1700 triggers right now looking to cut back).