Sign in to follow this  
Followers 0
Guest BL@(K-R34P3R

Hotkey Loops

4 posts in this topic

I am writing a game script right now. For Morrowind, so it's not considered hacking! What I want to do, is hotkey all of the code into a Loop statement, that runs indefinitely. I want it to work something like this:

User Presses hotkey and starts the looping program,

User Presses it again, (a few hours later), and it stops.

My question is, how do I bind an entire loop statement to a hotkey, if that can be done?

Share this post


Link to post
Share on other sites



set a hotkey to start a loop...put the start loop script at the top of ur script...wait nevermind that wont work...sorry

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Set the function to contain a While/Wend or Do/Until, at the beginning of the function reset the hotkey to go to a different function that has a sleep in it and also reset the hotkey back to the original function

EG

Run("blah\blah\morrowind.exe")

WinWaitActive("morrowind")

SleepFunc()

Func SleepFunc()

Hotkeyset("^1","loopfunc")

While 1

Sleep(2147483647)

WEnd

EndFunc

Func loopfunc()

Hotkeyset("^1","SleepFunc")

While 1

yer statements

WEnd

EndFunc

Edited by KnowledgeSponge

Share this post


Link to post
Share on other sites

Thanks I'll try that right now.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0