Page 1 of 1

Trying to combine 2 different ahk scripts....no luck yet

Posted: 02 May 2017, 10:51
by CallmeCity
I am trying to merge these 2 scripts into 1, but i keep getting errors. Separately, these 2 scripts work great on their own, but i would like to use them at the same time...The first script makes it so that the mouse will automatically "pull down" for me while im holding left control and left mouse click. The 2nd script makes it "auto-click" the left mouse button for me. How can i combine them into 1 script?

The first script is -

Code: Select all

#NoEnv
SendMode Input

~F6::Suspend
~End::ExitApp
~F5::Reload

LCtrl & ~LButton::
Loop
If GetKeyState("LButton", "LCtrl") {
Sleep, 6
moveAmount := (moveAmount = 2) ? 1 : 0
mouseXY(moveAmount,7.5)

}
else
break

Return



mouseXY(x,y)
{
DllCall("mouse_event",int,1,int,x,int,y,uint,0,uint,0)
}

The 2nd script is -

Code: Select all

f2::Suspend
;Script

~$*LButton::
{
Loop
{
SetMouseDelay 69
MouseClick, Left
If (GetKeyState("LButton","P")=0)
{
Break
Return
}
}
}

Re: Trying to combine 2 different ahk scripts....no luck yet

Posted: 02 May 2017, 15:19
by Almost_there
The KeyGetState command in your first script is incorrect. Mode cannot be "LCtrl".

Also, I beleive that "LCtrl & ~LButton::" and "~$*LButton::" is conflicting each other, but haven't tested myself.