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
➜ Delays in scripts
It is now over 60 days since the last post. This thread is closed.
Refresh page
Pages: 1 2
Posted by
| Caelen
(81 posts) Bio
|
Date
| Wed 07 Jul 2010 08:51 PM (UTC) |
Message
| What is the Lua command for entering wait times in a script, and how precise can it be? I prefer to work with hundredths of a second or smaller. Is MUSH capable of that? | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #1 on Wed 07 Jul 2010 09:09 PM (UTC) |
Message
| See which links to |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Caelen
(81 posts) Bio
|
Date
| Reply #2 on Wed 07 Jul 2010 09:18 PM (UTC) |
Message
|
David Haley said:
See (faq=69) which links to (post=4956)
Thank you for the links. The FAQ, however, stops at 52. Where is this point 69? | Top |
|
Posted by
| Twisol
USA (2,257 posts) Bio
|
Date
| Reply #3 on Wed 07 Jul 2010 09:36 PM (UTC) |
Message
| Point 25 seems to be what he was aiming for. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | Top |
|
Posted by
| Caelen
(81 posts) Bio
|
Date
| Reply #4 on Wed 07 Jul 2010 09:39 PM (UTC) Amended on Wed 07 Jul 2010 09:42 PM (UTC) by Caelen
|
Message
| Ah, I see it now. And more links lead to more links... Lots of reading to do.
Edit: Got through all the reading, but that still didn't answer one of my questions. How precise can it be? Is 1 second the smallest time, or can I use decimals? | Top |
|
Posted by
| Twisol
USA (2,257 posts) Bio
|
Date
| Reply #5 on Wed 07 Jul 2010 09:50 PM (UTC) |
Message
| Decimals down to a precision of 0.1 second, if I remember correctly. If you want more precision, you can get a frequency of 40ms with the OnPluginTick callback, but there's no way to disable it when you're done with it. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | Top |
|
Posted by
| Caelen
(81 posts) Bio
|
Date
| Reply #6 on Wed 07 Jul 2010 09:54 PM (UTC) |
Message
| Well, .1 is good enough for fishing, and an extra .05 per move on my paths (my House Hall is full of doors, so I alias all my motions through it) won't really slow me down too much, considering how small the Hall is.
Thanks! | Top |
|
Posted by
| Twisol
USA (2,257 posts) Bio
|
Date
| Reply #7 on Wed 07 Jul 2010 09:56 PM (UTC) |
Message
| 0.1s is 100ms, which is definitely good enough for most purposes. :)
Don't fully automate your fishing scripts, please. There's a pretty good chance you'll get caught if you do, because it's not allowed (see HELP AUTO). |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | Top |
|
Posted by
| Caelen
(81 posts) Bio
|
Date
| Reply #8 on Wed 07 Jul 2010 10:03 PM (UTC) |
Message
| I know about the restrictions on automation, thanks. I use triggers to tease the line and jerk the pole, since my wonderful lysdexia would otherwise prevent me from reacting quickly enough sometimes. I use them to re-bait the hook and store the fish upon catching it too. Very handy way to prevent theft of fishies. :) | Top |
|
Posted by
| Twisol
USA (2,257 posts) Bio
|
Date
| Reply #9 on Wed 07 Jul 2010 10:05 PM (UTC) |
Message
| Great! :) |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #10 on Wed 07 Jul 2010 10:32 PM (UTC) Amended on Wed 07 Jul 2010 10:33 PM (UTC) by Nick Gammon
|
Message
| See File -> Global Preferences -> Timers.
Timers have a resolution of 1/10 of a second (100 ms) if you put 0 in the Timer Interval field.
As Twisol said, the OnPluginTick callback is called 25 times a second, which gives you a resolution of 40 ms if you need that. Below that, surely the time taken for messages to get to/from the server to your client would be greater than the timer resolution?
For example, I think in most cases 200 ms for the server to respond would be considered an adequate response time.
In any case, in order to respond to an event (eg. "the fish tugs the line") a trigger is more appropriate, which would respond the moment the message arrived. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Twisol
USA (2,257 posts) Bio
|
Date
| Reply #11 on Wed 07 Jul 2010 10:33 PM (UTC) Amended on Wed 07 Jul 2010 10:34 PM (UTC) by Twisol
|
Message
|
Nick Gammon said: In any case, in order to respond to an event (eg. "the fish tugs the line") a trigger is more appropriate, which would respond the moment the message arrived.
Achaea actually uses the time it takes for you to tease the line or jerk the pole to determine how successful you are. I think the optimal delays were determined to be around 1000ms, give or take a hundred based on what exactly the action is.
It practically rewards automation, but there you go. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #12 on Wed 07 Jul 2010 10:37 PM (UTC) |
Message
| So a DoAfter of 1 second, on a trigger which responds to the jerk, is the way to go? Apart from possibly violating the terms of service? I suppose you can randomly build in a fail every now and then to allay suspicions. Or make it randomly jerk the line between 800 to 1200 ms, to make it look like someone is actually doing it? |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Twisol
USA (2,257 posts) Bio
|
Date
| Reply #13 on Wed 07 Jul 2010 10:45 PM (UTC) |
Message
| I actually specifically asked about that way back when. As long as it's not all automated - like, as long as you cast the line each time manually - they're okay with it. And as long as you respond to administrative pokes, of course. |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | 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.
55,665 views.
This is page 1, subject is 2 pages long: 1 2
It is now over 60 days since the last post. This thread is closed.
Refresh page
top