Jump to content

Would Anyone Mind Helping Me With An Ahk Script?


3 replies to this topic

#1 Makenzie71

    Member

  • PipPipPipPipPipPipPip
  • Big Daddy
  • Big Daddy
  • 938 posts
  • Location"I don't like your loadout...you must have no idea what you're doing." ~This forum

Posted 16 May 2017 - 05:51 PM


I have no idea how to script and, honestly, trying to figure autohotkey out AND the skill tree is breaking my brain at the moment.




I want the left mouse button to cycle through keys 2, 3, and 1 (in that order) and the right mouse button to cycle through keys 5, 6, and 4 (also in that order).




I want the cycle rate to be four clicks per second.




I want the left control key to activate this macro.




Thanks, so much, in advance!


#2 Makenzie71

    Member

  • PipPipPipPipPipPipPip
  • Big Daddy
  • Big Daddy
  • 938 posts
  • Location"I don't like your loadout...you must have no idea what you're doing." ~This forum

Posted 17 May 2017 - 04:09 AM

Okay I got this code form a member of Reddit, but it doesn't seem to work in the game. How do I get the macros to work in MWO?

; Only one instance of the script can run at a time.
#SingleInstance, Force
; Time (in ms) to wait between each key send.
delay   := 150
; Left button cycle order
lbo	 := [2,3,1]
; Right button cycle order
rbo	 := [5,6,4]
; Tracks left and right clicks
lc	  := 1
rc	  := 1
return
; Hotkeys will only work if control is being held down.
#If GetKeyState("Control", "P")
; Left Mouse Hotkey
*LButton::
    while GetKeyState("LButton", "P"){
	    ; Cycles through lbo array
	    SendInput, % lbo[lc]
	    ; Increment each click so the next item in the array will be sent
	    lc++
	    ; If the amount of clicks exceeds the amount of elements in lbo...
	    if (lc > lbo.Length())
		    ; ...reset clicks to 1
		    lc := 1
	    ; Put a 25ms pause between key strokes.
	    ; You may need to increase this.
	    Sleep, % delay
	    }
return
*RButton::
    while GetKeyState("RButton", "P"){
	    SendInput, % rbo[rc]
	    rc++
	    if (rc > rbo.Length())
		    rc := 1
	    Sleep, % delay
    }
return


#3 Daggett

    Member

  • PipPipPipPipPipPipPipPip
  • Philanthropist
  • Philanthropist
  • 1,244 posts
  • Google+: Link
  • LocationGermany

Posted 17 May 2017 - 04:16 AM

This is what you need if you don't want to struggle with AHK by yourself:
https://mwomercs.com...-30th-jan-2017/

It's based on AHK but already solved (hopefully) all your problems and let's you setup your macro without scripting. To use both mouse buttons you probably need to run two instances of the tool, one for each mouse button.

#4 Makenzie71

    Member

  • PipPipPipPipPipPipPip
  • Big Daddy
  • Big Daddy
  • 938 posts
  • Location"I don't like your loadout...you must have no idea what you're doing." ~This forum

Posted 17 May 2017 - 04:37 AM

Thanks! That at least gets the firing pattern I want immediately and appears to have the option to actually tune it.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users