(Last updated: Jan 22, 2019)

I've been playing through various Metroid games recently, and I tend to get rather completionist about acquiring all the upgrades. One of the energy tank locations in Metroid: Zero Mission (the GBA remake of Metroid 1) requires far more platforming skill than I actually have. Specifically, Chozodia Energy Tank #3, as enumerated on metroid.retropixel.net.

So, as I did with my Owlboy Boguin Cannon Cheat, I figured it would be fun to make a little script to do that run for me, using a Linux util called xdotool. That's like AutoHotKey for Windows. For ease of tweaking and management, I did this via a short little Python script which builds the xdotool commandline and then executes it at the end. I should probably look into using PyAutoGUI for this kind of thing in the future, eh?

Here's the script: metroidzm-tank.py

The keys which it uses are hardcoded near the top of the file. It uses Ctrl-L to load the most recent snapshot, the numeric keypad number keys for directional control, and space for jump. The first thing it does, after a two-second delay (which gives you time to focus the emulator window), is load the most recent memory state. It expects that state to have Samus in the lower-left-hand corner of the watery area you start out in:

Starting Position

If you, too, are looking to cheat your way to 100% completion in Metroid: Zero Mission, but don't want to figure out running a Python script (but are running Linux, where xdotool is a thing), here's the resulting command that gets run (though obviously you'd have to change the actual keys being used, if your keybinds don't match mine):

xdotool \
    sleep 2 \
    keydown ctrl+l sleep 0.2 keyup ctrl+l \
    sleep 0.2 \
    keydown KP_Right sleep 2.75 keyup KP_Right \
    keydown KP_Down sleep 0.1 keyup KP_Down \
    keydown KP_Left \
    keydown space sleep 0.4 keyup space \
    sleep 1 \
    keyup KP_Left \
    sleep 0.1 \
    keydown space \
    sleep 0.4 \
    keydown KP_Left \
    sleep 0.3 \
    keyup space \
    keyup KP_Left \
    keydown KP_Down sleep 0.1 keyup KP_Down \
    keydown KP_Left \
    keydown space sleep 0.45 keyup space \
    keyup KP_Left \
    sleep 0.1 \
    keydown KP_Right \
    keydown space \
    sleep 0.2 \
    keyup KP_Right \
    sleep 0.2 \
    keyup space \
    sleep 0.1 \
    keydown KP_Right \
    keydown space \
    sleep 0.1 \
    keyup KP_Right \
    keyup space \
    sleep 0.1 \
    sleep 0.1 \
    keydown space \
    sleep 0.4 \
    keydown KP_Right \
    sleep 0.2 \
    keyup space \
    keyup KP_Right \
    keydown KP_Down sleep 0.1 keyup KP_Down \
    keydown KP_Left \
    keydown space \
    sleep 0.2 \
    keyup KP_Left \
    keydown KP_Right sleep 0.1 keyup KP_Right \
    keydown KP_Left sleep 0.1 keyup KP_Left \
    keyup space \
    sleep 0.1 \
    keydown KP_Right \
    keydown space \
    sleep 0.2 \
    keyup KP_Right \
    keydown KP_Left sleep 0.2 keyup KP_Left \
    keyup space \
    sleep 0.1 \
    keydown space \
    sleep 0.4 \
    keydown KP_Left \
    sleep 0.2 \
    keyup space \
    keyup KP_Left \
    keydown KP_Down sleep 0.1 keyup KP_Down \
    keydown KP_Right \
    keydown space sleep 0.5 keyup space \
    sleep 0.1 \
    keydown space sleep 0.3 keyup space \
    sleep 0.8 \
    keyup KP_Right \
    sleep 0.1 \
    keydown space \
    sleep 0.4 \
    keydown KP_Right \
    sleep 0.5 \
    keyup space \
    keyup KP_Right \
    keydown KP_Down sleep 0.1 keyup KP_Down \
    keydown KP_Right \
    sleep 1.1 \
    keydown space sleep 0.3 keyup space \
    sleep 0.4 \
    keyup KP_Right \
    sleep 0.2 \
    keydown KP_Left sleep 0.5 keyup KP_Left \
    sleep 0.5 \
    sleep 0.1 \
    keydown space \
    sleep 0.4 \
    keydown KP_Left \
    sleep 0.2 \
    keyup space \
    keyup KP_Left \
    keydown KP_Down sleep 0.1 keyup KP_Down \
    keydown KP_Right sleep 1.2 keyup KP_Right \
    sleep 0.5 \
    sleep 0.1 \
    keydown space \
    sleep 0.4 \
    keydown KP_Right \
    sleep 0.5 \
    keyup space \
    keyup KP_Right

I imagine for someone used to putting together AHK scripts for Windows, that would be pretty easy to adapt for that purpose. Let me know if you've got questions, or comments!

Changelog

Jan 22, 2019
  • Initial post