function SendMouseClick()
sleep(1000)
mouse_event(MOUSEEVENTF_LEFTDOWN)
sleep(100)
mouse_event(MOUSEEVENTF_LEFTUP)
end
function toggleAutoClicker()
UDF1.lblStatus.Font.Color=0x00ff00
UDF1.lblStatus.Caption="[ON]"
SendMouseClick()
else
UDF1.lblStatus.Font.Color=0xff0011
UDF1.lblStatus.Caption="[OFF]"
-- Autoclicker Stop Code
end
end
if AutoClickHotkey and AutoClickHotkey.destroy then
AutoClickHotkey.destroy()
end
CEF is built-in code.
The current setting is one click per second.
Note: To slow down, write a high number in the box.
Enjoy it!
Code:
local f=createForm(true)
f.Position = poDesktopCenter
f.Width = 200
f.Height = 100
local e1=createEdit(f) e1.Left=85 e1.Top=38 e1.Width=45 e1.Text="1000"
local l1=createLabel(f) l1.Left=25 l1.Top=15 l1.caption="AutoClick (Start: F8 - Stop: F8)"
local l2=createLabel(f) l2.Left=88 l2.Top=64 l2.caption="Stop.."
if myhotkey then
myhotkey.Destroy()
myhotkey = nil
end
function killmytimer()
if mytimer then
mytimer.Destroy()
mytimer = nil
l2.caption="Stop.."
--showMessage("AutoClick Close")
end
end
myhotkey = createHotkey(function()
if mytimer then
killmytimer()
else
mytimer=createTimer()
mytimer.interval=e1.Text
mytimer.OnTimer=function()
l2.caption="Play.."
mouse_event(MOUSEEVENTF_LEFTDOWN)
mouse_event(MOUSEEVENTF_LEFTUP)
-- print("bla")
end
end
end, VK_F8)
Posted: Tue Apr 07, 2020 8:50 am Post subject: Re: Hotkey activating auto click
switch_switch = true
switch_switch2 = true
function switch2()
while switch_switch2 do
--Your code
sleep(500)--Reduce CPU usage
end
end
function switch()
if switch_switch then
switch_switch = false
switch_switch2 = true
createNativeThread(switch2)--Create thread
else
switch_switch = true
switch_switch2 = false
end
end
CEF is built-in code.
The current setting is one click per second.
Note: To slow down, write a high number in the box.
Enjoy it!
Code:
local f=createForm(true)
f.Position = poDesktopCenter
f.Width = 200
f.Height = 100
local e1=createEdit(f) e1.Left=85 e1.Top=38 e1.Width=45 e1.Text="1000"
local l1=createLabel(f) l1.Left=25 l1.Top=15 l1.caption="AutoClick (Start: F8 - Stop: F8)"
local l2=createLabel(f) l2.Left=88 l2.Top=64 l2.caption="Stop.."
if myhotkey then
myhotkey.Destroy()
myhotkey = nil
end
function killmytimer()
if mytimer then
mytimer.Destroy()
mytimer = nil
l2.caption="Stop.."
--showMessage("AutoClick Close")
end
end
myhotkey = createHotkey(function()
if mytimer then
killmytimer()
else
mytimer=createTimer()
mytimer.interval=e1.Text
mytimer.OnTimer=function()
l2.caption="Play.."
mouse_event(MOUSEEVENTF_LEFTDOWN)
mouse_event(MOUSEEVENTF_LEFTUP)
-- print("bla")
end
end
end, VK_F8)
thank you this worked perfect, but I was wondering if it would be possible to target the clicks inside my game instead of everywhere else on the pc. I only want to send mouse clicks every 1 second inside a game window
[ but I was wondering if it would be possible to target the clicks inside my game instead of everywhere else on the pc. I only want to send mouse clicks every 1 second inside a game window
Use findWindow() or getForegroundWindow() _________________
Stealing Code From Stolen Code...
And Admit It.. Hmmm....Typically LOL
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum