Is there a way to make a function wait?

Posted by Zubby on Sat 12 Aug 2023 08:25 PM — 3 posts, 10,044 views.

#0
Hi All,

I have run into an issue where I need to have my character wait for a specified period of time.

For example:

- I fight a mob
- The mob dies
- I run a check to see if my spellpoints are 0
- If they are 0 I need to wait 60 seconds for a spellpoint to regen

I'm currently using speedwalk()

so I would like to pauseSpeedwalk()

.. wait a specified period of time ..

resumeSpeedwalk()


Does anybody know how I could accomplish this?

Thanks!
Australia Forum Administrator #1
See https://www.gammon.com.au/forum/?id=4956

In particular reply #2: https://www.gammon.com.au/forum/?id=4956&reply=2#reply2
Amended on Sat 12 Aug 2023 09:57 PM by Nick Gammon
#2
Thanks. Makes sense. I will give it a shot.