Help with a script Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Marcello

Help with a script  Topic is solved

18 Aug 2018, 14:52

Hello! I want to make a script so while I hold down Space key: Hold down Space key and Press Left key at the start and every 800 milliseconds. This 2 actions until I release the Space Key.

I tried to do this scrip but I failed at making the Space key hold as long as I hold my space key and to spam the Left key every 800 milliseconds. I did a While-Loop with sleep time but I don't want my space key to be hold up and down again after the sleep time, just the Left key. For making the loop to break after I release my Space key I did a simple 'if not GetKeyState("Space", "P") break' but the sleep time prevented me from casting the loop again instantly if I release it too soon. I don't think it's to complicated so if anyone manage to do it it would be appreciated, thanks!

I'm quite new to this so sorry if it sound too simple.
Marcello

Re: Help with a script

18 Aug 2018, 21:11

$Space::
SendInput, {Space Down}
While GetKeyState("Space","P")
{
SendInput, {Left}
Sleep 800
}
Return
$Space Up::
SendInput, {Space Up}
Return


This is what I got so far. I'm just missing a way to cancel the Sleep when I release the Space Key since it prevents me from doing the script again.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: mikeyww, Oblomov228, PsysimSV, uchihito and 166 guests