Jump to content

I'm sure this is easy and i'm just noob >.<


Recommended Posts

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 :P 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

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 :P 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

:P

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

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

:P

ty very much for simplifying it :P 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

ty very much for simplifying it :P 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.

:P

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

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.

:P

ok I tried every movement I could, including removing winwaitactive completely it still gets stuck on :P

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...