Need Help: Bind Mouse Right Click hold and movement to arrow keys to move like a pc moba

Ask gaming related questions (AHK v1.1 and older)
phalanxdarken
Posts: 5
Joined: 02 Jan 2022, 16:11

Need Help: Bind Mouse Right Click hold and movement to arrow keys to move like a pc moba

26 Apr 2024, 17:05

Hi to all, the most close script that I found was the one below, but the problem with it is that it works in an activation behaviour meanwhile I want a script that works in a hold mouse button behaviour. In MOBAS such as League of Legends for example player moves into XY coordinates using the mouse movement and only when RButton is pressed and hold (not a single click). In this case I want exactly that but binding it to the arrow keys of my keyboard and of course diagonal directions must work too being the 8 directions: up, upright, right, rightdown, down, downleft, left, left up. The game Iam currently trying to play with the desired script is DIABLO 3 for switch emulator Ryujinx. I tried using VJOY and some other scripts but nothing works as expected. I don't need any alerts to appear in screen, neither a 4 direction script instead of 8, it is not neccesary to have an activation command because the script shall only work when RButton of mouse is pressed. Please if you can help me I will try your script asap and btw other internet players eventually will find this post useful.

Here is the "most close" script that I mentioned:

Code: Select all

SendMode Input
CoordMode Mouse
CoordMode ToolTip

k:= 50   ; mouse sensitivity in pixels
  
^a::     ; Ctrl-a to start/stop
  MouseGetPos x0,y0
  SetTimer Track, % (t:=!t)? "100" : "Off"
  Tooltip
  return

Track:
  MouseGetPos x,y
  dx:= (x-x0)//k, dy:= (y-y0)//k
  If dx>0
      Send {Blind}{Right down}
  else If GetKeyState("Right")
      Send {Blind}{Right up}
  If dx<0
      Send {Blind}{Left down}
  else If GetKeyState("Left")
      Send {Blind}{Left up}
  If dy>0
      Send {Blind}{Down down}
  else If GetKeyState("Down")
      Send {Blind}{Down up}
  If dy<0
      Send {Blind}{Up down}
  else If GetKeyState("Up")
      Send {Blind}{Up up}
  Tooltip Ctrl-a`nto stop , x0-20, y0-20
  return
Thnaks in advance, my mail is "michaelreyk@gmail.com"

Return to “Gaming Help (v1)”

Who is online

Users browsing this forum: No registered users and 36 guests