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 ➜ Trigger/Script to return coordinates, and other.

Trigger/Script to return coordinates, and other.

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


Posted by Wimbley   (10 posts)  Bio
Date Sat 23 May 2015 07:20 PM (UTC)
Message
I am new to scripting, and practice a little python.

I am trying to make a trigger or script to do as follow:

You are located at 1, 1, 1

when this posts I want it to return "move 1, 1, 1" and the coordinates change all of the time, so I need it to just repeat the numbers.

My 2nd question, is with something like the top I wanted to make a sequence of walking commands but I need it to patrol so something like:

north, plant seed(action timer 3 seconds for this), south, east, plant seed(3 second time to plant), west. .etc.

So I will go to in a cross shaped pattern to plant all around.

Thank you for any help provided!
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #1 on Sun 24 May 2015 05:51 AM (UTC)
Message
My Python skills are pretty rusty. A lot of that would be easier in Lua, especially building in delays, because that is easy with Lua coroutines.

- Nick Gammon

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

Posted by Wimbley   (10 posts)  Bio
Date Reply #2 on Sun 24 May 2015 02:38 PM (UTC)
Message
I will take advice in any language. I just need some ideas on how I would go about it and I can either convert it, or maybe I will give lua a go.
Top

Posted by Wimbley   (10 posts)  Bio
Date Reply #3 on Sun 24 May 2015 04:45 PM (UTC)
Message
Could I do a long trigger to something that would time out the whole sequence? timer on everything because of restrictions to commands sent in a short time.
example:

The sun comes up.
DoAfter(math.random(1)+1, "out")
DoAfter(math.random(1)+1, "n")
DoAfter(math.random(1)+1, "get seed from bag")
DoAfter(math.random(1)+1, "plant seed")
DoAfter(math.random(1)+1, "s")
DoAfter(math.random(1)+1, "s")
repeat, and even reset itself automatically?
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #4 on Sun 24 May 2015 08:46 PM (UTC)
Message
In Lua you can build pauses in as described here:

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

If you want to stop some loop you can always set a variable, and have the loop check the variable and then exit.

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


15,362 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.