1. Please be advised of a few specific rules and guidelines for this section.

RELEASED [Tool] AHK Zombie Process Killer

Discussion in 'Other' started by Supergeek, Dec 9, 2013.

  1. Supergeek

    Supergeek Scruffy Nerf-Herder

    This is a simple AutoHotKey script that will allow you to see at a glance if Starbound.exe is still running in case of a crash. If it is, you can just click the button to kill the process instead of hitting Ctrl+Alt+Del and selecting the process and killing it manually.

    *Note: This is Windows-specific. You could probably write a script to do this easily under Linux and I don't know MacOS.

    Code:
    ; Starbound Zombie Killer
    ; by Neurisko / Supergeek
    ; Indicate if Starbound is running, and kill it by pushing a button.
    
    Gui, +Alwaysontop +Toolwindow
    Gui, Show, W200 H50, Starbound Zombie Killer
    Gui, Add, Button, gKillStarbound, Kill Starbound
    
    Loop
    {
            Process, Exist, starbound.exe ; check to see if starbound.exe is running
            If (ErrorLevel = 0) ; If it is not running
        {
                    Gui, Color, 555555
                    ;GuiControl, disable, KillStarbound
        }
        Else
        {
                    Gui, Color, 00FF00
        }
        Sleep, 50
    }
    
    KillStarbound:
    Process, Close, starbound.exe
    return
    
    GuiClose:
    ExitApp
    Release Notes:
    - First release.

    To Do:
    - Maybe autokill the process if it doesn't have an associated window? idunnolol
     
    Last edited: Dec 9, 2013
  2. Shamyi

    Shamyi Big Damn Hero

    this is great man but as an alternative to AHK you could
    always stick this into a new txt file and save it as a .bat file


    @Echo off

    :start
    taskkill /f /im starbound.exe
    if ERRORLEVEL 1 goto:done
    goto:start

    :done
    exit


    Edit: added in the /f as that is needed to kill the zombies specifically.
     
    Last edited: Dec 13, 2013
  3. Supergeek

    Supergeek Scruffy Nerf-Herder

    Would you mind explaining exactly what this script does?
    Does this script give some kind of feedback to tell you if the game is running?
     
  4. Shamyi

    Shamyi Big Damn Hero

    oh right sorry

    just a little command window that opens, kills all running starbound.exes, then closes itself.

    @Echo off (standard cmd command start)

    :start (beginning of loop)
    taskkill /f /im starbound.exe (kills starbound.exe)
    if ERRORLEVEL 1 goto:done (if no starbound.exe running then exits)
    goto:start (goes back to start of loop in the event that starbound.exe was killed within the cycle)

    :done
    exit

    I find that the loop helps as I've seen up to 3 or so starbound.exe in my taskmanager at once

    it dosen't really give any feedback tho if you wanted it to you could have it display something if any starbound.exe
    and then wait till you hit a key to kill them. as it is there it will simple kill any running and then close itself
     
    Last edited: Dec 13, 2013
  5. Supergeek

    Supergeek Scruffy Nerf-Herder

    The AHK script has a little window with a background color indicating the current running state. Gray if it's not running, green if it is. With a big button that lets me kill it if it's running. If it's still green after it crashes or I exit out, I can see quickly, at a glance, if it's still running and needs to be killed. With your script, I still have to somehow know that the exe is still running in the background. That's the whole point of this. When modding, you constantly have to restart the game to test new things.

    I could probably add some logic to automatically kill it if the window disappears but leaves the process running, but I dunno if I want to do that, just in case it decides to kill it if I change my screen size or something.
     
  6. Shamyi

    Shamyi Big Damn Hero


    both methods seem to have their ups and downs, yours looks to work well.
    with the command window its a non issue if it doesn't find a starbound.exe
    running, in that case it would simple do nothing and close itself.
    it's such a fast little window that it honestly isn't much of a hassle just double clicking it
    out of habit when starbound crashes or even just after playing for a while if I'm feeling paranoid.

    although ya, the case that you want a fancy gui for the process then ya a quick command window
    poping up then closing might not be what you want.
     

Share This Page