Reply to this subject
Start a new subject
 
Refresh page
Pages: 1 2
| Posted by |
Caelen
(81 posts) bio
|
| Date |
Wed 07 Jul 2010 08:51 PM (UTC) [ quote
] |
| 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
Moderator |
| Date |
Reply #1 on Wed 07 Jul 2010 09:09 PM (UTC) [ quote
] |
| 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) [ quote
] |
| 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,230 posts) bio
|
| Date |
Reply #3 on Wed 07 Jul 2010 09:36 PM (UTC) [ quote
] |
| 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) [ quote
] 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,230 posts) bio
|
| Date |
Reply #5 on Wed 07 Jul 2010 09:50 PM (UTC) [ quote
] |
| 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) [ quote
] |
| 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,230 posts) bio
|
| Date |
Reply #7 on Wed 07 Jul 2010 09:56 PM (UTC) [ quote
] |
| 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) [ quote
] |
| 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,230 posts) bio
|
| Date |
Reply #9 on Wed 07 Jul 2010 10:05 PM (UTC) [ quote
] |
| Message |
| Great! :) |
'Soludra' on Achaea
Blog: http://jonathan.com/
GitHub: http://github.com/Twisol | top |
|
| Posted by |
Nick Gammon
Australia (18,797 posts) bio
Forum Administrator |
| Date |
Reply #10 on Wed 07 Jul 2010 10:32 PM (UTC) [ quote
] 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,230 posts) bio
|
| Date |
Reply #11 on Wed 07 Jul 2010 10:33 PM (UTC) [ quote
] 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 (18,797 posts) bio
Forum Administrator |
| Date |
Reply #12 on Wed 07 Jul 2010 10:37 PM (UTC) [ quote
] |
| 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,230 posts) bio
|
| Date |
Reply #13 on Wed 07 Jul 2010 10:45 PM (UTC) [ quote
] |
| 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.
3,616 views.
This is page 1, subject is 2 pages long: 1 2
Reply to this subject
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )