Autoclicker problem!

Ask gaming related questions (AHK v1.1 and older)
buzk
Posts: 5
Joined: 15 Apr 2017, 18:43

Autoclicker problem!

15 Apr 2017, 18:47

Gui, show, w300 h100, Bhop Script

Gui, Add, button, vbutton gbutton w150 h50, Toggle BHOP Script

~LButton::SoundPlay, c:\clicks.mp3
return

delete::ExitApp

RSHIFT::Suspend

return

button:

LButton::
Loop
{
SetMouseDelay 37
Click
If (GetKeyState("LButton","P-")=0)
Break
}

return


I just need to know how to make it play a sound file when you hold down LButton
when ever I try to do it.
it says Duplicate Hotkey.
If you find any errors in the code please help me <3
User avatar
Spawnova
Posts: 557
Joined: 08 Jul 2015, 00:12
Contact:

Re: Autoclicker problem!

15 Apr 2017, 20:34

Code: Select all

SetMouseDelay 37
toggle := 0 ;off
Gui, Add, button, vbutton gbutton w150 h50, Toggle BHOP Script
Gui, show, w300 h100, Bhop Script
return

delete::ExitApp
RSHIFT::Suspend

f2:: ;can also use a keybind for toggle
button:
toggle := !toggle ;toggle on/off
if (toggle) ;optional sound play when toggled on 
	SoundPlay, c:\clicks.mp3
return

#if (toggle)  ;hotkey only works when toggled
~LButton::
SoundPlay, c:\clicks.mp3
while GetKeyState("LButton","P") {
	Click
	sleep 10
}
return
#if ;any hotkeys below now work regardless
~lbutton and lbutton are the same hotkey since ~ only works to not block the original click
buzk
Posts: 5
Joined: 15 Apr 2017, 18:43

Re: Autoclicker problem!

15 Apr 2017, 22:04

Spawnova wrote:

Code: Select all

SetMouseDelay 37
toggle := 0 ;off
Gui, Add, button, vbutton gbutton w150 h50, Toggle BHOP Script
Gui, show, w300 h100, Bhop Script
return

delete::ExitApp
RSHIFT::Suspend

f2:: ;can also use a keybind for toggle
button:
toggle := !toggle ;toggle on/off
if (toggle) ;optional sound play when toggled on 
	SoundPlay, c:\clicks.mp3
return

#if (toggle)  ;hotkey only works when toggled
~LButton::
SoundPlay, c:\clicks.mp3
while GetKeyState("LButton","P") {
	Click
	sleep 10
}
return
#if ;any hotkeys below now work regardless
~lbutton and lbutton are the same hotkey since ~ only works to not block the original click
I appreciate you helping, But one thing is wrong! I would like the sound to only play when I'm holding the leftmouse button.
ex: Hold down left click = play sound
KixenDK
Posts: 8
Joined: 24 Apr 2017, 18:05

Re: Autoclicker problem!

24 Apr 2017, 18:09

Code: Select all

Gui, show, w300 h100, Bhop Script

Gui, Add, button, vbutton gbutton w150 h50, Toggle BHOP Script


delete::ExitApp

RSHIFT::Suspend

return

button:

return

LButton::
GetKeyState, keystate, Lbutton,P
if keystate = D
	loop
	{
		SoundPlay, c:\clicks.mp3
		Click
		Sleep 37
	}
else
	Break

return
I don't know, if this will work or not.
Haven't tested it.
So ye... Test it out, and see if it works. :)

I'm still pretty new to this, there's a learning curve. :P
Hope it works.

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 57 guests