script locking mouse

Get help with using AutoHotkey and its commands and hotkeys
Failires1337
Posts: 4
Joined: 05 Apr 2020, 04:41

script locking mouse

06 Apr 2020, 09:31

Good Morning!!
I need help, I play a game I use a code

Code: Select all

f9::Suspend
LButton::
Loop
{
SetMouseDelay 1
Click
If(GetKeyState("LButton","P")=0)
Break
}
and the problem is that it only works well when I aim with the right mouse button, but I wanted to use it with the left (without aiming), but the mouse hangs and keeps shooting but I can't control where the shot should go, and it also doesn't work with the pressed ctrl, so I ask for help with a code that lets me use the script without the mouse crashing
User avatar
boiler
Posts: 4665
Joined: 21 Dec 2014, 02:44

Re: script locking mouse

06 Apr 2020, 11:45

Try it like this. The $ keeps it from calling itself (not triggered by virtual clicks), and the * allows for modifier keys like Ctrl to be held down. Also showed how “until” can be used instead of if/break. Should end your hotkey routines with a return, btw.

Code: Select all

f9::Suspend
$*LButton::
Loop
{
SetMouseDelay 1
Click
} until GetKeyState("LButton","P")=0
return
Failires1337
Posts: 4
Joined: 05 Apr 2020, 04:41

Re: script locking mouse

06 Apr 2020, 12:59

You solved the problem not to work with Ctrl pressed, more I can't control the shooting using the left button button (without aim)
More useful, thanks for the help :bravo:

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], marwanco, Preed, swagfag, vsub and 123 guests