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

Get help with using AutoHotkey and its commands and hotkeys
CallmeCity
Posts: 9
Joined: 06 Mar 2017, 19:22

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

02 May 2017, 10:51

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
}
}
}
User avatar
Almost_there
Posts: 404
Joined: 30 Sep 2014, 10:32

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

02 May 2017, 15:19

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.

Return to “Ask For Help”

Who is online

Users browsing this forum: ambrosedheffernan, RubbeH, Sabestian Caine, TAC109, tatagi and 42 guests