[Home] [Downloads] [Search] [Help/forum]

Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Tips and tricks
. . -> [Subject]  Help with trigger!

Help with trigger!

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

Posted by Gandin   (3 posts)  [Biography] bio
Date Sat 17 Apr 2004 09:34 PM (UTC)
Im having a problem.. i want to make it so i have a trigger to where my asteroid hauler hauls asteroids all day when im not around... but the thing is once u haul one asteroid in the next one changes... heres what it looks like when you type radar to look for asteroids


Outpost 0 0 0 [5609]

Asteroid 114940 -2 -1 2 [5607]
Asteroid 76840 4844 -5324 -2690 [9863]
Asteroid 90070 -8287 3007 1848 [7971]
Asteroid 72540 1750 6945 -1154 [12350]
Asteroid 91440 5393 -6991 2378 [9999]
Asteroid 41050 187 -394 4082 [5972]
Asteroid 90370 -4792 5017 -5791 [11307]
Asteroid 62720 4079 4765 2 [11771]
Asteroid 70350 1141 -6859 1071 [6039]
Asteroid 28380 -74 -2441 -1446 [4988]
Asteroid 64330 4581 30 -4517 [11049]
Asteroid 61190 -3297 1684 4873 [6450]
Asteroid 66000 3619 -5512 -306 [8005]
Asteroid 75840 726 7477 -1048 [12364]
Asteroid 114210 -3993 -3692 1376 [0]

the number after the asteroid is how much its worth and its id number..... the next 3 numbers are it coordinates in space and the number in brackets is its distance.... I want to make it so everytime my ship launches it will type radar then calculate itself to that asteroid.. automatically haul it back to the outpost to get paid for it..this is the one i want to bring in everytime.

Asteroid 114210 -3993 -3692 1376 [0]

Just remember that everytime the asteroid id number changes and so do the coordinates.. it is random..

can someone script me a trigger to do this please? i just cant get it..
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #1 on Sun 18 Apr 2004 12:55 AM (UTC)
its a simple trigger

This is a regexp:
Asteroid (\d+) (-?\d+) (-?\d+) (-?\d+) \[(\d+)\]
You can add ^ for the front of the line, and $ for the end. I believe you have a trailing space.

As for the script, you havent told us anything about which asteroid you want, or how to get there, and the like. If you can simply go through the proccess step by step, We'll be able to help you out further.


Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Gandin   (3 posts)  [Biography] bio
Date Reply #2 on Sun 18 Apr 2004 07:19 PM (UTC)
its the basic swr space flight code. This is what you do, i start off in my asteroid hauler(a spaceship)type launch, it takes a few seconds for it to launch then im in space, i hit radar and it shows the whole list as shown above in my other post, i then type calculate (asteroid coords) then hyper.

calc 10023 5990 -1223

the ship then enters hyperspace then comes out in another few seconds.. i then type haul (asteroid id#).. the ship latches on then i type course 0 0 0 to get to the outpost since you cannot hyperspace hauling an asteroid.... once i get to the outpost i want it to land... then launch again and do it all over again...

It explains a lil more about the asteroids id # and coords changing every time after hauling it.
[Go to top] top

Posted by Nick Gammon   Australia  (23,016 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Mon 19 Apr 2004 10:29 PM (UTC)
You probably need to check the asteroids in a script and find the closest. I would have three triggers:

  1. Match the start of the list, eg.
    Outpost 0 0 0 *

    This one would clear a "closest asteroid" field.

  2. Match each asteroid, like the trigger Flannel gave.

    For each one you would see if this asteroid was closer than the previous one, and if so, change the "closest asteroid" to it, and remember its number and distance.

  3. Match the end of the list, whatever that is.

    This one then does the "calc" and "hyper" commands based on the remembered closest asteroid.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Gandin   (3 posts)  [Biography] bio
Date Reply #4 on Wed 21 Apr 2004 06:49 AM (UTC)
I dont quite understand all those codes and stuff you guys are saying... like whats regexp? i dont know much about this kinda stuff.. maybe if you could show some screenshots of what to do and what exacly to put in the trigger part and the trigger output part... If you could do that for me thatd be great.. thanks
[Go to top] top

Posted by Ked   Russia  (524 posts)  [Biography] bio
Date Reply #5 on Wed 21 Apr 2004 07:46 PM (UTC)
Regexp stands for "regular expression". It's a special syntax for matching text patterns. You use the regular expression the same way as you would use a "normal" trigger pattern, like "* was here but left.", the regexp just gives you more control over what and how is going to be matched by the trigger. If you use a regexp in your trigger then you need to check the 'Regular expression' option in the Trigger dialogue.
[Go to top] top

Posted by Nick Gammon   Australia  (23,016 posts)  [Biography] bio   Forum Administrator
Date Reply #6 on Thu 22 Apr 2004 07:14 AM (UTC)
Read Regular expression syntax and Fun with Triggers.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] 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.


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

Go to topic:           Search the forum

[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

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


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]