yea, it gets complicated with mousekeys. think i spend quite some time trying to fnd an optimal way to use both bottons w/o wasting it for just “move to”.
using this currently:
Rbutton::
setbatchlines, -1
if (stopped = 0) ;remarks here
{
send {blind}{shift up}
sleep, 120 ;cast gcd
send {blind}6 ;attack/spell
gosub, quickbar2_0 ;some attack/spell from bar2
}
startTime_RB := A_TickCount
KeyWait, Rbutton, U T0.3
PressDuration_RB := A_TickCount-startTime_RB
if (PressDuration_RB < 280) ;if the key was pressed down for less than 280ms just behave as normal
{
setbatchlines, 20ms
return ;
}
else
{
While (GetKeyState("RButton", "p") || GetKeyState("LButton", "p")) && !GetKeyState("SHIFT", "p")
{
send {blind}{a down} ;move to
}
send {blind}{a up}
}
setbatchlines, 20ms
return
since lbutton walk is annoying when the cursor hits an attackable object but you need to get out of a mess this one moves the char (a = bound to move ingame) after you keep/kept pressing R- or Lmouse for more than a configurable period. (for me 280 is quite ideal).
Its important to note, that the rbutton isnt hidden (even cant be hidden) from the game, so the first thing the game does when you press rbutton while the scrit is running, the game executes the stuff thats currently bound to rbutton (for me some attack/spell). then your other stuff form script gets processed
i had an other (better, aka flawlessly working move/attack/hold pos) solution for lbutton, but got in conflict when you worked in the ui, eg selling or moving items.
since im not aware yet of a proper detection of ingame situation (mho pixel/image search doesnt work in fullscreen) and direct memory reading is atm out of my scope, this one does quite well.
also had one of the sidebuttons as ‘f’ solution that forced the mousebutton to move, but just got myself stalled in messy situations because i couldnt decide with method to use - so i reduced it to this one method.
p.s did you get the capslock working in event mode?
p.p.s. if anyone has an idea for a reliable detection of ingame scenario (are ui elements open, or are we in combat, etc) id be glad to hear. my quite bold lowtech solution currently is to stop all fancy stuff in combination with casting portal (+ added ‘are we sure we want this’ delay because i hated it to accidently destroy an existing portal)