Script Advice

Get help with using AutoHotkey and its commands and hotkeys
Loopo

Script Advice

10 Aug 2018, 01:47

Basically my intent was for it to click a spot, press f5, and click a spot three more times, press f1, then mousemove and click another spot.
It works half the time; I think the problem is the BlockInput function. I don't want to be able to move my mouse during the script execution, as that seems to mess up the script.

Any help is appreciated.

Code: Select all

+\::
{
BlockInput, On
SetKeyDelay, 0, -1
send {f1}
SetDefaultMouseSpeed, 0,
SetMouseDelay, 0, -1
CoordMode Mouse, relative
Mouseclick, left, 635, 445
SetKeyDelay, 0, -1
send {f5}
SetDefaultMouseSpeed, 0 
SetMouseDelay, 0, -1
CoordMode Mouse, relative
Mouseclick, left, 635, 445
SetMouseDelay, 0, -1
SetDefaultMouseSpeed, 0 
SetMouseDelay, 0, -1
CoordMode Mouse, relative
Mouseclick, left, 635, 445
SetDefaultMouseSpeed, 0 
SetMouseDelay, 0, -1
CoordMode Mouse, relative
Mouseclick, left, 635, 445
SetKeyDelay, 0, -1
send {f1}
SetDefaultMouseSpeed, 0 
SetMouseDelay, 0, -1 
CoordMode Mouse, relative
Mouseclick, left, 590, 445
sleep 1, -1
click
BlockInput, off
}
return
Mod edit: Added code tags.
pro100andrik94
Posts: 26
Joined: 08 Aug 2018, 07:27

Re: Script Advice

10 Aug 2018, 07:02

Code: Select all

+\::
;{ don't need here at all
BlockInput, On
SetKeyDelay, 0, -1 ; you can use parameters like "SetDefaultMouseSpeed, SetMouseDelay, CoordMode Mouse and SetKeyDelay" at the begin and it will be work for all script and you dont need to repeat it all the time
SetDefaultMouseSpeed, 0,
SetMouseDelay, 0, -1
CoordMode Mouse, relative
send {f1}
Mouseclick, left, 635, 445
;SetKeyDelay, 0, -1                           commented lines like this useless and you can delete it
send {f5}
;SetDefaultMouseSpeed, 0 
;SetMouseDelay, 0, -1
;CoordMode Mouse, relative
Mouseclick, left, 635, 445
;SetMouseDelay, 0, -1
;SetDefaultMouseSpeed, 0 
;SetMouseDelay, 0, -1
;CoordMode Mouse, relative
Mouseclick, left, 635, 445
;SetDefaultMouseSpeed, 0 
;SetMouseDelay, 0, -1
;CoordMode Mouse, relative
Mouseclick, left, 635, 445
;SetKeyDelay, 0, -1
send {f1}
;SetDefaultMouseSpeed, 0 
;SetMouseDelay, 0, -1 
;CoordMode Mouse, relative
Mouseclick, left, 590, 445
sleep 1  ;, -1 is not need here because sleep have only one parameter
click
BlockInput, off
;} don't need here at all
return

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], Odlanir and 160 guests