silvermice Posted August 14, 2008 Share Posted August 14, 2008 basicly I just want a script that will hold alt+click unless I hit the toggle pause or run key kinda thing and ofcourse the ever so usefull exit key. this is what I have but the alt/click get stuck and don't want to pause. any help would be greatly appreciated ty. Global $Paused HotKeySet("{HOME}", "_Pause") HotKeySet("{END}", "Terminate") While 1 WinWaitActive("windowtitlehere") send("{ALTDOWN}") MouseDown ("left") WEnd Func _Pause() If Not IsDeclared("isPaused") Then Global $isPaused = False $isPaused = Not $isPaused While $isPaused send("{ALTUP}") MouseUP("primary") sleep(250) Wend EndFunc Func Terminate() Exit 0 EndFunc Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 14, 2008 Share Posted August 14, 2008 basicly I just want a script that will hold alt+click unless I hit the toggle pause or run key kinda thing and ofcourse the ever so usefull exit key. this is what I have but the alt/click get stuck and don't want to pause. any help would be greatly appreciated ty. Global $Paused HotKeySet("{HOME}", "_Pause") HotKeySet("{END}", "Terminate") While 1 WinWaitActive("windowtitlehere") send("{ALTDOWN}") MouseDown ("left") WEnd Func _Pause() If Not IsDeclared("isPaused") Then Global $isPaused = False $isPaused = Not $isPaused While $isPaused send("{ALTUP}") MouseUP("primary") sleep(250) Wend EndFunc Func Terminate() Exit 0 EndFunc Simplified: HotKeySet("{HOME}", "_Pause") HotKeySet("{END}", "Terminate") Global $Paused = False While 1 WinWaitActive("windowtitlehere") If $Paused Then MouseUp("left") Send("{ALTUP}") Else send("{ALTDOWN}") MouseDown ("left") EndIf Sleep(50) WEnd Func _Pause() $Paused = Not $Paused EndFunc Func Terminate() Exit 0 EndFunc Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
silvermice Posted August 14, 2008 Author Share Posted August 14, 2008 Simplified: HotKeySet("{HOME}", "_Pause") HotKeySet("{END}", "Terminate") Global $Paused = False While 1 WinWaitActive("windowtitlehere") If $Paused Then MouseUp("left") Send("{ALTUP}") Else send("{ALTDOWN}") MouseDown ("left") EndIf Sleep(50) WEnd Func _Pause() $Paused = Not $Paused EndFunc Func Terminate() Exit 0 EndFunc ty very much for simplifying it I wish I could say it worked 100% but its still doing what mine was, which is starting and giving me a hell of a hard time getting it to pause and restart. It seems the alt+Click get "stuck" down if you will and don't wanna retract itself if there is any fix for this I"d greatly appriciate it. Link to comment Share on other sites More sharing options...
PsaltyDS Posted August 14, 2008 Share Posted August 14, 2008 ty very much for simplifying it I wish I could say it worked 100% but its still doing what mine was, which is starting and giving me a hell of a hard time getting it to pause and restart. It seems the alt+Click get "stuck" down if you will and don't wanna retract itself if there is any fix for this I"d greatly appriciate it.What about your use of WinWaitActive()? Is it really required? That stops the while loop from proceeding to where it would change the state of Alt and the mouse. Either comment that out, or move inside the Else condition, so it only waits for window active when pressing it, not when releasing. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
silvermice Posted August 14, 2008 Author Share Posted August 14, 2008 What about your use of WinWaitActive()? Is it really required? That stops the while loop from proceeding to where it would change the state of Alt and the mouse. Either comment that out, or move inside the Else condition, so it only waits for window active when pressing it, not when releasing. ok I tried every movement I could, including removing winwaitactive completely it still gets stuck on 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