Auto Hot Keys for Empyrion

Discussion in 'General Discussion' started by dichebach, Jun 19, 2018.

  1. dichebach

    dichebach Captain

    Joined:
    Oct 26, 2016
    Messages:
    431
    Likes Received:
    495
    I got tired of constantly holding down "W" for forward, and left mouse button for primary action. So I wrote up some autohotkey scripts.

    It is a free app https://www.autohotkey.com/ and there are a lot of online resources to help.

    Here is the code:
    Code:
    ; Hotkeys for use with Empyrion Galactic Survival
    ; this is a comment in AHK syntax
    ;
    ;----Auto Move Forward Press Ctrl + Alt + W------
    *^!w::Send % (toggle := !toggle) ? "{W Down}" : "{W Up}"
    ; Ctrl+Alt+W toggles state of the W key between down and up
    
    ;----Auto fire Primary (gun, miner, whatever) Press Ctrl + /------
    *^/::Send % (toggle := !toggle) ? "{/ Down}" : "{/ Up}"
    ; Ctrl+/ toggles state of the / key between down and up
    ; Note, in order for this one to work, you must set the / key (called "Division" key in some sources)
    ; to be a primary key bind for "Primary Action" in your Empyrion Settings\Controls
    ; you could use any other free key, that was the best I could come up with
    
    ;----Auto edge forward slowly Press Control + l-----
    *^l::SetTimer, SpamKey, % (toggle := !toggle) ? 1500 : "Off"
    SpamKey:
        Send, w
    return
    ; What this one does is, it repeatedly "presses" the W (forward) key at 1500 millisecond
    ; intervals between each press of "w"
    ; useful if you are tunneling though 1500 is still a bit too slow for your guy to keep up with a 
    ;T2 drill. You'll want to periodically advance him a bit by manually pressing W
    
    To use:
    1. Download and install autohotkey app
    2. Open a text file
    3. Paste the code above into it.
    4. Save the file to your desktop or wherever you can find it easily. Make sure to assign it the suffix .ahk (instead of .txt), but other than that any name is fine. For example: "EGS.ahk"
    5. right-click and "Run" the ahk file before you want to use the hotkeys (before or during the game running is fine).
    6. Use the key strokes described in the comments to activate a hot key. Repeat them to deactivate a hot key.
     
    #1
  2. PaulBM

    PaulBM Ensign

    Joined:
    May 20, 2018
    Messages:
    1
    Likes Received:
    1
    Nice one.

    I agree we need a Run key in this game. I remember using NumLock to 'run' in World of Warcraft & Everquest. I also wondered about using VoiceAttack to toggle W.
     
    #2
    dichebach likes this.
  3. Frigidman

    Frigidman Rear Admiral

    Joined:
    Mar 19, 2016
    Messages:
    2,280
    Likes Received:
    3,715
    *shakes cane*

    You kids and your weak flimsy fingers... why back in my day our keys were made out of stone and the sandpaper like surface would run us raw by the end of a deathmatch king of the hill tourny! ...

    ... cant hold down W for too long ...

    ... rassafrakkin ...
     
    #3
  4. dichebach

    dichebach Captain

    Joined:
    Oct 26, 2016
    Messages:
    431
    Likes Received:
    495
    I think for "Primary Attack," if they were to map a default "toggle primary attack" function into the game, using a combination of left mouse click and some other key (like right alt) would be the best. This would especially be neat if tapping left mouse button again deactivated the toggle.
     
    #4
  5. Myrmidon

    Myrmidon Rear Admiral

    Joined:
    Mar 26, 2016
    Messages:
    1,731
    Likes Received:
    2,059
    Strange thing. I tested the AHK with your script then started to do my own edits. I assigned as primary both on Empyrion and script the Z key but even if I reload the script after saving it of course and reloading the game the ctrl + / remains as primary toggle for the continuous primary fire etc.In game if I press simple z it fires as primary but, then tested on a text file and when I press ctrl + / it types Z. Has something to do with the fact that in windows ctrl + z is undo!!!
     
    #5
  6. SilvRav

    SilvRav Moderator

    • Moderator
    Joined:
    Jan 13, 2017
    Messages:
    539
    Likes Received:
    882
    Kids of today dont understand the struggle was real :p
     
    #6
  7. dichebach

    dichebach Captain

    Joined:
    Oct 26, 2016
    Messages:
    431
    Likes Received:
    495
    Did you try rebooting? :p

    Keep in mind, there are two columns for assigning for each key function. It might have to do with that?
     
    #7
  8. Myrmidon

    Myrmidon Rear Admiral

    Joined:
    Mar 26, 2016
    Messages:
    1,731
    Likes Received:
    2,059
    I had assigned the same key to both columns....and why reboot? Does not make any sense.
     
    #8
    dichebach likes this.
  9. dichebach

    dichebach Captain

    Joined:
    Oct 26, 2016
    Messages:
    431
    Likes Received:
    495
    Ah I was just making an obscure reference to standard Tech Support scripts: did you reboot
     
    #9
    Sofianinho likes this.
  10. Zaflis

    Zaflis Commander

    Joined:
    Sep 15, 2017
    Messages:
    87
    Likes Received:
    65
    It's not about fingers, but it's about keyboard. And thus it's an issue about money i don't want to keep spending on new ones every so often. Key not occasionally registering when pressing down is 1 of the worst things that can happen to you, while it would be SO easy for devs to fix.
     
    #10
    dichebach likes this.
  11. Frigidman

    Frigidman Rear Admiral

    Joined:
    Mar 19, 2016
    Messages:
    2,280
    Likes Received:
    3,715
    Clearly sarcasm is lost on this individual.

    Here's your Trophy for participating!
     
    #11
    dichebach likes this.
  12. Zaflis

    Zaflis Commander

    Joined:
    Sep 15, 2017
    Messages:
    87
    Likes Received:
    65
    Sorry but it's irrelevant if it was sarcasm or not. This thread wasn't meant as a joke, we are very serious about this feature needing to be added. Making jokes has a side-effect of making a thread less believable, and thus easier to skip.
     
    #12
    ZipSnipe likes this.
  13. ZipSnipe

    ZipSnipe Commander

    Joined:
    May 19, 2016
    Messages:
    113
    Likes Received:
    47
    I have AutoHotkey and have been using it up till 8.0. It stopped working and I did read in the 8.0 update notes which I can't seem to locate that they did something which would mess up hot keys.

    Actually I just reread your post. My AutoHotkey was setup for my mouse so I wouldn't have to hold the mouse buttons while drilling so a lil different

    So you are using that now in 8.0?
     
    #13
  14. zaphodikus

    zaphodikus Captain

    Joined:
    Oct 1, 2016
    Messages:
    471
    Likes Received:
    227
    In AHK version 2, this macro works to for example hold down the fire (left) mouse button for you every time you tap the Rightmost CTRL key.
    Code:
    *RCtrl::
    SetMouseDelay -1
    if not GetKeyState("LButton")  ; i.e. the left mouse button isn't down yet.
        Send {Blind}{LButton DownR}
    else
        Send {Blind}{LButton Up}
    return
    
    It conveniently lets go of the mouse if you just naturally tap the mouse button again.

    Sorry I'm 2 years late though.
     
    #14

Share This Page