Recover

From NetHackWiki
(Redirected from Power cut)
Jump to navigation Jump to search
"Crash" redirects here. For the sound effect, see One word messages § Sound effects.

recover is the small utility program that comes with NetHack. It is used to turn temporary level files into a save file, for example after a power outage during a game.

When trying to restart the game, you get the error message:

"There is already a game in progress under your name. Destroy old game? [yn]"

Say no to the above and keep reading.

Unfortunately, the utility is not totally automated. You need to know some basics about the command line. If you have difficulties, you can ask for help on Libera.

General use

Depending on your system, you use a command similar to this:

<fullPath>recover -d <playground> <username>
  • <fullPath>recover Actually, the utility is not a normally accessible command, you need to use the full path to the executable.
  • <playground> is the Playground path where the temporary level files were put during gameplay.

This will most likely only rebuild the savefile, but you might need further commands, depending on your system, to actually reuse it.

For SLASH'EM and probably other variants, it's almost the same as for nethack. Simply replace "nethack" with "slashem" (or other variant name).

For vulture's eye, the name is hard-coded to alock. The command is something like this:

vultureseye-recover -d <playground> alock

Specifics for Linux/Unix

Accidental Ctrl-Z

First make sure you didn't just press ctrl-Z by accident. This simply suspends the current game with out any real damage. A characteristic "[1]+ Stopped nethack" message is given. Read the "fg" article first.

Accidental new shell

A user has suggested improving this page or section as follows:

"What are these keyboard shortcuts for some popular environments??"

Another possible accidental keyboard shortcut. Depending on the command line environment, terminal simulator or desktop environment, they are various keyboard shortcuts to launch a new shell on top of the one you are currently using. This is inside the same window you are using and no message is given. Apparently you drop back in the command line, with no message.

First make sure you aren't in the "Ctrl-Z" situation. The command "jobs" should return nothing. "Ctrl-Z" is a more frequent error and has a characteristic message. When you excluded "Ctrl-Z", to go back to the game, just give the "exit" command (caution!!!! Read the rest first). This command simply kills the current terminal, in our case the superfluous terminal, so make sure you really are in this situation before you try it. If you give the "exit" command after a "Ctrl-Z", you'll probably have to use the recover utility.

Running the command

On Linux and other Unixen, you usually invoke recover like this:

sudo <fullPath>recover -d <playground> <UIDusername>

For ubuntu systems, that would be something like this:

sudo /usr/lib/games/nethack/recover -d /var/games/nethack 1000Bob

This will create a file "1000Bob" in "<playground>" directory. If successful it will give the message "recovered "1000Bob" to 1000Bob".

  • <fullPath>recover Actually, the utility is not a normally accessible command, you need to use the full path to the executable. In Ubuntu systems, the full path is "/usr/lib/games/nethack/".
  • <playground> is the Playground path where the temporary level files were put during gameplay. In Ubuntu systems, that would be "/var/games/nethack/save"
  • <UIDusername> is the file name of the temporary files, without extension. You can easily guess it by inspecting the Playground. They are two components, the "UID" and the "username". It's the UID and username of the user on the system. The UID is a number unique for a user. On single user systems, the UID is usually "1000". The "username" is just the user name or log in .

If you are using official NetHack and your distribution does not come with recover you can download it from the official download-page at https://www.nethack.org/. Check first the other installed files.

Using the file again

Once you executed the recover command successfully, you need to give the created file the correct group.

In general, run the command:

sudo chgrp games <playground><UIDusername>

In the example:

sudo chgrp games /var/games/nethack/1000bob

Then, you compress the file with:

sudo gzip <playground><UIDusername>

In the example:

sudo gzip /var/games/nethack/1000bob

This will create a file with the extension ".gz" or "<UIDusername>.gz". In the example "1000bob.gz".

Then copy the file to the save directory:

sudo cp -p <playground><UIDusername>.gz <playground>/save/

In the example:

sudo cp -p /var/games/nethack/1000bob.gz /var/games/nethack/save/

With luck, you can play now. Ask for help if not.

External links

This page may need to be updated for the current version of NetHack.

It may contain text specific to NetHack 3.4.3. Information on this page may be out of date.

Editors: After reviewing this page and making necessary edits, please change the {{nethack-343}} tag to the current version's tag or {{noversion}} as appropriate.