Guest BL@(K-R34P3R Posted September 25, 2004 Share Posted September 25, 2004 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? Link to comment Share on other sites More sharing options...
ifthenhelpme Posted September 25, 2004 Share Posted September 25, 2004 set a hotkey to start a loop...put the start loop script at the top of ur script...wait nevermind that wont work...sorry Link to comment Share on other sites More sharing options...
KnowledgeSponge Posted September 25, 2004 Share Posted September 25, 2004 (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 September 25, 2004 by KnowledgeSponge Link to comment Share on other sites More sharing options...
Guest BL@(K-R34P3R Posted September 25, 2004 Share Posted September 25, 2004 Thanks I'll try that right now. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now