Ok. Attached is my code that changed with some sort of update.. no idea.
Here is my code:
$g::
SetKeyDelay, 30,
{
{
Send, {g Down}
sleep 60
Send, {g Up}
}
}
return
F2::Suspend
My problem is... It spams "g" in text editor.. but in game.. it like rapid fires it and it doesnt hold down for a split second. I can get it to work when I put the sleep to 80 and the setkeydelay to 80 as well... however.. it is to slow. When I lower it to 65 for both.. it rapid fires again and doesnt work.
If I take out SetKeyDelay, it doesnt work. I also tried SetKeyDelay 65, "duration", "play" -- "had numbers, etc"
If I take out sleep, it doesnt work.
I tried a loop, doesnt work.
Can anyone help me out?
My code no longer works.. weird
-
- Posts: 17
- Joined: 02 Dec 2016, 13:27
Re: My code no longer works.. weird
Remove the keydelay and divide the times like this:
Play with those times instead, because from Up to Down, there is no sleep time. Meaning, you are pressing immediately after the release.
Code: Select all
$g::
Send, {g Down}
sleep 40
Send, {g Up}
sleep 20
return
F2::Suspend
-
- Posts: 17
- Joined: 02 Dec 2016, 13:27
Re: My code no longer works.. weird
So it somewhat works.. when i put the g Down sleep to 180. However, that is way to slow. When I lower it below 160.. it just rapid fires it.Dumitas wrote: ↑31 Aug 2019, 00:31Remove the keydelay and divide the times like this:Play with those times instead, because from Up to Down, there is no sleep time. Meaning, you are pressing immediately after the release.Code: Select all
$g:: Send, {g Down} sleep 40 Send, {g Up} sleep 20 return F2::Suspend
The game I play on.. must have changed something. It worked really well and now it needs a bigger delay... but it isnt fast enough. Anything I can do?
-
- Posts: 17
- Joined: 02 Dec 2016, 13:27
Re: My code no longer works.. weird
Anyone have any ideas?
It's like.. as soon as I drop below a certain ms.... the game no longer registers that click. It just tap tap taps and it doesnt move as it should.
It's like.. as soon as I drop below a certain ms.... the game no longer registers that click. It just tap tap taps and it doesnt move as it should.
Re: My code no longer works.. weird
You need it to happen once? Can you explain what you need this script exactly for?
-
- Posts: 17
- Joined: 02 Dec 2016, 13:27
Re: My code no longer works.. weird
I play the game Scum. -- I dont need it to happen once. I need it to simulate that I am tapping "f". Dowwn, up, down up, down, up. But with some new patch, the script only works with a bigger delay... but.. that delay is to big, causing time to run out. The code you provided me, just simulates tapping, but doesnt register as if I am holding it down for a second.
Re: My code no longer works.. weird
It should work with a bigger delay because a second its 1000ms, you need to increase the Sleep time.
-
- Posts: 17
- Joined: 02 Dec 2016, 13:27
Re: My code no longer works.. weird
I understand.. if I do it manually by hand.. it equates to about 250ms.. give or take. When I put it into the script.. it doesnt respond the way I need it to. I have 4 seconds to complete an action. The delay is too long. When I had it at ~60ms, it was perfect, until new update.
-
- Posts: 17
- Joined: 02 Dec 2016, 13:27
Re: My code no longer works.. weird
SendInput
SendInput is generally the preferred method to send keystrokes and mouse clicks because of its superior speed and reliability
If that's the game somehow blocking that, try to compile it.
SendInput is generally the preferred method to send keystrokes and mouse clicks because of its superior speed and reliability
If that's the game somehow blocking that, try to compile it.
-
- Posts: 17
- Joined: 02 Dec 2016, 13:27
Re: My code no longer works.. weird
I feel crappy asking.. but I dont even know where to start writing a SendInput script. Anyway you can write me a g Down, g Up? or is it just that simple?
$g::
SendInput {g Down}
Sleep 80
Return
Something of that nature?
Re: My code no longer works.. weird
Just replace the Send for SendInput.
-
- Posts: 17
- Joined: 02 Dec 2016, 13:27
Re: My code no longer works.. weird
Yes, and with less brackets, not mandatory but unnecessary.
Who is online
Users browsing this forum: Google [Bot] and 60 guests