help with ahk no recoil

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
kakashi
Posts: 2
Joined: 24 Nov 2017, 06:17

help with ahk no recoil

24 Nov 2017, 06:20

hi,

i made myself an easy script but i have following problem:

if i 1 click the left mouse button (once) then the script starts to move my cursor, but i only want the script to intervene, when i hold down the left mouse button and when i let go of the button, then i want the script to stop moving my cursor... but thats not working right now...


can someone help me to fix my problem? here is my code

Code: Select all

#NoEnv
SendMode Input

_auto := true

~LButton::autofire()
+LButton::_auto := ! _auto
F1::ExitApp

autofire()
{
global _auto
if _auto
{
Loop
{
if GetKeyState("LButton", "P")
{

Sleep 100
mouseXY(10, 15)
Sleep 100
mouseXY(10, 15)
Sleep 100
mouseXY(10, 15)
Sleep 100
mouseXY(10, 15)
Sleep 100
mouseXY(10, 15)
Sleep 100
mouseXY(10, 15)
Sleep 100
mouseXY(10, 15)
Sleep 100
mouseXY(10, 15)

}
else
break
} ;; loop
} ;; if
} ;; autofire()

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

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Holarctic, jameswrightesq, wpulford and 398 guests