AutoClicker with Config

Post gaming related scripts
Nocrno
Posts: 3
Joined: 06 Jan 2016, 14:58
Contact:

AutoClicker with Config

20 Jun 2016, 12:22

This is the first program I've made to distribute, so feedback is appreciated.

AutoClicker

Github repository: https://github.com/Nocrno/auto-clicker-display
The repository has a normal and a compiled version if you need that.

README:
Image

Code:

Code: Select all

#NoEnv
#SingleInstance Force
SendMode Input
SetWorkingDir %A_ScriptDir%
;------------------------------------------------------------------------------------------------------------
;Vars
Sure = 0
;------------------------------------------------------------------------------------------------------------
Gui, Font, S25 CRed, Arial
Gui, Add, Text, x0 y0 w100 h42 vShowKey gMove +Border +Center, Hello!
Gui, -Caption +Border +AlwaysOnTop
Gui, Show, x0 y0 w100 h42, AutoClicker
;          x910 
;------------------------------------------------------------------------------------------------------------
;Config

Gui, Config:Font,, Arial
Gui, Config:Add, Edit, x8 y32 w539 h21 vBind, Key Name
Gui, Config:Add, Button, x548 y32 w75 h21 vButtonFirm gConfirm, Confirm
Gui, Config:Add, Text, x8 y8 w325 h23 +0x200, Type in the key you want to have the autoclick bound to below`, use:
Gui, Config:Add, Text, x-24 y64 w869 h2 0x10
Gui, Config:Add, Link, x342 y12 w200 h20, <a href="https://autohotkey.com/docs/KeyList.htm">https://autohotkey.com/docs/KeyList.htm</a>
Gui, Config:Add, Text, x552 y8 w78 h23 +0x200, For key names
Gui, Config:Add, Slider, x8 y136 w615 h32 vTime, 50
Gui, Config:Add, Text, x544 y112 w80 h23 +0x200, 200 ms`, 5 CPS
Gui, Config:Add, Text, x13 y112 w80 h23 +0x200, 0 ms`, Sonic
Gui, Config:Add, Text, x280 y112 w86 h23 +0x200, 100 ms`, 10 CPS
Gui, Config:Add, Text, x8 y80 w120 h23 +0x200, Click Speed
Gui, Config:Font
Gui, Config:Show, w634 h178, Auto Clicker Config
Return

ConfigGuiClose:
ExitApp
return

Confirm:
if (Sure = 1) {
	HotKey, *%Bind%, Rapid, Off
}
GuiControlGet, Bind
Hotkey, *%Bind%, Rapid, On
Sure = 1
Return
return

Move:
PostMessage, 0xA1, 2,,, A
return

Rapid:
GuiControlGet, Time, Config:
if  (Time != 0) {
	Time:=Time*2
	Topp:=Time+5
	Bot:=Time-50
	while GetKeyState(Bind, "P") {
		if (lkey = 1) {
			Random ran, %Bot%, %Topp%
			Click
			Sleep %ran%
		} else if (lkey = 0) {
			Random ran, %Bot%, %Topp%
			Click Right
			Sleep %ran%
		}
	}
} else {
	while GetKeyState(Bind, "P") {
		if (lkey = 1) {
			Click
		} else if (lkey = 0) {
			Click Right
		}
	}
}
return

;------------------------------------------------------------------------------------------------------------
;Binds

~*Left::
lkey = 1
GuiControl,, ShowKey, Left
return

~*Right::
lkey = 0
GuiControl,, ShowKey, Right
return

~*Down::
Gui, Hide
return

~*Up::
Gui, Show
return

^-::
GuiControl,, ShowKey, Bye.
sleep 500
GuiControl,, ShowKey, Bye..
sleep 500
GuiControl,, ShowKey, Bye...
sleep 500
ExitApp
return
;------------------------------------------------------------------------------------------------------------
Attachments
AutoClicker.ahk
AHK Version
(2.68 KiB) Downloaded 357 times
User avatar
SnowFlake
Posts: 368
Joined: 28 Apr 2015, 05:41
Contact:

Re: AutoClicker with Config

20 Jun 2016, 13:11

Hey

i made some updates:

Code: Select all

#NoEnv
#SingleInstance Force
SendMode Input
SetWorkingDir %A_ScriptDir%
;------------------------------------------------------------------------------------------------------------
;Vars
Sure = 0
;------------------------------------------------------------------------------------------------------------
Gui, Font, S25 CRed, Arial
Gui, Add, Text, x0 y0 w100 h42 vShowKey gMove +Border +Center, Hello!
Gui, -Caption +Border +AlwaysOnTop
Gui, Show, x0 y0 w100 h42, AutoClicker
;          x910 
;------------------------------------------------------------------------------------------------------------
;Config

Gui, Config:Font,, Arial
Gui, Config:Add, Hotkey, x8 y32 w539 h21 vBind, Key Name
Gui, Config:Add, Button, x548 y32 w75 h21 vButtonFirm gConfirm, Confirm
Gui, Config:Add, Text, x8 y8 w325 h23 +0x200, Type in the key you want to have the autoclick bound to below`, use:
Gui, Config:Add, Text, x-24 y64 w869 h2 0x10
Gui, Config:Add, Link, x342 y12 w200 h20, <a href="https://autohotkey.com/docs/KeyList.htm">https://autohotkey.com/docs/KeyList.htm</a>
Gui, Config:Add, Text, x552 y8 w78 h23 +0x200, For key names
Gui, Config:Add, Slider, x8 y136 w615 h32 gslider vTime Range0-200, 100
Gui, Config:Add, Text, x544 y112 w80 h23 +0x200, 200 ms`, 5 CPS
Gui, Config:Add, Text, x13 y112 w80 h23 +0x200, 0 ms`, Sonic
Gui, Config:Add, Text, x280 y90 w86 h23 +0x200, 100 ms`, 10 CPS
Gui, Config:Add, Text, x280 y112 w86 h23 +0x200 vslid,ms: 100
Gui, Config:Add, Text, x8 y80 w120 h23 +0x200, Click Speed
Gui, Config:Font
Gui, Config:Show, w634 h178, Auto Clicker Config


GuiControl,,slid,ms: 100
Return

ConfigGuiClose:
ExitApp
return

slider:

GuiControlGet, Time
GuiControl,,slid,ms: %time%

return

Confirm:
if (Sure = 1) {
	HotKey, *%Bind%, Rapid, Off
}
GuiControlGet, Bind
Hotkey, *%Bind%, Rapid, On
Sure = 1
Return
return

Move:
PostMessage, 0xA1, 2,,, A
return

Rapid:
GuiControlGet, Time, Config:
if  (Time != 0) {
	Time:=Time*2
	Topp:=Time+5
	Bot:=Time-50
	while GetKeyState(Bind, "P") {
		if (lkey = 1) {
			Random ran, %Bot%, %Topp%
			Click
			Sleep %ran%
		} else if (lkey = 0) {
			Random ran, %Bot%, %Topp%
			Click Right
			Sleep %ran%
		}
	}
} else {
	while GetKeyState(Bind, "P") {
		if (lkey = 1) {
			Click
		} else if (lkey = 0) {
			Click Right
		}
	}
}
return

;------------------------------------------------------------------------------------------------------------
;Binds

~*Left::
lkey = 1
GuiControl,, ShowKey, Left
return

~*Right::
lkey = 0
GuiControl,, ShowKey, Right
return

~*Down::
Gui, Hide
return

~*Up::
Gui, Show
return

^-::
GuiControl,, ShowKey, Bye.
sleep 500
GuiControl,, ShowKey, Bye..
sleep 500
GuiControl,, ShowKey, Bye...
sleep 500
ExitApp
return
;------------------------------------------------------------------------------------------------------------
:yawn:

Return to “Gaming Scripts (v1)”

Who is online

Users browsing this forum: No registered users and 72 guests