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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Triggers...

Triggers...

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


Posted by Jquon   (3 posts)  Bio
Date Wed 12 Jan 2011 01:26 AM (UTC)
Message
. I am trying to set up a trigger so that whenever someone pokes me, my trigger will send a heal to them. Is this possible? Like it will says "so and so pokes you in ribs" and I want it to send back "treat serrious so and so"
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #1 on Wed 12 Jan 2011 06:34 AM (UTC)
Message
Certainly it's possible.

Try reading this post:

http://www.gammon.com.au/forum/?id=8086

That's all about making simple triggers like that. Just change the words and you'll have it.

Also try browsing some of the other "getting started" posts.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #2 on Wed 12 Jan 2011 08:26 AM (UTC)
Message
Can we please stick to one thread? You have now started three threads on this subject.

To match:


so and so pokes you in ribs


You need to match on:


* pokes you in ribs


To use that name in your response you would send:


treat serious %1


This is because %1 is replaced by whatever matches the first wildcard.

http://www.gammon.com.au/mushclient/funwithtriggers.htm

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by This_Guy   (13 posts)  Bio
Date Reply #3 on Sun 16 Jan 2011 05:37 PM (UTC)
Message
Would a multi line trigger run off of; You have recovered balance, and below it your health bar?
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #4 on Sun 16 Jan 2011 10:06 PM (UTC)
Message
It should, although multi-line triggers are slightly fiddly to get working. For one thing they have to be regular expressions.

Depending on how confident you are, it might be simpler to have the trigger "You have recovered balance" just set a flag, eg.


balance = true


And then have your prompt (health) trigger check that variable.

eg.


if balance then
  Send ("sip wine")
end


Of course you need a third trigger to notice when you have lost balance, eg.


balance = false


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by This_Guy   (13 posts)  Bio
Date Reply #5 on Mon 17 Jan 2011 03:45 AM (UTC)

Amended on Tue 25 Jan 2011 08:42 PM (UTC) by Nick Gammon

Message

<triggers>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="*/*h */*m 0e 0w *x e-pp&gt; bd&gt;&gt;"
   send_to="12"
   sequence="100"
  >
  <send>balance = false</send>
  </trigger>
</triggers>

<triggers>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="*/*h */*m 0e 0w *x ebpp&gt; bd&gt;&gt;"
   send_to="12"
   sequence="100"
  >
  <send>balance = true</send>
  </trigger>
</triggers>


<triggers>
  <trigger
   enabled="y"
   keep_evaluating="y"
   match="*/*h */*m 0e 0w *x ebpp&gt; bd&gt;&gt;"
   send_to="12"
   sequence="100"
  >
  <send>local_health = %1
max_health = %2
local_mana = %3
max_mana = %4

if health / max_health &lt;= 0.15
then
  Send ("touch crystal")
end -- if</send>
  </trigger>
</triggers>




I can't get this to work, what's the issue?
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #6 on Tue 18 Jan 2011 06:19 AM (UTC)
Message
We can't help you debug your triggers if you don't post the MUD output that you are trying to trigger on. Saying "I can't get this to work" doesn't tell us much. For example, is one trigger firing but not another one? You can edit each trigger individually to see if it has fired or not. You can also use the Summary plugin to see a summary of what you are doing and then "drill down" to the individual triggers to see how many times each one fired.

Template:bug

Please provide a summary of your world configuration:

  • Either use the scripting Immediate window (Ctrl+I) to execute: Debug ("summary")

    or

  • Install the Summary plugin (see "Summary" feature) and type "summary"

Then copy the resulting information from the output window, and paste into a Forum message.

You need version 4.55 onwards of MUSHclient to do this.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by This_Guy   (13 posts)  Bio
Date Reply #7 on Mon 24 Jan 2011 09:13 PM (UTC)
Message
easier to set it up on a macro so I did. However if I want something sent based on several true or false statements what would it looke like this;

if balance
if equilibrium
if prone
Send ("impale " .. target)
end


Or is that totally off?
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #8 on Mon 24 Jan 2011 09:31 PM (UTC)
Message
In Lua it would be:


if balance and equilibrium and prone then
  Send ("impale " .. target)
end  -- if



- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by This_Guy   (13 posts)  Bio
Date Reply #9 on Tue 25 Jan 2011 06:18 PM (UTC)
Message
Are all the true/ false sent to script along with the main trigger? I ask because that is what I have set up and it isn't firing.
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #10 on Tue 25 Jan 2011 08:44 PM (UTC)
Message
Yes they are. The script part looks OK as far as I can see, but if the triggers aren't firing it doesn't really matter what the script does.

As I said before, you need to post your MUD output before I can comment on why the trigger may or may not be firing. Otherwise it is just pure guesswork.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


35,116 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.