Need help altering a auto click scrip Topic is solved

Ask gaming related questions (AHK v1.1 and older)
josh4j

Need help altering a auto click scrip  Topic is solved

22 Mar 2018, 02:13

Basically i have a script i found and cannot alter the on off key on it i want to make it my side mouse button which is xbutton 3 i belive here is the script

dc = 0

recoil = 6

Pause::Suspend,Toggle
/::Suspend
LButton::
Loop
{
if (dc = 1)
{
SetMouseDelay 10
Click
DllCall("mouse_event", uint, 1, int, 0, int, 6, uint, 0, int, 0)
If (GetKeyState("LButton","P")=0)
Break
}
else {
Click
Break
}
}
return

P::
Loop {
If(GetKeyState("P", "P")=0)
{
if dc = 0
{
dc = 1
ComObjCreate("SAPI.SpVoice").Speak("on")
}
else
{
dc = 0
ComObjCreate("SAPI.SpVoice").Speak("off")
}
Break
}
}
return


U::
Loop {
If(GetKeyState("U", "P")=0)
{
recoil += 1
ComObjCreate("SAPI.SpVoice").Speak(recoil)
Break
}
}
return

Y::
Loop {
If(GetKeyState("Y", "P")=0)
{
recoil -= 1
ComObjCreate("SAPI.SpVoice").Speak(recoil)
Break
}
}
return



N::
Loop {
If(GetKeyState("N", "P")=0)
{
send {SHIFT down}
MouseGetPos, xpos, ypos
MouseClickDrag, left, xpos, ypos, xpos-200, ypos
send {SHIFT up}
MouseMove, xpos, ypos
Break
}
}
return
User avatar
evilC
Posts: 4823
Joined: 27 Feb 2014, 12:30

Re: Need help altering a auto click scrip

22 Mar 2018, 08:48

1) If you want to be able to use multiple of those hotkeys at once then this script cannot possibly work (You cannot have more than one loop running at once)
Eg hold Left mouse and P at same time.
This appears to be part of the design, as when you hold P, the variable dc is set, which is used in the LButton:: loop
There is absolutely no way that this code can work properly.
2) It will use loads of CPU (Because it has no sleeps in the loops).
3) It breaks normal windows operation, as it makes it impossible to hold the left mouse button in windows (eg will break click and drag in windows) because it remaps press of Left Mouse to press and release of Left Mouse

TL/DR: Forget it, the code is laughably bad.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 65 guests