help for editing my script

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
M4DCON
Posts: 5
Joined: 16 Aug 2022, 10:58

help for editing my script

Post by M4DCON » 16 Aug 2022, 11:02

Code: Select all

~LButton::
  
Sleep 3
Loop
If GetKeyState("LButton") {
Sleep, 3
moveAmount := (moveAmount = 2) ? 1 : 0
mouseXY(moveAmount,3.65)
}
else
break
 
Return
 
mouseXY(x,y)
{
DllCall("mouse_event",int,1,int,x,int,y,uint,0,uint,0)
}
 
F2:: Suspend
[Mod edit: [code][/code] tags added.]

this script move my mouse all the way down when i hold lmb button but i want to make it my mouse go down for 1 or 2 seconds can anyone help me ?

User avatar
mikeyww
Posts: 26596
Joined: 09 Sep 2014, 18:38

Re: help for editing my script

Post by mikeyww » 16 Aug 2022, 18:46

Welcome to this AutoHotkey forum!

Code: Select all

~LButton::
end := A_TickCount + 1000 * durationSec := 1
While GetKeyState("LButton") && A_TickCount < end {
 Sleep, 15
 DllCall("mouse_event", "Int", 1, "Int", 0, "Int", 4)
}
SoundBeep, 1500
Return

M4DCON
Posts: 5
Joined: 16 Aug 2022, 10:58

Re: help for editing my script

Post by M4DCON » 17 Aug 2022, 14:52

its almost perfect my dude only problem is sometimes its doesnt work for some reason if i hold lmb 5 times 1 time its not work still thank you very much and sorry for my english

M4DCON
Posts: 5
Joined: 16 Aug 2022, 10:58

Re: help for editing my script

Post by M4DCON » 17 Aug 2022, 15:23

i edit for myself and its perfect for now again thank you soo much you change my life

Post Reply

Return to “Ask for Help (v1)”