Page 1 of 1

Clicky-Do (Easy Autoclicker)

Posted: 20 Mar 2017, 17:09
by Masonjar13
Wrote up a quick, easy-to-use auto-clicker. All information can be found under "help" on the sysmenu of the script. Enjoy!

And yes, I'm quite aware how bad I am at designing user interfaces. Not particularly pretty, but it works.

Code: Select all

#singleInstance force
#persistent
#noEnv
detectHiddenWindows,on
interval:=100,iMax:=60000,iMin:=10,increment:=10,sMode:=1

gui,+hwndghwnd
gui,font,s12,arial
gui,color,ffffff
gui,add,text,section,Interval time (ms):
gui,add,button,xs section ginterval w40,-
gui,add,edit,ys section vinterval w80 number limit6 readonly,% interval
gui,add,button,ys section ginterval w40,+
gui,add,groupbox,w200 h200 xm,Other Options
gui,add,checkbox,vfreeze xp+20 yp+30,Freeze cursor
gui,add,groupbox,w100 h120 xp-15 yp+30,Send Method
gui,add,radio,vsMode xp+20 yp+30 checked -wrap,Input
gui,add,radio,-wrap,Event
gui,add,radio,-wrap,Play

gui,about:font,s12
gui,about:add,text,section,Coded by
gui,about:font,cBlue underline
gui,about:margin,5,9
gui,about:add,text,ys glink1,Masonjar13.
gui,about:font,norm s12
gui,about:add,button,gaboutGuiClose xm+4 w300,Ok

menu,sMenu,add,About,about
menu,sMenu,add,Help,help
gui,menu,sMenu

gui,show,,Clicky-Do
return

F4::gui,show,,Clicky-Do
F1::
gui,submit,nohide
if(mouseOverHwnd(ghwnd)){
    tool("No. Stop that.")
    return
}
t:=!t
if(freeze)
    blockInput,% "mousemove" . (t?"":"off")
setTimer,clicky,% t?"10":"off"
tool("Clicky-Do " . (t?"on (interval: " . interval . ")":"off") . (freeze?(t?"(frozen)":"(unfrozen)"):""))
return

*F2:: ;increment down
controlClick,button1,% "ahk_id " . ghwnd
tool("Interval: " . interval)
return

*F3:: ;increment up
controlClick,button2,% "ahk_id " . ghwnd
tool("Interval: " . interval)
return

interval:
mult:=0
mult+=getKeyState("Alt","P")?1000:0
mult+=getKeyState("Ctrl","P")?100:0
mult+=getKeyState("Shift","P")?10:0
mult:=mult?mult:1

guiControl,,interval,% a_guiControl="+"
    ?(interval>=iMax?interval:=iMax:interval:=(interval+increment*mult>iMax?iMax:interval+increment*mult))
    :(interval<=iMin?interval:=iMin:interval:=(interval-increment*mult<iMin?iMin:interval-increment*mult))
return

clicky:
loop % (interval-10)/10
{
    sleep 10
    if(!t)
        return
}
if(sMode=1)
    sendInput {click}
else if(sMode=2)
    sendEvent {click}
else if(sMode=3)
    sendPlay {click}
return

guiClose:
gui,submit
return

aboutGuiClose:
gui,about:cancel
return

about:
gui,about:show,,About
return

link1:
run,% "https://github.com/Masonjar13"
return

help:
msgbox,,Clicky-Do Help,Basic Info:`nSimple auto-clicker designed for ease of use. Minimum interval is 10ms, maximum interval is 60,000ms (one minute). Increment value is 10.`nIf you decide to modify the source, feel free to add your name/link to the About section, but please do not remove any names/links already present, thank you.`n`nModifiers:`nHolding one of the following keys and changing the interval value will multiply the increment value by the associated value. Multiplication values will stack.`n`n    • Alt - multiply increment by 1000`n    • Ctrl - multiply increment by 100`n    • Shift - multiply increment by 10`n`n`nHotkeys:`n    • F1 - start clicker`n    • F2 - decrease interval by increment`n    • F3 - increase interval by increment`n    • F4 - show GUI
return

mouseOverHwnd(hwnd){
    mouseGetPos,,,cHwnd
    return hwnd=cHwnd
}

;StdLib
tool(content,wait=2500,x="",y=""){
    tooltip,% content,% x,% y
    setTimer,tOff,% "-" wait
    return
    tOff:
    tooltip
    return
}
Download (exe, 32-bit)

Re: Clicky-Do (Easy Autoclicker)

Posted: 12 Jun 2020, 07:15
by simonthies
Is it possible to disable your Clicker? If for example you want to use the F1 key for something else?

Re: Clicky-Do (Easy Autoclicker)

Posted: 12 Jun 2020, 22:20
by Masonjar13
No, but you can add another hotkey (like F9 or something) to suspend the keys.

Code: Select all

F9::suspend