Commands

From NetHackWiki
Revision as of 13:34, 10 March 2022 by Sloth1089 (talk | contribs) (Move game control commands into a new table)
Jump to navigation Jump to search
This article is about commands. For a chart of keyboard keys and their uses, see Commands (by key).

In NetHack, a command is an action you want the game to perform. This includes actions your character might do, gathering information about your character or the game, or even modifying the behavior of the game itself.

In previous versions of NetHack, commands were separated into two main categories: normal commands, which predominantly were by default bound to single character keys, and extended commands, which were somewhat less common and either didn't have a default keybinding or were executed with a modifier key like alt or ctrl. These "extended commands" are entered by typing # and entering the command name.

NetHack 3.6.1 does not make a meaningful distinction between normal commands and extended commands, providing most normal commands with an "extended" form, and can be entered either by their respective keybinding or the extended way. 3.6.1 also adds the custom keybinding system, where players can arbitrarily re-bind commands to particular keys or key combinations. When setting these, the "extended" format command name is used. For more information see the binding keys main article.

When entering commands with the # prefix, some commands will autocomplete after only a few letters. This behavior can be modified with the AUTOCOMPLETE option.

Directional keys

Keyboard
y k u
h l
b j n
Numpad
Numpad 7 Numpad 8 Numpad 9
Numpad 4 Numpad 6
Numpad 1 Numpad 2 Numpad 3

Available ony if number_pad option need to be enabled.

Commands

Here is a list of commands, their default keybinding, and a short description.

Meta Key

System Key
NT, OS/2, PC and ST Alt
Amiga Set altmeta option


Controls

Category Action Command Key Short Description
Cancel ESC
Redo last command Ctrl + a
Panic button Ctrl + c Quit the game.
Shell Commands Save #save S Save the game and exit.
Quit #quit Meta + q Exit without saving current game.
Suspend #suspend ctrl + z Suspend the game (UNIX(R) versions with job control only).
Message Repeat previous messages #prevmsg ctrl + p Show previously displayed game messages.
Help on commands #whatdoes & Tell what a key does.
#? Meta + ?††† Get the list of available extended commands.
Help, in game Help (in-game) #help ? Show the help menu.
h
What is #whatis / Show what type of a thing a symbol corresponds to.
Far look #glance ; Show what a map symbol means.
#therecmdmenu Show menu of possible actions in an adjacent location.[1]
In game options Explore mode #exploremode Enter non-scoring game exploring/discovery mode. Used for learning about the game.
Autopickup #autopickup @ Toggle autopickup on/off.
Terrain #terrain Show the map without monsters, objects, or traps.
Motion Direction keys Go one step in the direction indicated
Uppercase Direction keys Go in that direction until you hit a wall
m + Direction keys Move without picking up objects or fighting
M + Direction keys Move far, no pickup
g + Direction keys Move until something interesting is found.
G + Direction keys Same as g + Direction keys, but forking of corridors is not considered interesting.
Ctrl + Direction keys
Staircase #up < Go up a staircase.
#down > Go down a staircase.
Travel #travel _ Travel to a specific location on the map.
m + _ m prefix shows a menu of interesting targets in sight without asking to move the cursor.
Teleport #teleport Ctrl + t Teleport around the level, if you have the ability.
Jump #jump Meta + j Jump to a location.
j
Other actions Wipe #wipe Meta + w Wipe off your face.
Sit #sit Meta + s Sit down.
Rest #wait . Rest one move while doing nothing.
Space if rest_on_space is on.
Battle F + Direction keys Fight a monster (even if you only guess one is there).
Firing #fire f Fire ammunition from quiver.
Quiver #quiver Q Select ammunition for quiver.
Zap #zap z Zap a wand.
Spellcasting #cast Z Cast a spell.
Throw #throw t Throw something.
Explore Near look #look : Look at what is under you.
Search #search s Search for unseen things near you.
Engrave #engrave E Engrave writing on the floor.
Trap #seetrap ^ Show the type of an adjacent trap.
untrap #untrap alt + u Untrap something.
u







Command Shortcuts Short Description
adjust alt + a Adjust inventory letters.
annotate alt + A Leave a note about the level.
apply a Apply (use) a tool.
attributes Ctrl + x Show your attributes.
call C Name a monster or object, or add an annotation.
chat alt + c Talk to someone.
close c Close a door.
conduct alt + C List which challenges you have adhered to.
dip alt + d Dip an object into something.
drop d Drop an item.
droptype D Drop specific item types.
eat e Eat something.
enhance alt + e Advance or check weapons skills.


force alt + f Force a lock.
herecmdmenu Show a menu of possible actions in your current location.
history V Show long version and game history.
inventory i Show your inventory.
inventtype I Inventory specific item types.
invoke alt + i Invoke an object's powers.
kick Ctrl + d, k Kick something.
known \ Show discovered objects.
knownclass ` Show discovered objects of one type.
loot alt + l, l Loot a box on the floor.
monster alt + m Use a monster's special ability.
name alt + n, C, N Name an item or type of object.
offer alt + o Offer a sacrifice to the gods.
open o Open a door.
options O Show and change settings.
overview alt + O, Ctrl + o Display an overview of the dungeon.
pay p Pay your shopping bill.
pickup , Pick up things at current location.
pray alt + p Pray to the gods for help.
puton P Put on an accessory.
quaff q Drink something.


read r Read a scroll, spellbook, or something else.
redraw Ctrl + r, Ctrl + l Redraw the screen.
remove R Remove an accessory.
ride alt + R Ride (or stop riding) a monster.
rub alt + r Rub a lamp or a stone.
seeall * Show all equipment in use.
seeamulet " Show currently worn amulet.
seearmor [ Show currently worn armor.
seegold $ Count your gold.
seerings = Show currently worn ring(s).
seespells + List and reorder known spells.
seetools ( Show tools currently in use.
seeweapon ) Show currently wielded weapons.
shell ! Do a shell escape. (Disabled on most NetHack servers.)


swap x Swap wielded and secondary weapons.
takeoff T Take off one piece of armor.
takeoffall A Remove all armor.
tip alt + T Tip over a container.
turn alt + t Turn undead.[2]
twoweapon X, alt + 2†† Toggle two-weapon combat.


version alt + v List compile time options for this version of NetHack.
versionshort v Show version string.
wear W Wear a piece of armor.
wield w Wield a weapon.


() These keybindings are only present when the number_pad option is enabled.

(††) These keybindings are only present when the number_pad option is disabled.

††† Not supported on all platforms

Wizard-mode commands

Playing in wizard mode adds several commands:

Command Shortcut Short Description
levelchange Change your experience level.
lightsources Show mobile light sources.
monpolycontrol Control monster polymorphs.
panic Test the panic routine.
polyself Polymorph self.
seenv Show seen vectors.
stats Show memory statistics.
timeout Look at the timeout queue.
vanquished List vanguished monsters.
vision Show vision array.
wizdebug_bury Bury objects under and around you.
wizdebug_traveldisplay Toggle travel display.
wizdetect ctrl + e Search a room.
wizgenesis ctrl + g Create a monster.
wizidentify ctrl + i Identify all items in inventory.
wizintrinsic Set intrinsic.
wizlevelport ctrl + v Teleport to another level.
wizmap ctrl + f Map the level.
wizrumorcheck Verify rumor boundaries.
wizsmell Smell monster.
wizwhere Show locations of special levels.
wizwish ctrl + w Wish for something.
wmode Show wall modes.

SLASH'EM

SLASH'EM adds the following extended commands:

Command Short Description
2weapon Alias of 'Twoweapon'.
Borrow steals gold from monsters.
Technique use a technique.
Youpoly Polymorph at will, as a Doppelganger, Flame mage, or Ice mage.

Notes

  1. This command currently does not function properly; see this commit.
  2. This command is related to the D&D concept of "undead turning"; it does not cause your character to suddenly become an undead monster!

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

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

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