issue with doing it again while holding key Topic is solved

Ask gaming related questions (AHK v1.1 and older)
violin shooter
Posts: 2
Joined: 25 Nov 2021, 10:32

issue with doing it again while holding key

Post by violin shooter » 25 Nov 2021, 10:42

Hello friends, i have an autohotkey code which drags items from a backpack to another in my game. When I hold the key pressed, the code performs great but it repeats the action a bit slowly, like with a cooldown of about 200ms or so. I would like it to re-engage with no cooldown once he finishes what he is supposed to do which is drag the item from one part to another. Thank you very much in advance

https://ibb.co/VLs0rmh this is how it works, i would like it to get to destiny, comeback and start again all faster.
I already tried changing the mouse delay and the sleep but doesn't work

Code: Select all

PgUp::  ;Inventory position

MouseGetPos, InvX,InvY

return

PgDn::  ; Puxes Loot
SetMouseDelay,1
Mousegetpos,ItemX,ItemY
;sleep  1
MouseClickDrag, Left, %itemX%, %ItemY%, %InvX%, %Invy%
;sleep  1
MouseMove, %ItemX%, %ItemY%
;Sleep  1
return

Rohwedder
Posts: 7551
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: issue with doing it again while holding key  Topic is solved

Post by Rohwedder » 26 Nov 2021, 06:26

Hallo,
perhaps?:

Code: Select all

PgUp::  ;Inventory position
MouseGetPos, InvX,InvY
return
PgDn::  ; Puxes Loot
SetMouseDelay,1
Mousegetpos,ItemX,ItemY
;sleep  1
While, GetKeyState("PgDn","P")
{
	MouseClickDrag, Left, %itemX%, %ItemY%, %InvX%, %Invy%
	;sleep  1
	MouseMove, %ItemX%, %ItemY%, 1
	;Sleep  1
}
return

violin shooter
Posts: 2
Joined: 25 Nov 2021, 10:32

Re: issue with doing it again while holding key

Post by violin shooter » 26 Nov 2021, 15:30

@Rohwedder
Wow yes, that works much faster. Thanks for your contribution man I appreciate it

Post Reply

Return to “Gaming Help (v1)”