Jump to content

Loops keystrokes etc...


EjayMega
 Share

Recommended Posts

WinWaitActive ( "Tibia")
$Inc = 1

While 1

 $SwitchOne = HotKeySet ( "{INSERT}", "SwitchOne" )
 $SwitchTwo = HotKeySet ( "{CTRL}", "SwitchTwo" )
  Select

    Case $SwitchOne = 0
      SwitchPel ()
    Case $SwitchTwo = 0
      SwitchTwo ()
    Case WinWaitClose ("Tibia")
      IamDone ()

EndSelect

WEnd

Func SwitchOne ()
  MouseMove ( 952, 317, 0 )
EndFunc

Func SwitchTwo ()
 $Inc = 2
EndFunc

Func SwitchPel ()
 While 1
 Select
 Case $Inc = 1
 Sleep ( 300 )
 SwitchOne ()
 EndSelect
 WEnd
EndFunc

Func IamDone ()

  Exit

EndFunc

I want this script to run a unlimited loop when i press INSERT and when I press Ctrl it should stop...But i dont know why it doesnt... happend Between this is my first script in auto it :ph34r:

Edit: Forgot to say... SwitchTwo () Makes $INC = 2 so the SwitchPel () stops...

Edited by EjayMega
Link to comment
Share on other sites

  • Developers

I want this script to run a unlimited loop when i press INSERT and when I press Ctrl it should stop...But i dont know why it doesnt... happend Between this is my first script in auto it :ph34r:

Edit: Forgot to say... SwitchTwo () Makes $INC = 2 so the SwitchPel () stops...

<{POST_SNAPBACK}>

Don't really understand what you want to do but here are a couple of pointers:

- HotKeySet() doesn't return a value but will perform the Function when the key is hit.

- {CTRL} is not a valid key.

- The HoKeySet is something you do once before the loop. so something like this:

HotKeySet("{INSERT}", "SwitchOne")
HotKeySet("{CTRL}", "SwitchTwo")
While 1
   If Not WinExists("Tibia") then IamDone()
   sleep(50)
Wend

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...