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

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Delays in scripts
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Delays in scripts

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


Pages: 1 2  

Posted by Caelen   (81 posts)  [Biography] 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?
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #1 on Wed 07 Jul 2010 09:09 PM (UTC)
Message
See
Template:faq=69 Please read the MUSHclient FAQ - point 69.
which links to
Template:post=4956 Please see the forum thread: http://gammon.com.au/forum/?id=4956.

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[Go to top] top

Posted by Caelen   (81 posts)  [Biography] 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?
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] 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
[Go to top] top

Posted by Caelen   (81 posts)  [Biography] 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?
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] 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
[Go to top] top

Posted by Caelen   (81 posts)  [Biography] 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!
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] 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
[Go to top] top

Posted by Caelen   (81 posts)  [Biography] 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. :)
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] 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
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (21,322 posts)  [Biography] 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
[Go to top] top

Posted by Twisol   USA  (2,257 posts)  [Biography] 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
[Go to top] top

Posted by David Haley   USA  (3,881 posts)  [Biography] bio
Date Reply #14 on Thu 08 Jul 2010 02:15 AM (UTC)
Message
That's funny, I did a search for 'delay script' and got this link:
http://www.gammon.com.au/scripts/showfaq.php?faqid=69&productid=0

which claims to be FAQ id 69. Well, sorry about that. :P

David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone

http://david.the-haleys.org
[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.


11,272 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

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.

[Home]


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 FutureQuest]