Mush Triggers

by Unknown

Back to Mechanic's Corner.

Unknown2010-03-16 12:26:57
Hi umm is there a way, a command, syntax or whatever to disable triggers in Mush client without opening a window?
Unknown2010-03-16 15:10:08
Thanks you're awesome!
Unknown2010-04-04 04:08:20
Hey, I'm using mushclient, and for some reason I can't figure out probably one of the most simple things ever. See, I need to have something which can represents ANYBODY'S name.

Like if I had a vine spell cast on me? I'd want whatever it to be

___ points a golden sickle at you and vines shoot forth, entangling you.

I'm not sure what that symbol would be that represents any random name. I have alot of recorded afflictions and such like this, that could easily be used if only I could figure out this one thing. I don't care if you think I'm stupid for asking something that seems simple, but this would save my life... in the game at least anyways.
Unknown2010-04-04 04:10:22
QUOTE (TheSponge @ Apr 4 2010, 04:08 AM) <{POST_SNAPBACK}>
Hey, I'm using mushclient, and for some reason I can't figure out probably one of the most simple things ever. See, I need to have something which can represents ANYBODY'S name.

Like if I had a vine spell cast on me? I'd want whatever it to be

___ points a golden sickle at you and vines shoot forth, entangling you.

I'm not sure what that symbol would be that represents any random name. I have alot of recorded afflictions and such like this, that could easily be used if only I could figure out this one thing. I don't care if you think I'm stupid for asking something that seems simple, but this would save my life... in the game at least anyways.

(\\w+) points a golden... blah blah blah

Edit:

To answer the next question you probably have - ColourNote("yellow", "black", "ZOMG %1 JUST VINED YOU!!!")
Esano2010-04-04 08:52:39
I suggest you look into regex and making your various triggers regex - what you were just given - (\\w+) - is a regex wildcard and will only work if you have regex enabled, in which case the rest of your trigger must also be in regex (which is preferable and faster anyway).

If you're not using regex, the generic wildcard is *
Unknown2010-04-04 20:24:12
Ahh, yes. I assumed you knew several other things there, which I accidentally do often. Sorry. You'll need to check the Regular Expression box in the trigger, and the full line for that particular one would be:
^(\\w+) points a golden sickle at you and vines shoot forth\\, entangling you\\.$

Like Esano said, I would read up on regex. The basics are fairly easy to grasp, and a majority of triggers used for Lusternia follow and require only a few simple rules. If you open a free system (Like Treant) and look at some of the triggers, you'll see the patterns. Googling regex will give you more information on it than you could possibly hope to absorb in a reasonable amount of time, though.
Unknown2010-04-04 21:54:05
Ok next question. How can I target multiple people at once?

I keep having the problem of needing to switch between enemies rather quickly. So how can I have my t * set to target both Sidd an Uraziel at the same time?
Unknown2010-04-04 22:16:04
You'd have to have multiple target variables (Like t1-t5) or an ordered list and then use an aliases to cycle through them setting your main target variable to t1, t2, t3, t4, t5.
Unknown2010-04-24 04:05:02
Ok, I'm so close to finishing an ego cycling thing for begging. I have variable beg = 0, and variable sup = 1. I can make everything else work just fine. But when I try to put this in my trigger

if SetVariable == "0" then
Console.WriteLine("beg")
else
Console.WriteLine("sup")
SetVariable("beg", 1)
end


I get told that Console is a nil value. I'm guessing C# coding doesn't work here.

What I'm trying to do is have the game send "beg" or "sup" to the game client. So it triggers my alias and then proceeds to alternate between the two. I'm using Mushclient by the way.
Unknown2010-04-24 04:08:36
It's if GetVariable("myvariable")

And Send("beg")
Aidyn2010-04-27 14:16:55
QUOTE (Esano @ Apr 4 2010, 12:52 PM) <{POST_SNAPBACK}>
I suggest you look into regex and making your various triggers regex - what you were just given - (\\w+) - is a regex wildcard and will only work if you have regex enabled, in which case the rest of your trigger must also be in regex (which is preferable and faster anyway).

If you're not using regex, the generic wildcard is *


To which specific part of the process are you referring to as being faster? I was under the impression it matches all wildcards to appropriate triggers alphanumerically or based on the order assigned. Is it in the parsing? What makes it faster? Seriously, not trying to be a sharpshooter here, I'm still rather a novice in coding. Perhaps I've never done it quite right but my regex for triggering on names has almost always been quirky.

Before I post, perhaps I should elaborate a little more. What I mean is Mush receives a prompt such as:

Somebody attacks you.

You've made a trigger to detect that you've been attacked, but not by anyone specific. Now Mush evaluates this prompt and runs through the entire slew of triggers alphanumerically before it finds a match and executes the code. Or am I mistaken? Is there some middle man that regex seems to be cutting out? Because, theoretically, the code gets parsed based on the alphabet with the only exception being that special characters such carets and asterisks are evaluated first. Now I could see where this would be advantageous if only really important triggers were coded in regex, because they would get evaluated and matched before all other triggers; however, if the aforementioned process is the case, having everything coded in regex presents no actual advantage. This being because all special characters get matched in a specific order, and ultimately the parsing comes back down to the alphanumerical process. Am I just befuddling the whole process?
Ilyarin2010-04-27 14:40:34
By my understanding, before evaluating whether the trigger is a match to the specified text, MUSHClient converts non-regex triggers into regex patterns. Therefore if your trigger is already in regex, this conversion does not need to occur, and some processing time is saved. That is the main reason.
Aidyn2010-04-27 16:34:35
Makes sense. The only logical conclusion I could come to, without knowing for certain, was that regex was parsed directly to the actual code of Mush rather than being translated separately.
Unknown2010-04-27 17:14:04
All triggers and aliases are converted to regex internally before being evaluated. The internal conversion from a MUSHclient pattern to a regex pattern is general enough that someone who's good with regex patterns could probably do better by converting it himself. If you're terrible with regex, however, it's best to let MUSHclient do it for you.

Another speed tip is to avoid using the 'keep evaluating' option on triggers that don't need it. If you have multiple triggers matching on any line, you need 'keep evaluating' for the higher priority (lower sequence) triggers. For things that fire a lot (prompts) or are only triggered once, you don't need it. The fewer patterns MUSHclient has to evaluate per line, the faster things move along. (The difference in time taken is really only noticeable after hundreds of triggers with lots of script lines, of course.)
Unknown2010-04-27 19:13:05
QUOTE (Zarquan @ Apr 27 2010, 06:14 PM) <{POST_SNAPBACK}>
Another speed tip is to avoid using the 'keep evaluating' option on triggers that don't need it. If you have multiple triggers matching on any line, you need 'keep evaluating' for the higher priority (lower sequence) triggers. For things that fire a lot (prompts) or are only triggered once, you don't need it. The fewer patterns MUSHclient has to evaluate per line, the faster things move along. (The difference in time taken is really only noticeable after hundreds of triggers with lots of script lines, of course.)



Yeah I use this to power up everytime I start up my character. Works very well, and it pretty much saves me so much time. Sure, I get the "you have to regain equilibrium" each other line, but that really doesn't bug me all that much. If I am correct, the lower the sequence number, the higher priority it is? Or is it the other way around?

I'd really would like to make something to do a simple spell order. I have the target and variables set up. I just would love to learn how to set a timer to wait for the equilibrium to occur. Otherwise, it tries to execute the command all at once. Real bother. Example.

abjure web @target
*wait 5 seconds*
abjure cosmicfire @target

I feel stupid asking so many simple things among people who obviously have bigger problems. Perhaps these kind of questions would help others who are brand new to the game accustom themselves to it. Maybe perhaps a "Newbie Triggers and Alias Question" section? Just a suggestion.
Unknown2010-04-27 20:09:49
I have a "todo" queue in my combat system for balance/equilibrium things. You set all the commands you want to execute, it pops the first one off and sends it. When it sends a command, it sets a flag called "doing" and a timer to reset it after a half second. (The flag is a variable that prevents from spamming commands when a prompt comes between the command and the execution of the command.) The prompt code is set to look for things in the todo queue, whether or not you have balance and equilibrium (and any afflictions that might prevent action), and whether or not the "doing" flag it still set. If everything's good, it pops the next one off and sends it, going until everything in the queue is executed.

It's not 100% foolproof, but it works for me 99% of the time. Lag, afflictions, and such can still mess you up, basically.
Unknown2010-04-27 23:18:50
QUOTE (Zarquan @ Apr 27 2010, 08:09 PM) <{POST_SNAPBACK}>
I have a "todo" queue in my combat system for balance/equilibrium things. You set all the commands you want to execute, it pops the first one off and sends it. When it sends a command, it sets a flag called "doing" and a timer to reset it after a half second. (The flag is a variable that prevents from spamming commands when a prompt comes between the command and the execution of the command.) The prompt code is set to look for things in the todo queue, whether or not you have balance and equilibrium (and any afflictions that might prevent action), and whether or not the "doing" flag it still set. If everything's good, it pops the next one off and sends it, going until everything in the queue is executed.

It's not 100% foolproof, but it works for me 99% of the time. Lag, afflictions, and such can still mess you up, basically.


But your combat system is sold separately correct? So I suppose you can't tell over forums if your going to get credits from others who like your service. *thinks* Ok, well I'll do my best to make things work with what I got, but I'll keep that in mind if I can't figure it out.
Unknown2010-04-28 00:28:46
QUOTE (TheSponge @ Apr 27 2010, 07:18 PM) <{POST_SNAPBACK}>
But your combat system is sold separately correct? So I suppose you can't tell over forums if your going to get credits from others who like your service. *thinks* Ok, well I'll do my best to make things work with what I got, but I'll keep that in mind if I can't figure it out.


It's called Treant Combat System. I'm pretty sure he means the base package, as it's not listed in his premium add-ons. I haven't used the specific feature in Treant, but I'm pretty sure it's a base functionality.
Unknown2010-04-28 01:14:24
Yes, the ability to queue things is a base functionality of Treant as he uses it in a few different places. The most obvious one I can think of is the autodeffer.