Difference between revisions of "Autopickup exception"

From NetHackWiki
Jump to navigation Jump to search
m (Easy ones: fix typo which could have fairly problematic results)
(How to use it effectively)
Line 23: Line 23:
  
 
==How to use it effectively==
 
==How to use it effectively==
Autopickup exceptions can greatly simplify dungeon exploration. However, the very limited nature of their regular expression syntax makes them a bit hard to configure.
+
Autopickup exceptions can greatly simplify dungeon exploration. You can use them to keep dangerous items out of monsters' hands, to conveniently sort through large piles of loot, to automate things you might forget, to save a turn when fleeing or on [[speed run]]s, to remove good morphs from your [[polypiling]] line without paying attention, etc.
  
You can use them to keep dangerous items out of monsters' hands, to conveniently sort through large piles of loot, to automate things you might forget, to save a turn when fleeing or on speed runs, to remove good morphs from your [[polypiling]] line without paying attention, etc.
+
Some items, such as [[gold]], are useful only in the early game. You can remove according autopickup exceptions in-game with the {{kbd|O}} command. They will re-appear the next time you run the program. If your needs change much over the course of a long game, the easiest way to update the exceptions is to (un)comment lines in your config file, [[save]] the game, and restore. You can also use [[pickup_types]] as an in-game switch to distinguish between early-game and late-game configurations. In your [[nethackrc]], simply don't mention items you want to default to [[pickup_types]].
  
Use [[pickup_types]] as an in-game switch to distinguish between early-game and late-game configurations. In your [[nethackrc]], simply don't mention items you want to default to [[pickup_types]].
+
The regular expression in the rule is matched against the singular form of the name of the item, plus any preceding article or number: "a gold piece" matches a single gold piece, "2 gold piece" matches a stack of 2 gold pieces, but "2 gold pieces" would match nothing.{{reffunc|objnam.c|makesingular}} Any "called ..." or "named ..." suffixes added with the [[Name|#name]] command ''are'' included, so take note of your own naming habits and write your autopickup exceptions accordingly.
  
A few items are useful only in the early game (such as gold). You can remove according autopickup exceptions in-game with the {{kbd|O}} command. They will re-appear when you restore or start a new game. If your needs change much over the course of a long game, the easiest way to update the exceptions is to (un)comment lines in your config file, [[save]] the game, and restore.
+
As of version [[3.6.4]], autopickup exceptions override one another sequentially the same way menucolors and msgtypes do, with rules specified further down in the config file taking precedence over those specified earlier, and rules specified during play via the {{kbd|O}} command taking precedence over everything.
  
 
===Easy ones===
 
===Easy ones===
Individually-name the real Amulet right away, and you'll never fall for a fake:
+
Individually-name the real Amulet right away and you'll never fall for a fake:
  
  AUTOPICKUP_EXCEPTION=">Amulet of Yendor$"
+
  AUTOPICKUP_EXCEPTION=">Amulet of Yendor"
 
  AUTOPICKUP_EXCEPTION="<Amulet of Yendor named"
 
  AUTOPICKUP_EXCEPTION="<Amulet of Yendor named"
  
 
Avoid turning your scrolls of scare monster to dust:
 
Avoid turning your scrolls of scare monster to dust:
  AUTOPICKUP_EXCEPTION=">scroll of scare monster"
+
  AUTOPICKUP_EXCEPTION=">scroll .* scare monster"
AUTOPICKUP_EXCEPTION=">scroll called scare monster"
 
  
Walk in peace over empty wands:
+
Walk in peace over empty wands and [[wand of nothing|wands of nothing]]:
  autopickup_exception=":0¥)"
+
  AUTOPICKUP_EXCEPTION=":0¥)"
 
  AUTOPICKUP_EXCEPTION="> named empty"
 
  AUTOPICKUP_EXCEPTION="> named empty"
 +
AUTOPICKUP_EXCEPTION="> nothing"
  
Good [[monster starting inventory|items left after a fight]], but requires careful weight watching:
+
Good [[monster starting inventory|items left after a fight]] that careful weight watching:
 +
# AUTOPICKUP_EXCEPTION="<potion .* healing"
 +
# AUTOPICKUP_EXCEPTION="<potion .* gain level"
  
# autopickup_exception="<full healing"
+
Pick up formally [[identified]] artifacts. Don't blast yourself to death with a cross-aligned one — leave unidentified ones on the floor:
# autopickup_exception="<potion of extra healing"
+
  AUTOPICKUP_EXCEPTION="<[^| ]the "
# autopickup_exception="<potion of healing"
 
  # autopickup_exception="<gain level"
 
  
Pick up formally [[identified]] artifacts. Don't blast yourself to death with a cross-aligned one — leave unidentified ones on the floor.
+
Some people also want known-blessed items, though this likely picks up too much:
 +
#  AUTOPICKUP_EXCEPTION="<blessed"
  
autopickup_exception="<[^| ]the "
+
===Corpses===
 +
The [[comestible]] item class includes [[food]], which you may well want to autopickup, but also [[corpses]], which are prohibitively heavy, usually worthless, and in the case of [[chickatrice]] and [[cockatrice]] corpses, extremely dangerous. The solution to this is to include {{white|%}} in your pickup_types and then add the following exception:
 +
AUTOPICKUP_EXCEPTION="> corpse"
  
Some people also want known-blessed items, but this likely picks up too much.
+
Some corpses you actually might want to pick up include [[lichen]] and [[lizard]]s, which do not decay and the latter of which is invaluable in [[stoning|certain emergencies]], and [[newts]], [[floating eyes]], and [[wraiths]], which are lightweight and have beneficial effects when eaten:
#  autopickup_exception="<blessed"
+
  AUTOPICKUP_EXCEPTION="<lichen corpse"  
 
+
  AUTOPICKUP_EXCEPTION="<lizard corpse"  
===Never pick up corpses except [[lizards]], [[newts]], [[lichen]], [[wraiths]], and [[floating eyes]]===
+
  AUTOPICKUP_EXCEPTION="<newt corpse"
Since you can't define an exception from an exception, you have to enumerate the possibilities. The trailing [^<]*$ allows you to override this drop rule by naming a specific corpse with "<", such as "hill giant corpse named <".
 
 
 
# # We might pick up people food, but never corpses, except lizards, newts, lichen, wraiths, or floating eyes.
 
 
AUTOPICKUP_EXCEPTION=">a corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">b corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">c corpse[^<]*$"
 
 
# lizards, but not wizards or guards or lords
 
  AUTOPICKUP_EXCEPTION="<lizard corpse"
 
  AUTOPICKUP_EXCEPTION=">[^r]d corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">[^a]rd corpse[^<]*$"
 
  AUTOPICKUP_EXCEPTION=">[^z]ard corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">[^l]izard corpse[^<]*$"
 
 
#floating eye corpse
 
 
  AUTOPICKUP_EXCEPTION="<floating eye corpse"
 
  AUTOPICKUP_EXCEPTION="<floating eye corpse"
AUTOPICKUP_EXCEPTION=">[^y]e corpse[^<]*$"
+
  AUTOPICKUP_EXCEPTION="<wraith corpse"  
 
AUTOPICKUP_EXCEPTION=">f corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">g corpse[^<]*$"
 
 
# wraiths, but not Ixoth or Death
 
  AUTOPICKUP_EXCEPTION="<wraith corpse"
 
AUTOPICKUP_EXCEPTION=">[^t]h corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">[^i]th corpse[^<]*$"
 
 
AUTOPICKUP_EXCEPTION=">i corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">k corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">l corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">m corpse[^<]*$"
 
 
#lichen corpse, but not all that other en stuff
 
AUTOPICKUP_EXCEPTION="<lichen corpse"
 
AUTOPICKUP_EXCEPTION=">[^e]n corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">[^h]en corpse[^<]*$"
 
 
AUTOPICKUP_EXCEPTION=">o corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">p corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">r corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">s corpse[^<]*$"
 
 
# newt
 
AUTOPICKUP_EXCEPTION="<newt corpse"
 
AUTOPICKUP_EXCEPTION=">[^w]t corpse[^<]*$"
 
 
AUTOPICKUP_EXCEPTION=">u corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">v corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">x corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">y corpse[^<]*$"
 
AUTOPICKUP_EXCEPTION=">' corpse[^<]*$"
 
  
 
===Define pickup / drop in-game===
 
===Define pickup / drop in-game===
Without editing your config, you want to say "pick up all such objects" or "always leave this one on the floor". We will pick an object up if its individual name or called-classname ends with "<", and drop if ">".
+
The following rules let you manually override autopickup exceptions without changing the rules at all by [[Name|#naming]] items with strings containing "<" or ">":
 +
AUTOPICKUP_EXCEPTION="<<"
 +
AUTOPICKUP_EXCEPTION=">>"
  
In unpatched vanilla NetHack, the challenge are individual exceptions: You want to pick up your ''"blessed bag called CAUTION holding> named MY ONE AND ONLY'''<'''"''. But you want to leave any other ''"blessed bag called CAUTION holding'''>'''"'' on the floor, so you can't accidentally put it into your main bag and cause an explosion. In short, you want the individual object name to override the called-classname. You'd think this ruleset should work:
+
Because rules defined later take precedence over ones defined earlier, if you want these manual overrides to take effect unconditionally, you have to put them at the end of the file. If you want to be able to name a class of unidentified items with ">" to leave them alone and then individually-name one of those items with "<" to pick it up, add the following rules below that:
 
 
# good-faith attempt, doesn't work
 
autopickup_exception="> called .*>"
 
autopickup_exception="> named .*>"
 
autopickup_exception="> called .*<.* named .*>"
 
autopickup_exception="< called .*<"
 
 
  autopickup_exception="< named .*<"
 
  autopickup_exception="< named .*<"
autopickup_exception="< called .*>.* named .*<"
 
 
But it fails. In the bag of holding example, both the first rule (drop) and the last one (pickup) match. Whenever conflicting rules match, the object is dropped. The solution is to add the regex [^<]$, which ignores any item which has a "<" before the end of the string, at the end of all drop rules.
 
 
This rule-set picks up "<" and drops ">" items, with priority on the individual object name.
 
 
# pickup what I define during game (called or named). Individual names take precedence.
 
autopickup_exception="<<"
 
 
  autopickup_exception="> named .*>"
 
  autopickup_exception="> named .*>"
autopickup_exception="> called .*>.* named [^<]*$"
 
 
To avoid other conflicts, such as wanting to pick up a bag of holding named "Mine<", but not pick up any others, all drop rules should end with the regex [^<]$, like this:
 
 
autopickup_exception=">bag of holding[^<]*$"
 
  
 
===One of each kind of magical object===
 
===One of each kind of magical object===
 
Usually, you need only one of each type of magical armor / ring / amulet / spellbook / magical tool. Wouldn't it be nice if the game managed that for you? It can if you're willing to class-name all objects immediately.
 
Usually, you need only one of each type of magical armor / ring / amulet / spellbook / magical tool. Wouldn't it be nice if the game managed that for you? It can if you're willing to class-name all objects immediately.
  
Below are the rules for armor. E.g. call the mine town watchmens' helmets "plain". And call a magical but cursed helmet from a bones pile "#2 bones <" (trailing < to pick up a second specimen). See [[User:Tjr|Tjr]]'s [http://alt.org/nethack/userdata/tjr2/tjr2.nh343rc config] for other item types, although it needs to be updated for Nethack 3.6 regex format.
+
Below are the rules for armor. You could call the mine town watchmens' helmets "plain", turning it from its name from its unidentified description to "a helmet called plain" and removing it from the pickup list. See [[User:Tjr|Tjr]]'s [http://alt.org/nethack/userdata/tjr2/tjr2.nh343rc config] for other item types, although it needs to be updated for Nethack 3.6 regex format.
  
 
  # AUTOPICKUP_EXCEPTION="<robe"
 
  # AUTOPICKUP_EXCEPTION="<robe"
Line 148: Line 85:
 
  # AUTOPICKUP_EXCEPTION="<polished silver shield"
 
  # AUTOPICKUP_EXCEPTION="<polished silver shield"
 
  # AUTOPICKUP_EXCEPTION="<smooth shield"
 
  # AUTOPICKUP_EXCEPTION="<smooth shield"
  # #             blind      ^^^^^^
+
  # #     when blind      ^^^^^^
 +
 
 +
AUTOPICKUP_EXCEPTION=">helmet"
 
  AUTOPICKUP_EXCEPTION="<conical hat"
 
  AUTOPICKUP_EXCEPTION="<conical hat"
 
  AUTOPICKUP_EXCEPTION="<plumed helmet"
 
  AUTOPICKUP_EXCEPTION="<plumed helmet"
Line 154: Line 93:
 
  AUTOPICKUP_EXCEPTION="<crested helmet"
 
  AUTOPICKUP_EXCEPTION="<crested helmet"
 
  AUTOPICKUP_EXCEPTION="<visored helmet"
 
  AUTOPICKUP_EXCEPTION="<visored helmet"
 +
 +
AUTOPICKUP_EXCEPTION=">cloak"
 
  AUTOPICKUP_EXCEPTION="<tattered cape"
 
  AUTOPICKUP_EXCEPTION="<tattered cape"
 
  AUTOPICKUP_EXCEPTION="<opera cloak"
 
  AUTOPICKUP_EXCEPTION="<opera cloak"
 
  AUTOPICKUP_EXCEPTION="<ornamental cope"
 
  AUTOPICKUP_EXCEPTION="<ornamental cope"
 
  AUTOPICKUP_EXCEPTION="<piece of cloth"
 
  AUTOPICKUP_EXCEPTION="<piece of cloth"
 +
 +
AUTOPICKUP_EXCEPTION=">gloves"
 
  AUTOPICKUP_EXCEPTION="<old gloves"
 
  AUTOPICKUP_EXCEPTION="<old gloves"
 
  AUTOPICKUP_EXCEPTION="<padded gloves"
 
  AUTOPICKUP_EXCEPTION="<padded gloves"
 
  AUTOPICKUP_EXCEPTION="<riding gloves"
 
  AUTOPICKUP_EXCEPTION="<riding gloves"
 
  AUTOPICKUP_EXCEPTION="<fencing gloves"
 
  AUTOPICKUP_EXCEPTION="<fencing gloves"
 +
 +
AUTOPICKUP_EXCEPTION=">boots"
 
  AUTOPICKUP_EXCEPTION="<combat boots"
 
  AUTOPICKUP_EXCEPTION="<combat boots"
 
  AUTOPICKUP_EXCEPTION="<jungle boots"
 
  AUTOPICKUP_EXCEPTION="<jungle boots"
Line 171: Line 116:
  
 
===Keeping ammunition out of monsters' hands===
 
===Keeping ammunition out of monsters' hands===
Especially in the Mines, you want to collect lightweight but dangerous projectiles and deposit then on an Elbereth square. This keeps monsters from reusing them against you over and over. (Deactivate daggers if you don't fire them yourself — they're heavy.)
+
Especially in the Mines, you want to collect lightweight but dangerous projectiles and deposit them in a safe location &endash; on a square with a [[scroll of scare monster is good]], as is the downstair on a previously cleared level. This keeps monsters from reusing them against you over and over. (Deactivate daggers if you don't fire them yourself — they're heavy.)
  
 
  AUTOPICKUP_EXCEPTION="< arrow"
 
  AUTOPICKUP_EXCEPTION="< arrow"
Line 194: Line 139:
  
 
===Things too good to miss===
 
===Things too good to miss===
Wands of wishing, magic lamps, magic markers, and wands of permanent Elbereth are useful even in the ascension run or when farming. In those situations, you likely have enough other things on your mind. You don't want monsters zapping create monster or shooting death rays at you.
+
Wands of wishing, magic lamps, magic markers, and wands of lasting [[Elbereth]] are useful even in the endgame, when you likely have enough other things on your mind. You don't want monsters zapping create monster or shooting death rays at you.
 +
 
 +
AUTOPICKUP_EXCEPTION="<wand .* wish"
 +
AUTOPICKUP_EXCEPTION="<wand .* create monster"
 +
AUTOPICKUP_EXCEPTION="<wand .* tele"
 +
#AUTOPICKUP_EXCEPTION="<wand .* poly"
 +
 
 +
AUTOPICKUP_EXCEPTION="<wand .* fire"
 +
AUTOPICKUP_EXCEPTION="<wand .* lightning"
 +
AUTOPICKUP_EXCEPTION="<wand .* death"
 +
#AUTOPICKUP_EXCEPTION=">wand .* cold$" # For Juiblex's swamp
  
AUTOPICKUP_EXCEPTION="<wand of wishing"
 
AUTOPICKUP_EXCEPTION="<wand called wish"
 
AUTOPICKUP_EXCEPTION="<wand of create monster"
 
AUTOPICKUP_EXCEPTION="<wand of teleportation"
 
AUTOPICKUP_EXCEPTION="<wand called tele"
 
# AUTOPICKUP_EXCEPTION="<wand of polymorph"
 
# AUTOPICKUP_EXCEPTION="<wand called poly"
 
AUTOPICKUP_EXCEPTION="<wand of fire"
 
AUTOPICKUP_EXCEPTION="<wand of lightning"
 
AUTOPICKUP_EXCEPTION="<wand of death"
 
# # Cold is used for Juiblex swamp, etc.
 
# AUTOPICKUP_EXCEPTION=">wand of cold[^<]*$"
 
 
  AUTOPICKUP_EXCEPTION="<magic marker"
 
  AUTOPICKUP_EXCEPTION="<magic marker"
 
  AUTOPICKUP_EXCEPTION="< lamp"
 
  AUTOPICKUP_EXCEPTION="< lamp"
  AUTOPICKUP_EXCEPTION="> oil lamp [^<]*$"
+
  AUTOPICKUP_EXCEPTION="> oil lamp"
  AUTOPICKUP_EXCEPTION="> lamp called oil[^<]*$"
+
  AUTOPICKUP_EXCEPTION="> lamp .* oil"
  AUTOPICKUP_EXCEPTION="<amulet of life saving"
+
  AUTOPICKUP_EXCEPTION="<amulet .* life"
AUTOPICKUP_EXCEPTION="<amulet called life"
 
 
  AUTOPICKUP_EXCEPTION="<athame"
 
  AUTOPICKUP_EXCEPTION="<athame"
  
 
===Avoiding loadstones===
 
===Avoiding loadstones===
This rule-set should never pick up a loadstone, regardless of your blindness or knowledge of loadstones. You can still automatically pick up agate stones, etc.
+
With this rule, you should never pick up a loadstone, regardless of your [[blind]]ness or knowledge of loadstones:
 
+
  AUTOPICKUP_EXCEPTION="> loadstone"
  AUTOPICKUP_EXCEPTION="> loadstone[^<]*$"
 
 
  AUTOPICKUP_EXCEPTION="<stone called luck"
 
  AUTOPICKUP_EXCEPTION="<stone called luck"
 
  AUTOPICKUP_EXCEPTION="< luckstone"
 
  AUTOPICKUP_EXCEPTION="< luckstone"
  # AUTOPICKUP_EXCEPTION="< touchstone"
+
  #AUTOPICKUP_EXCEPTION="< touchstone"
  AUTOPICKUP_EXCEPTION="> rock[^<]*$"
+
  AUTOPICKUP_EXCEPTION="> rock"
 +
AUTOPICKUP_EXCEPTION="> gray stone"
 
   
 
   
# #blind: glass/gems show up as gem, all else as stone.
+
When blind, [[gems]] and [[worthless glass]] are called "gems", and all other {{white|*}} are called "stones".
  AUTOPICKUP_EXCEPTION="> stone[^<]*$"
+
  AUTOPICKUP_EXCEPTION=">^[a0-9]+ stone"
 +
 
 +
The leading "^[a0-9]+" ensures that gems with "stone" in their identified name (amber stones, turquoise stones, etc.) are not matched.
  
 
===Only exceptions pick stuff up===
 
===Only exceptions pick stuff up===
If you want only the exceptions to pick anything up, you would normally set pickup_tyes to "" (empty). Unfortunately, that picks up everything. The solution is iron balls:
+
If you want only the exceptions to pick anything up, put this rule at the beginning of your file:
 +
AUTOPICKUP_EXCEPTION=">.*"
  
OPTIONS=pickup_types:0
+
This excludes everything, so that you can turn on autopickup, but not actually autopickup anything unless you say so with an exception.
AUTOPICKUP_EXCEPTION=">heavy iron ball[^<]*$"
 
  
 
==References==
 
==References==

Revision as of 20:29, 29 January 2020

AUTOPICKUP_EXCEPTION is a configuration option that allows you to define what items are automatically picked up, with more precision than pickup_types gives. You also need to have autopickup on and pickup_types match the AUTOPICKUP_EXCEPTION -lines. Highly recommended but not necessary is adapting pickup_burden.

OPTIONS=autopickup
OPTIONS=pickup_types:$?!/(
OPTIONS=pickup_burden:unencumbered

In NetHack 3.6 autopickup exceptions are compiled in by default. NAO has them as well.

You can either define the exceptions in the options screen or in your configuration file by putting the following lines in it:

AUTOPICKUP_EXCEPTION=">chest"

This will make the hero never pick up all items that match the string "chest".

AUTOPICKUP_EXCEPTION="<dagger"

This will make the hero always pick up all items that match the string "dagger".

If the first character inside the quoted string is a greater-than sign (>), then the matched items will be not be picked up; if it's a less-than sign (<), the items will be picked up. The rest of the string defines what items will match for that rule. The string matching allows for basic wildcards, where period plus asterisk (.*) matches any number of characters and question mark (?) matches any one character. A "never pickup" rule takes precedence over an "always pickup" rule if both match an item. If no rule matches, autopickup defaults to pickup_types.

NetHack attempts to convert the object names and called-classnames to singular form before matching them against your exceptions. This usually makes writing exceptions easier; however, when you use #name to give an object a called-classname, like "a gem called worthless", NetHack will mangle the called-classname as well, possibly making it harder to match against. In particular, it will attempt to make the word "worthless" singular by removing an "s", but only if the word comes at the end of the name. Thus, to drop all worthless glass, (whether formally or informally IDed) you should say ">*worthless?", not ">*worthless".[1]

How to use it effectively

Autopickup exceptions can greatly simplify dungeon exploration. You can use them to keep dangerous items out of monsters' hands, to conveniently sort through large piles of loot, to automate things you might forget, to save a turn when fleeing or on speed runs, to remove good morphs from your polypiling line without paying attention, etc.

Some items, such as gold, are useful only in the early game. You can remove according autopickup exceptions in-game with the O command. They will re-appear the next time you run the program. If your needs change much over the course of a long game, the easiest way to update the exceptions is to (un)comment lines in your config file, save the game, and restore. You can also use pickup_types as an in-game switch to distinguish between early-game and late-game configurations. In your nethackrc, simply don't mention items you want to default to pickup_types.

The regular expression in the rule is matched against the singular form of the name of the item, plus any preceding article or number: "a gold piece" matches a single gold piece, "2 gold piece" matches a stack of 2 gold pieces, but "2 gold pieces" would match nothing.[2] Any "called ..." or "named ..." suffixes added with the #name command are included, so take note of your own naming habits and write your autopickup exceptions accordingly.

As of version 3.6.4, autopickup exceptions override one another sequentially the same way menucolors and msgtypes do, with rules specified further down in the config file taking precedence over those specified earlier, and rules specified during play via the O command taking precedence over everything.

Easy ones

Individually-name the real Amulet right away and you'll never fall for a fake:

AUTOPICKUP_EXCEPTION=">Amulet of Yendor"
AUTOPICKUP_EXCEPTION="<Amulet of Yendor named"

Avoid turning your scrolls of scare monster to dust:

AUTOPICKUP_EXCEPTION=">scroll .* scare monster"

Walk in peace over empty wands and wands of nothing:

AUTOPICKUP_EXCEPTION=":0¥)"
AUTOPICKUP_EXCEPTION="> named empty"
AUTOPICKUP_EXCEPTION="> nothing"

Good items left after a fight that careful weight watching:

# AUTOPICKUP_EXCEPTION="<potion .* healing"
# AUTOPICKUP_EXCEPTION="<potion .* gain level"

Pick up formally identified artifacts. Don't blast yourself to death with a cross-aligned one — leave unidentified ones on the floor:

AUTOPICKUP_EXCEPTION="<[^| ]the "

Some people also want known-blessed items, though this likely picks up too much:

#  AUTOPICKUP_EXCEPTION="<blessed"

Corpses

The comestible item class includes food, which you may well want to autopickup, but also corpses, which are prohibitively heavy, usually worthless, and in the case of chickatrice and cockatrice corpses, extremely dangerous. The solution to this is to include % in your pickup_types and then add the following exception:

AUTOPICKUP_EXCEPTION="> corpse"

Some corpses you actually might want to pick up include lichen and lizards, which do not decay and the latter of which is invaluable in certain emergencies, and newts, floating eyes, and wraiths, which are lightweight and have beneficial effects when eaten:

AUTOPICKUP_EXCEPTION="<lichen corpse" 
AUTOPICKUP_EXCEPTION="<lizard corpse" 
AUTOPICKUP_EXCEPTION="<newt corpse"
AUTOPICKUP_EXCEPTION="<floating eye corpse"
AUTOPICKUP_EXCEPTION="<wraith corpse" 

Define pickup / drop in-game

The following rules let you manually override autopickup exceptions without changing the rules at all by #naming items with strings containing "<" or ">":

AUTOPICKUP_EXCEPTION="<<"
AUTOPICKUP_EXCEPTION=">>"

Because rules defined later take precedence over ones defined earlier, if you want these manual overrides to take effect unconditionally, you have to put them at the end of the file. If you want to be able to name a class of unidentified items with ">" to leave them alone and then individually-name one of those items with "<" to pick it up, add the following rules below that:

autopickup_exception="< named .*<"
autopickup_exception="> named .*>"

One of each kind of magical object

Usually, you need only one of each type of magical armor / ring / amulet / spellbook / magical tool. Wouldn't it be nice if the game managed that for you? It can if you're willing to class-name all objects immediately.

Below are the rules for armor. You could call the mine town watchmens' helmets "plain", turning it from its name from its unidentified description to "a helmet called plain" and removing it from the pickup list. See Tjr's config for other item types, although it needs to be updated for Nethack 3.6 regex format.

# AUTOPICKUP_EXCEPTION="<robe"
# AUTOPICKUP_EXCEPTION="<faded pall"
# AUTOPICKUP_EXCEPTION="<apron"
# AUTOPICKUP_EXCEPTION="<polished silver shield"
# AUTOPICKUP_EXCEPTION="<smooth shield"
# #     when blind       ^^^^^^
AUTOPICKUP_EXCEPTION=">helmet"
AUTOPICKUP_EXCEPTION="<conical hat"
AUTOPICKUP_EXCEPTION="<plumed helmet"
AUTOPICKUP_EXCEPTION="<etched helmet"
AUTOPICKUP_EXCEPTION="<crested helmet"
AUTOPICKUP_EXCEPTION="<visored helmet"
AUTOPICKUP_EXCEPTION=">cloak"
AUTOPICKUP_EXCEPTION="<tattered cape"
AUTOPICKUP_EXCEPTION="<opera cloak"
AUTOPICKUP_EXCEPTION="<ornamental cope"
AUTOPICKUP_EXCEPTION="<piece of cloth"
AUTOPICKUP_EXCEPTION=">gloves"
AUTOPICKUP_EXCEPTION="<old gloves"
AUTOPICKUP_EXCEPTION="<padded gloves"
AUTOPICKUP_EXCEPTION="<riding gloves"
AUTOPICKUP_EXCEPTION="<fencing gloves"
AUTOPICKUP_EXCEPTION=">boots"
AUTOPICKUP_EXCEPTION="<combat boots"
AUTOPICKUP_EXCEPTION="<jungle boots"
AUTOPICKUP_EXCEPTION="<hiking boots"
AUTOPICKUP_EXCEPTION="<mud boots"
AUTOPICKUP_EXCEPTION="<buckled boots"
AUTOPICKUP_EXCEPTION="<riding boots"
AUTOPICKUP_EXCEPTION="<snow boots"

Keeping ammunition out of monsters' hands

Especially in the Mines, you want to collect lightweight but dangerous projectiles and deposit them in a safe location &endash; on a square with a scroll of scare monster is good, as is the downstair on a previously cleared level. This keeps monsters from reusing them against you over and over. (Deactivate daggers if you don't fire them yourself — they're heavy.)

AUTOPICKUP_EXCEPTION="< arrow"
## AUTOPICKUP_EXCEPTION="<elven arrow"
## AUTOPICKUP_EXCEPTION="<orcish arrow"
## AUTOPICKUP_EXCEPTION="<silver arrow"
## AUTOPICKUP_EXCEPTION="<runed arrow"
## AUTOPICKUP_EXCEPTION="<crude arrow"
AUTOPICKUP_EXCEPTION="< ya"
## AUTOPICKUP_EXCEPTION="<bamboo arrow"
AUTOPICKUP_EXCEPTION="<crossbow bolt"
AUTOPICKUP_EXCEPTION="<dart"
AUTOPICKUP_EXCEPTION="<shuriken"
AUTOPICKUP_EXCEPTION="<throwing star"
AUTOPICKUP_EXCEPTION="<dagger"
## AUTOPICKUP_EXCEPTION="<elven dagger"
## AUTOPICKUP_EXCEPTION="<orcish dagger"
## AUTOPICKUP_EXCEPTION="<runed dagger"
## AUTOPICKUP_EXCEPTION="<crude dagger"
## AUTOPICKUP_EXCEPTION="<silver dagger"
AUTOPICKUP_EXCEPTION="<knife"

Things too good to miss

Wands of wishing, magic lamps, magic markers, and wands of lasting Elbereth are useful even in the endgame, when you likely have enough other things on your mind. You don't want monsters zapping create monster or shooting death rays at you.

AUTOPICKUP_EXCEPTION="<wand .* wish"
AUTOPICKUP_EXCEPTION="<wand .* create monster"
AUTOPICKUP_EXCEPTION="<wand .* tele"
#AUTOPICKUP_EXCEPTION="<wand .* poly"
AUTOPICKUP_EXCEPTION="<wand .* fire"
AUTOPICKUP_EXCEPTION="<wand .* lightning"
AUTOPICKUP_EXCEPTION="<wand .* death"
#AUTOPICKUP_EXCEPTION=">wand .* cold$" # For Juiblex's swamp
AUTOPICKUP_EXCEPTION="<magic marker"
AUTOPICKUP_EXCEPTION="< lamp"
AUTOPICKUP_EXCEPTION="> oil lamp"
AUTOPICKUP_EXCEPTION="> lamp .* oil"
AUTOPICKUP_EXCEPTION="<amulet .* life"
AUTOPICKUP_EXCEPTION="<athame"

Avoiding loadstones

With this rule, you should never pick up a loadstone, regardless of your blindness or knowledge of loadstones:

AUTOPICKUP_EXCEPTION="> loadstone"
AUTOPICKUP_EXCEPTION="<stone called luck"
AUTOPICKUP_EXCEPTION="< luckstone"
#AUTOPICKUP_EXCEPTION="< touchstone"
AUTOPICKUP_EXCEPTION="> rock"
AUTOPICKUP_EXCEPTION="> gray stone"

When blind, gems and worthless glass are called "gems", and all other * are called "stones".

AUTOPICKUP_EXCEPTION=">^[a0-9]+ stone"

The leading "^[a0-9]+" ensures that gems with "stone" in their identified name (amber stones, turquoise stones, etc.) are not matched.

Only exceptions pick stuff up

If you want only the exceptions to pick anything up, put this rule at the beginning of your file:

AUTOPICKUP_EXCEPTION=">.*"

This excludes everything, so that you can turn on autopickup, but not actually autopickup anything unless you say so with an exception.

References

External references

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

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

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