This is what i use when i want to process a stack of stone in my crafting tables, use with AutoIT
; hold middle mouse button to left click
; Shift+pause to terminate the script, pause key to pause it... no more RIP LMB
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("+{PAUSE}", "Terminate")
#Include <Misc.au3>
While 1
$end = 1
while _IsPressed(04)
;dont
mousedown("left")
mouseup("left")
sleep(100)
tooltip("clicking",0,0)
wend
tooltip("",0,0)
WEnd
Func TogglePause()
$Paused = NOT $Paused
While $Paused
sleep(100)
ToolTip('Script is "Paused"',0,0)
WEnd
ToolTip("")
EndFunc
Func Terminate()
Exit 0
EndFunc