Sign in to follow this  
Followers 0
EjayMega

Loops keystrokes etc...

2 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



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

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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