| Message |
Well, you make a trigger run a script, then it runs every time the trigger fires (use "send to script" in the trigger configuration). There are many examples here on the forum. Same for an alias.
Basically to make something happen only in combat, you need to know (the client needs to know) if you are in combat or not.
What I would do is use a trigger to detect going into combat (or being in combat), eg. a message like "The kobold hits you for 20 damage" could be turned into a trigger matching "The * hits you for * damage" and in that trigger you do "send to script", and in the send field put something like "in_combat = true".
Then you need to know when you have left combat, for example "The kobold is dead! You get 100 experience" could be matched by a trigger "The * is dead! You get * experience", and then you set in_combat to be false.
Some MUDs, like SMAUG, have a different "combat" prompt, so you could simply detect which sort of prompt you have got with triggers, and react accordingly.
See http://www.mushclient.com/scripting for some general guidance on doing scripting. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|