Better way to bind mousewheel (autohotkey)

vartijavartija Join Date: 2007-03-02 Member: 60193Members, Constellation, Reinforced - Onos, WC 2013 - Shadow
edited April 2014 in Technical Support
NS2 now allows you to bind Jump to your mousewheel (or at least up or down). This is for people like me who don't like spamming spacebar. The problem is if you want to lerk or use jetpack you have to rebind your Jump back to space. This was not really problem for me until I started lerking a bit in pcws.

My solution was to use autohotkey. For me it remaps my mousewheelup and down to Space. The program can be downloaded here http://www.autohotkey.com/

Now I needed to create script to map my keys. After googling and reading tutorial I ended up making following script

AutoHotkey.ahk
SendMode Input

delay := 125 ;small delay after pressing a button

; Normal mousewheel jump
WheelDown::
Send {Blind}{Space Down}
Sleep, %delay%
WheelDown up::
;SetKeyDelay -1
Send {Blind}{Space up}
return

WheelUp::
Send {Blind}{Space Down}
Sleep, %delay%
WheelUp up::
Send {Blind}{Space up}
return

; With ctrl pressed
^WheelDown::
Send {Blind}^{Space Down}
Sleep, %delay%
^WheelDown up::
Send {Blind}^{Space up}
return

^WheelUp::
Send {Blind}^{Space Down}
Sleep, %delay% 
^WheelUp up::
Send {Blind}^{Space up}
return


; With shift pressed
+WheelDown::
Send {Blind}+{Space Down}
Sleep, %delay%
+WheelDown up::
Send {Blind}+{Space up}
return

+WheelUp::
Send {Blind}+{Space Down}
Sleep, %delay%
+WheelUp up::
Send {Blind}+{Space up}
return
This has been added to autohotkey autorun file. I added a small delay to make the mousewheel feel less spammy. (Sleep, 50)

To make my life little easier, I created windows batch file (for windows 7) because at the moment I'm not using autohotkey with any other application. The file is located in my NS2 folder and I have shortcut created to it at my desktop.

ns2.cmd
Start "" "C:\Program Files\AutoHotKey\AutoHotKey.exe"
Start /wait /high NS2.exe
taskkill /IM AutoHotkey.exe

The batch file runs autohotkey, runs ns2(high priority), waits until ns2 exits and then kills autohotkey.

VAC and punkbuster?
Autohotkey is on list of VAC safe apps for scripting. I read punkbuster may ban you though. Since I no longer play battlefield I have no interest to look if you get banned simply having it installed or running it. If latter and you use the batch script this should not be a problem.
http://forums.steampowered.com/forums/showthread.php?t=1906399

gl hf

Comments

  • RegnarebRegnareb Join Date: 2007-08-26 Member: 62008Members, NS2 Playtester
    edited March 2014
    Are you aware that you do not need to spam the spacebar to jump with the jump queue, and that it could even be detrimental to you if you spam it?
    I know that it's something that is quite different than the old way and can be weird at the very beginning but you get used to it very fast in NS2.
    And if you are aware of it, then this post if for people that will read the OP.

    I have no idea about punkbuster, but I think Autohotkey is safe to use.
  • vartijavartija Join Date: 2007-03-02 Member: 60193Members, Constellation, Reinforced - Onos, WC 2013 - Shadow
    Regnareb wrote: »
    Are you aware that you do not need to spam the spacebar to jump with the jump queue, and that it could even be detrimental to you if you spam it?
    I know that it's something that is quite different than the old way and can be weird at the very beginning but you get used to it very fast in NS2.
    And if you are aware of it, then this post if for people that will read the OP.

    I have no idea about punkbuster, but I think Autohotkey is safe to use.

    That's how I had to do it until build263. During that time I noticed it was still better to hit space twice when getting speed from wall. Also I ended up missing some critical jumps in stupid spots even after using it since beta. You have no idea how happy I was when b263 was released. After that there was no going back. Thus why I used the effort to make this. It might also be my ns1 background that is not letting me go.
  • vartijavartija Join Date: 2007-03-02 Member: 60193Members, Constellation, Reinforced - Onos, WC 2013 - Shadow
    Updated the script to work when ctrl and shift are pressed while jumping. Didn't see this until actually fading again after a while :P
Sign In or Register to comment.