Daniel J. Bernstein's ptyget toolset
jdebp.uk
jdebp.uk
Funny I wrote the same kind of start-scumming script against nethack.org using Python and pexpect.
I know that pexpect can be used for testing such applications though. Is this meant to be for a similar use case? Or were "interactive-only" tools more common at one time in the past?
Sadly the AIs (nethackchallenge.com) are not yet good enough to show us what closer to optimal play looks like.
I'm disappointed that DJB didn't automate polypiling until he got what he wanted, rather than just rolling new characters until getting the desired combination of resources. At that point, I'd just say that save game editing and RNG grinding are comparable...
If you're reading this, DJB, thanks for all the awesome and weird tools! Perhaps you're not as widely attributed as you should be but I see your influences everywhere in modern unix.
(edited to change "fingerprints" to "influences" -- things like systemd or the later solaris init replacement are clearly a funhouse mirror re-imagning of daemontools and family -- but fingerprints implies that DJB touched these things which I'm pretty confident he didn't)
* Always retrace your own steps when backtracking. Only walk on new tiles when it’s absolutely necessary for exploration. This greatly reduces your chances of stepping on unseen traps.
* Abuse shops to the max. Price ID everything you find. Sell every last bit of junk. Engage in credit cloning. Steal everything from shops.
* Abuse the protection racket. Max out on divine protection by spending all of the money from every shopkeeper’s pocket at the temple in minetown.
* Abuse alchemy to make large stacks of holy water and blessed potions of full healing. Increase your max HP to several hundred.
* Pudding farming. This one has thankfully been patched out.
* Polypiling. Polymorph lines of items on the floor. Try to get magic markers to write more scrolls of enchant armour.
You can provide the password on the command line, or in an environment variable:
sshpass -p 'PASSWORD' ssh user@host /bin/id
SSHPASS=PASSWORD sshpass -e ssh user@host /bin/id
Not ideal, but if you're working with inflexible third parties who don't understand public keys, sometimes it's acceptable.Storing secrets in environment variables is a common practice in many mostly-reasonable orgs.
{ echo '#!/bin/sh' ; echo 'echo my_password' ; } > password.sh # don't do it like this :-p
chmod +x password.sh
SSH_ASKPASS=./password.sh DISPLAY= setsid ssh user@host /bin/id
In newer SSH versions `DISPLAY` is not required (but there is a new `SSH_ASKPASS_REQUIRE` environment variable), but in older (e.g. 8.x) versions, then it needs to be set as the default ssh-ask-password was an X11 command, and I believe the logic assumed that scenario.There's a command called "stdbuf" on Linux systems that accomplishes the same thing in a different way. It sets some magic environment variables [1], and that tells the subprocess to use line buffering, assuming it's using glibc [edit: or any dynamically-linked libc] and stdio. No pty actually required then.
stdbuf's manpage has an example:
tail -f access.log | stdbuf -oL cut -d ' ' -f1 | uniq
This will immediately display unique entries from access.log
[1] edit: just checked. It injects its own code via the LD_PRELOAD environment variable, and then controls that with other environment variables. LD_PRELOAD is gross but it works, I guess.Source (clone of the original SF repo): https://github.com/ierton/empty
Man page: http://manpages.ubuntu.com/manpages/trusty/man1/empty.1.html
Now I want to know more. I assume he was automating input to the game? But how was he analyzing state?