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 ➜ Tips and tricks ➜ Need help with a Complex multi line trigger

Need help with a Complex multi line trigger

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


Posted by Madrox   (40 posts)  Bio
Date Fri 20 Jan 2006 06:43 PM (UTC)
Message
Alright, I cant figure out how to make this work correctly.
What i need is a trigger that takes

[008] Battleship :Imperial Star Destroyer 'Plague' -<Pos:Outer>-
Energy: 099%|Hull: 100%|Crew: 000|System: Corellian -16/10
Targetting: Freighter:Pirate BF99 099%|100%

And then sends battlegroup nav Plague(or any other ship there are 12 different ones atm) autopilot

then after that battlegroup nav Plague fire about 15 times

then battlegroup nav plague autopilot

Any ideas?
Top

Posted by Madrox   (40 posts)  Bio
Date Reply #1 on Fri 20 Jan 2006 07:17 PM (UTC)
Message
Also, when i get this message after the fire spam 'Your target is outside of turbolaser range!' I would like it to wait 15 seconds then resend the fire commands
Top

Posted by Rojan QDel   USA  (9 posts)  Bio
Date Reply #2 on Sun 29 Jan 2006 06:17 PM (UTC)

Amended on Sun 29 Jan 2006 06:19 PM (UTC) by Rojan QDel

Message
This works, enjoy:

<triggers>
<trigger
enabled="y"
lines_to_match="3"
keep_evaluating="y"
match="^\[(.+)\] (.+) \:(.+) \'(.+)\' \-\-\nEnergy\: (.+)\|Hull\: (.+)\|Crew\: (.+)\|System\: (.+)\/(.+)\nTargetting\: (.+)\:Pirate (.+) (.+)\|(.+)\Z$"
multi_line="y"
regexp="y"
sequence="100"
>
<send>battlegroup nav %4 autopilot
battlegroup nav %4 fire
battlegroup nav %4 fire
battlegroup nav %4 fire
battlegroup nav %4 fire
battlegroup nav %4 fire
battlegroup nav %4 fire
battlegroup nav %4 fire
battlegroup nav %4 fire
battlegroup nav %4 fire
battlegroup nav %4 fire
battlegroup nav %4 autopilot</send>
</trigger>
</triggers>
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #3 on Mon 30 Jan 2006 07:06 PM (UTC)
Message
Quote:


Also, when i get this message after the fire spam 'Your target is outside of turbolaser range!' I would like it to wait 15 seconds then resend the fire commands


If you match on "Your target is outside of turbolaser range!" you can use DoAfter to wait 15 seconds. Something like this:


<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   expand_variables="y"
   match="Your target is outside of turbolaser range!"
   send_to="12"
   sequence="100"
  >
  <send>DoAfter (15, "battlegroup nav @shipname fire")</send>
  </trigger>
</triggers>


This assumes you have saved the current shipname in the variable 'shipname'.

- 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.


14,647 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.