I'm do the efforts to push a button (1) every 30s yet when I push X myself I desire it to reset the interior timer
I currently use an additional button (b) come start/stop the loop itself and also the initial loop ns have currently figured out yet I can't for the life of me uncover a method to reset the sleep..
You are watching: How to make your computer press a key every x seconds
toggle = 0#MaxThreadsPerHotkey 2b::Toggle := !ToggleWhile ToggleSend 1sleep 30000return
I'd imply using SetTimer instead of looping through sleeps. SetTimer works good for this kind of stuff.
I produced this password by using your words and adding the needed regulates to them.
; I'm trying to push a button (1) every 30sSetTimer, Press1, 30000return; I'm trying to push a switch (1)Press1:SendInput, 1return; once I push Xx::; I want it come reset the internal timerSetTimer, Press1, 30000returnThis works precisely as friend described. Here's the code included with a b hotkey toggle:
Edit: added correct time to an initial settimer.
See more: Arbor Adapter 1/2 To 5/8 - Plastic Adapter, 5/8 To 1/2 Arbor Hole
toggle:= 0returnb::toggle:= !toggleif (toggle = 1)SetTimer, Press1, 30000elseSetTimer, Press1, OffreturnPress1:SendInput, 1returnx::SetTimer, Press1, 30000
Op · 4y
Wow! many thanks for the quick reply
Here is mine autoclicker duty that you have the right to toggle (activate/deactivate) with a an essential and you can also add other secrets to change the interval, for example. Friend can include logic to incrementally speed it up or sluggish it down, etc. It's all self-contained so girlfriend don't require to worry about worldwide variables and also such.
you can't \"reset the sleep\". Usage a timer instead: https://www.autohotkey.com/docs/commands/SetTimer.htm
More posts from the AutoHotkey community
Continue searching in r/AutoHotkey
This is a location to get assist with AHK, programming logic, syntax, design, to get feedback, or just to rubber duck. Over there is zero yongin for incivility towards others or because that PvP cheaters. Be certain you check out the rules, read the sticky, keep your AHK up to date, be clear about what you need help with, and never be fear to post. We're all below to one of two people teach or be taught, so be good to each other. Ns wish you all the best. ~GroggyOtter
Created Apr 15, 2010
Top articles october 27th 2017Top write-ups of october, 2017Top write-ups 2017
helpsurfacetoairnewyork.com coinssurfacetoairnewyork.com premiumsurfacetoairnewyork.com gifts
Back to Top