Skip to content

Instantly share code, notes, and snippets.

@tdnzr
Created December 1, 2022 17:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdnzr/fcfdcdaf3535ec1cfd4a586676b95e61 to your computer and use it in GitHub Desktop.
Save tdnzr/fcfdcdaf3535ec1cfd4a586676b95e61 to your computer and use it in GitHub Desktop.
global keystrokes := ""
~Up::Record("U")
~Down::Record("D")
~Left::Record("L")
~Right::Record("R")
F8::Release()
F9::Clear()
F10::ExitApp
Record(X) {
keystrokes := keystrokes X
}
Release() {
ClipBoard := keystrokes
Clear()
}
Clear() {
keystrokes := ""
}
@tdnzr
Copy link
Author

tdnzr commented Dec 1, 2022

Hey there, after some struggles I've managed to write a very basic (i.e. not user-friendly) AutoHotkey script for recording Sokoban keystrokes (i.e. only Up, Down, Left, Right).

If you'd like to try it, here are the instructions:

  1. Download AutoHotkey
  2. Find my script here: https://gist.github.com/fcfdcdaf3535ec1cfd4a586676b95e61
    2a) Download it (e.g. via the "Download Zip") button, save to desktop or something, and rename the file ending from "txt" to "ahk".
    2b) Alternatively, copy the script text to clipboard, then create a new .txt file, paste the contents, save, and rename the file ending to "ahk".
  3. Launch the script with right-click -> Open with... -> AutoHotkey
    (The script appears in your task bar. Icon: small white H on green background.)
    (In principle, there's also a way to turn an AutoHotkey script into a standalone .exe file, but sharing .exe files over the Internet is yikes.)
  4. To use the script:
  • At the beginning of a level you'd like to record (or at any other time), press F9 to clear the internally stored keystrokes.
  • Then solve the level (as mentioned, the script currently only records Up, Down, Left, and Right input).
  • Afterwards, press F8, and the recorded keystrokes will be copied to your clipboard.
  • To close the script, press F10.
  • If you want to relaunch the script later on, go to 3).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment