Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ General ➜ Triggers

Triggers

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Hchstenor   (10 posts)  Bio
Date Mon 20 Jun 2005 12:33 AM (UTC)
Message
Ok, I am having tons of problems with triggers. I'm not sure how to use them at all, and the help file I can't understand. I just need someone to walk me through it. What's a regular expression? How do I set variables? What if I want it to match everything, only certain parts? Email me at HCHS_tenor@hotmail.com with a subject like Triggers if you could help... I have yahoo messenger hchs_tenor@yahoo.com


Top

Posted by David Haley   USA  (3,881 posts)  Bio
Date Reply #1 on Mon 20 Jun 2005 12:37 AM (UTC)
Message
There are plenty of posts here about triggers etc., have you tried looking around a bit? I'm sure there are lots of examples that would help you out. If not, you should probably ask some more specific questions e.g. say what it is you want to trigger against, so that somebody can help you here. (By the way, it's better if people help you here and not by email, so that everybody can benefit from it.)

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #2 on Mon 20 Jun 2005 05:51 AM (UTC)
Message
And try looking around the new help file (available online, or as a download) since the older one is well, old and outdated.

And you can find more information on regular expressions in the regular expression guide (its a text file in your mushclient directory, docs folder I think) and I believe it's also covered in the new help file.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Hchstenor   (10 posts)  Bio
Date Reply #3 on Mon 20 Jun 2005 04:36 PM (UTC)
Message
Ok, I'm playing Two Towers. In a certain quest the game sends you "so-and-so" smiles and asks you:
"Question"

I know most of the questions, I want to trigger the questions to send the answers. I tried simply copying the questions and pasting them into Trigger and then Send the answer it wouldn't fire. I tried "convert to real expression" but that didn't work either.
Top

Posted by Hchstenor   (10 posts)  Bio
Date Reply #4 on Mon 20 Jun 2005 05:52 PM (UTC)
Message
Also, I want to set up a backstab trigger for when an assassin tries to back stab me...

the trigger for success is :
Without warning "Sam" stabs you from behind!
the trigger for failure is :
You hear "Sam" sneaking up behind you, suddenly you spin and throw your attacker to the ground.

When either of those things happen I want to send a message to my guild over the comm saying I have been backstabbed, and if possible to list hp and ep and I heard location was possible...
to send a message over the comm it's "$" then "message".


Here is me being backstabbed:
HP:230 EP:178> Wormbaneii wields his forged sword.
Without warning, Wormbaneii stabs you from behind!

Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #5 on Mon 20 Jun 2005 06:33 PM (UTC)
Message
You'll need to get your location (how?), EP and HP (which are in your prompt, so triggers that set variables).

<triggers>
  <trigger
   enabled="y"
   expand_variables="y"
   match="Without warning, * stabs you from behind!"
   sequence="100"
  >
  <send>$Backstabbed by %1 - @HP hp @EP ep</send>
  </trigger>
</triggers>


That's the trigger for the successful backstab, as a non regular expression.
It also assumes you have variables named 'HP' and 'EP' and it sends them as well (that's the expand variables part).

If you wanted it as a regular expression, it would simply be this:
^Without warning\, (.*) stabs you from behind\!$
and you'd need to check the regular expression box.

You should try copying and pasting the mud output (for the line) into the trigger box, and then convert whatever words change into wildcards. With triggers you have to be pretty precise in the match, an extra space here, or dropping a period here, will make it not work.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Hchstenor   (10 posts)  Bio
Date Reply #6 on Mon 20 Jun 2005 06:48 PM (UTC)
Message
How would I get my location? When it triggers is says @hp @ep? How can I change that?


This is me being stabbed...
Without warning, Bobbert stabs you from behind!
do wimpy off, focus dodge, $: $HIY$has been $HIR$BACKSTABBED $HIY$by $HIB$Bobbert$HIY$!!! -@HP @ep

Do: starting commands.
HP:230 EP:230> You don't feel like a wimp anymore.
HP:230 EP:230> You focused on dodge last time, try something different!
HP:230 EP:230> [ Valacirca ] Isaiah has been BACKSTABBED by Bobbert!!! -@HP @ep
HP:230 EP:227> Do: Commands completed.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #7 on Mon 20 Jun 2005 07:58 PM (UTC)
Message
the @ means variable, so @EP (with expand variables checked) basically inserts the contents of the variable EP, you can just delete that.

I don't know how you would get your location (a command from the server perhaps?), but you'll have to figure it out if you want to be able to report it.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Hchstenor   (10 posts)  Bio
Date Reply #8 on Wed 22 Jun 2005 11:02 PM (UTC)
Message
Ok, here's another request... This might get complex... in game wizards run 'find's on people and it tells you their local. I want a trigger so when someone asks me for a 'find' it'll automate it...
I figured this part out, but it's wierd...

HP:230 EP:204> Elyaavie tells you: find elyaavie
do alias x tell Elyaavie, find elyaavie
Do: starting commands.
HP:230 EP:204> Alias: x (tell Elyaavie) altered.
HP:230 EP:204> Elyaavie is in Misty Mountains at a guildhall.
do x Elyaavie is in Misty Mountains at a guildhall.
In the room: Corridor of Willows.
Elyaavie is not wanted.
HP:230 EP:184> Do: Commands completed.
HP:230 EP:184> Do: starting commands.
HP:230 EP:184> You tell Elyaavie: Elyaavie is in Misty Mountains at a guildhall.
do x You tell Elyaavie: Elyaavie is in Misty Mountains at a guildhall.
HP:230 EP:184> Do: Commands completed.
HP:230 EP:184> Do: starting commands.
HP:230 EP:184> You tell Elyaavie: You tell Elyaavie: Elyaavie is in Misty Mountains at a
guildhall.
HP:230 EP:184> Do: Commands completed.


It'd help if it didn't spaz like that so many times...
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #9 on Thu 23 Jun 2005 03:00 AM (UTC)
Message
Alright, I am thoroughly confused by your notation. Is the Do stuff stuff you've sent? or what?
How about some real output?
and what triggers/aliases are you using? Can you copy/paste them here?

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Hchstenor   (10 posts)  Bio
Date Reply #10 on Thu 23 Jun 2005 04:27 AM (UTC)
Message
Wow! I knew I left that off... I just forgot to put it...

trigger * tells you: find *
send do alias x tell %1, find %2
What that does is make an alias to tell the requestee, and then executes the find...
Now what I want is to take the info from the find which is like what I already posted and TELL the requestee that information back...
I tried this...
Trigger * is in * at a *
Send x %1 is in %2 at a %3
Unfortunately as you see about it just got spammy and went crazy, and didn't always go off anyway... need anything else? Social security number, date of birth, ect? :)
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #11 on Thu 23 Jun 2005 06:23 PM (UTC)
Message
You should make your triggers into regexps, then you can limit it to matching on something like [name] tells you: (whatever). Since the non-regexps could match on that, but they could also match on [name tells you: name tells you: really, this could be anything] tells you: (stuff).

^(\w+) tells you: find (.*)$
That is a regexp.

And when I say copy/paste, you can literally copy and paste your whole trigger, that makes it easy for you, and easy for us.

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Hchstenor   (10 posts)  Bio
Date Reply #12 on Thu 23 Jun 2005 07:45 PM (UTC)
Message
I really would like to not be so annoying, and if I were you I'd have told me to go away... but your previous post helped somewhat though I still can't get it to reply to sender the info I get.
Top

Posted by Flannel   USA  (1,230 posts)  Bio
Date Reply #13 on Fri 24 Jun 2005 06:30 PM (UTC)
Message
Could you copy and paste your triggers (the whole thing, go to the triggers dialog, highlight your trigger, click copy, and then paste it here) here? Just the two that are relevant, of course (you might have to escape some slashes, if you're putting it in code tags).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
Top

Posted by Hchstenor   (10 posts)  Bio
Date Reply #14 on Fri 24 Jun 2005 07:37 PM (UTC)
Message
Ok, I had someone send me a find trigger, well actually 5 triggers for a find... so now that works. Thanks though for the help, sorry I'm completely ignorant.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


30,824 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.