Jump to content
Sign in to follow this  
Guest BL@(K-R34P3R

Hotkey Loops

Recommended Posts

Guest BL@(K-R34P3R

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 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
Guest BL@(K-R34P3R

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...