View previous topic :: View next topic |
Author |
Message |
Twistedfate Expert Cheater Reputation: 1
Joined: 11 Mar 2016 Posts: 231
|
Posted: Tue Oct 25, 2016 1:54 pm Post subject: how to loop this code? |
|
|
Code: | if myhotkey then
myhotkey.Destroy()
myhotkey = nil
end
myhotkey = createHotkey(function()
mouse_event(MOUSEEVENTF_RIGHTDOWN)
mouse_event(MOUSEEVENTF_RIGHTUP)
end, VK_CONTROL)
|
*I am beginner in LUA I want to press CONTROL once and the script run like c.licker continuously press x key the script disabled .
* Is that possible to speed up mouse clicks ?
|
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Tue Oct 25, 2016 4:34 pm Post subject: |
|
|
If you only want it to execute once, what exactly are you trying to speed up?
Code: | if myhotkey then
myhotkey.Destroy()
myhotkey = nil
end
myhotkey = createHotkey(function()
local time = os.time()
if last_execute ~= time then
mouse_event(MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP)
last_execute = time
end
end, VK_CONTROL) |
|
|
Back to top |
|
|
Twistedfate Expert Cheater Reputation: 1
Joined: 11 Mar 2016 Posts: 231
|
Posted: Tue Oct 25, 2016 5:23 pm Post subject: |
|
|
I dont want to execute clicks one time ^^
I want to press CONTROL one time and right clicks run infinity
when I press CONTROL again clicks stop .
I want to speed up clicks like click every one ml second (ms)
and thank you
|
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25288 Location: The netherlands
|
Posted: Tue Oct 25, 2016 5:28 pm Post subject: |
|
|
Code: |
if myhotkey then
myhotkey.Destroy()
myhotkey = nil
end
function killmytimer()
if mytimer then
mytimer.Destroy()
mytimer = nil
end
end
myhotkey = createHotkey(function()
if mytimer then
killmytimer()
else
mytimer=createTimer()
mytimer.interval=1
mytimer.OnTimer=function()
--mouse_event(MOUSEEVENTF_RIGHTDOWN)
--mouse_event(MOUSEEVENTF_RIGHTUP)
print("bla")
end
end
end, VK_CONTROL)
|
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Zanzer I post too much Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Tue Oct 25, 2016 5:31 pm Post subject: |
|
|
Code: | if mytimer == nil then
mytimer = createTimer(nil, false)
end
mytimer.OnTimer = function(timer)
mouse_event(MOUSEEVENTF_RIGHTDOWN | MOUSEEVENTF_RIGHTUP)
end
mytimer.Interval = 1
if myhotkey then
myhotkey.Destroy()
end
myhotkey = createHotkey(function()
mytimer.Enabled = not mytimer.Enabled
end, VK_CONTROL) |
|
|
Back to top |
|
|
Twistedfate Expert Cheater Reputation: 1
Joined: 11 Mar 2016 Posts: 231
|
Posted: Tue Oct 25, 2016 5:33 pm Post subject: |
|
|
Wow thanks DB and zanzer work like Charm ^_*
mytimer.interval=1
I didnot think in this function ty ty ty
|
|
Back to top |
|
|
|