Wikihack
Advertisement

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

In NetHack 3.4.3 autopickup exceptions are not compiled in by default, and they're marked as experimental, so most builds probably won't have them.

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 always drop all items that match the string "*chest*"

AUTOPICKUP_EXCEPTION="<*dagger"

This will make the hero always pickup all items that match the string "*dagger"

If the first character inside the quoted string is greater-than sign (>), then the matched items will be not be picked up, if it's 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 asterisk (*) matches any number of characters and question mark (?) matches any one character. The object names to match are in the singular form without a leading "a ", "an ", etc. A "never pickup" rule takes precedence over an "always pickup" rule if both match an item.

How to use it effectively

Autopickup exceptions can greatly simplify dungeon exploration. However, the very limited nature of its regular expression syntax makes it a bit hard to configure.

Easy ones

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 of scare monster"
AUTOPICKUP_EXCEPTION=">*scroll called scare monster"

Walk in peace over empty wands:

autopickup_exception="*:0)*"
AUTOPICKUP_EXCEPTION=">* named empty"

Never pick up corpses except lizards

Since you can't define an exception from an exception, you have to enumerate the possibilities.

AUTOPICKUP_EXCEPTION=">*a corpse*"
AUTOPICKUP_EXCEPTION=">*b corpse*"
AUTOPICKUP_EXCEPTION=">*c corpse*"
AUTOPICKUP_EXCEPTION=">*e corpse*"
AUTOPICKUP_EXCEPTION=">*f corpse*"
AUTOPICKUP_EXCEPTION=">*g corpse*"
AUTOPICKUP_EXCEPTION=">*h corpse*"
AUTOPICKUP_EXCEPTION=">*i corpse*"
AUTOPICKUP_EXCEPTION=">*k corpse*"
AUTOPICKUP_EXCEPTION=">*l corpse*"
AUTOPICKUP_EXCEPTION=">*m corpse*"
AUTOPICKUP_EXCEPTION=">*n corpse*"
AUTOPICKUP_EXCEPTION=">*o corpse*"
AUTOPICKUP_EXCEPTION=">*p corpse*"
AUTOPICKUP_EXCEPTION=">*r corpse*"
AUTOPICKUP_EXCEPTION=">*s corpse*"
AUTOPICKUP_EXCEPTION=">*' corpse*"
AUTOPICKUP_EXCEPTION=">*t corpse*"
AUTOPICKUP_EXCEPTION=">*u corpse*"
AUTOPICKUP_EXCEPTION=">*v corpse*"
AUTOPICKUP_EXCEPTION=">*x corpse*"
AUTOPICKUP_EXCEPTION=">*y corpse*"
AUTOPICKUP_EXCEPTION=">*ld corpse*"
AUTOPICKUP_EXCEPTION=">*nd corpse*"
AUTOPICKUP_EXCEPTION=">*ud corpse*"
AUTOPICKUP_EXCEPTION=">*ord corpse*"
AUTOPICKUP_EXCEPTION=">*uard corpse*"
AUTOPICKUP_EXCEPTION=">*wizard corpse*"

Define pickup / drop in-game

You want to say "pick up all such objects" or "always leave this one on the floor" without editing your config. The challenge is to make the choice for the individual object always override the object class. To preserve that feature, you must not let your other rules end with a wildcard.

This example ruleset has you pick up (<) and drop (>) items according to the last character of their class name and the first character of the individual name.


autopickup_exception="<* named <*"
autopickup_exception="<* called *<"
autopickup_exception="<* called *< named *"
# the above rule is ok because if both "called <" and "named >" match, it's dropped.
autopickup_exception=">* named >*"
autopickup_exception=">* called *>"
autopickup_exception=">* called *> named a*"
autopickup_exception=">* called *> named b*"
autopickup_exception=">* called *> named c*"
autopickup_exception=">* called *> named d*"
autopickup_exception=">* called *> named e*"
autopickup_exception=">* called *> named f*"
autopickup_exception=">* called *> named g*"
autopickup_exception=">* called *> named h*"
autopickup_exception=">* called *> named i*"
autopickup_exception=">* called *> named j*"
autopickup_exception=">* called *> named k*"
autopickup_exception=">* called *> named l*"
autopickup_exception=">* called *> named m*"
autopickup_exception=">* called *> named n*"
autopickup_exception=">* called *> named o*"
autopickup_exception=">* called *> named p*"
autopickup_exception=">* called *> named q*"
autopickup_exception=">* called *> named r*"
autopickup_exception=">* called *> named s*"
autopickup_exception=">* called *> named t*"
autopickup_exception=">* called *> named u*"
autopickup_exception=">* called *> named v*"
autopickup_exception=">* called *> named w*"
autopickup_exception=">* called *> named x*"
autopickup_exception=">* called *> named y*"
autopickup_exception=">* called *> named z*"
autopickup_exception=">* called *> named A*"
autopickup_exception=">* called *> named B*"
autopickup_exception=">* called *> named C*"
autopickup_exception=">* called *> named D*"
autopickup_exception=">* called *> named E*"
autopickup_exception=">* called *> named F*"
autopickup_exception=">* called *> named G*"
autopickup_exception=">* called *> named H*"
autopickup_exception=">* called *> named I*"
autopickup_exception=">* called *> named J*"
autopickup_exception=">* called *> named K*"
autopickup_exception=">* called *> named L*"
autopickup_exception=">* called *> named M*"
autopickup_exception=">* called *> named N*"
autopickup_exception=">* called *> named O*"
autopickup_exception=">* called *> named P*"
autopickup_exception=">* called *> named Q*"
autopickup_exception=">* called *> named R*"
autopickup_exception=">* called *> named S*"
autopickup_exception=">* called *> named T*"
autopickup_exception=">* called *> named U*"
autopickup_exception=">* called *> named V*"
autopickup_exception=">* called *> named W*"
autopickup_exception=">* called *> named X*"
autopickup_exception=">* called *> named Y*"
autopickup_exception=">* called *> named Z*"
autopickup_exception=">* called *> named ^*"
autopickup_exception=">* called *> named !*"
autopickup_exception=">* called *> named $*"
autopickup_exception=">* called *> named %*"
autopickup_exception=">* called *> named &*"
autopickup_exception=">* called *> named /*"
autopickup_exception=">* called *> named (*"
autopickup_exception=">* called *> named )*"
autopickup_exception=">* called *> named =*"
autopickup_exception=">* called *> named `*"
autopickup_exception=">* called *> named +*"
autopickup_exception=">* called *> named ,*"
autopickup_exception=">* called *> named ;*"
autopickup_exception=">* called *> named .*"
autopickup_exception=">* called *> named :*"
autopickup_exception=">* called *> named -*"
autopickup_exception=">* called *> named _*"
autopickup_exception=">* called *> named [*"
autopickup_exception=">* called *> named ]*"
autopickup_exception=">* called *> named {*"
autopickup_exception=">* called *> named }*"
autopickup_exception=">* called *> named |*"
autopickup_exception=">* called *> named \*"
autopickup_exception=">* called *> named 0*"
autopickup_exception=">* called *> named 1*"
autopickup_exception=">* called *> named 2*"
autopickup_exception=">* called *> named 3*"
autopickup_exception=">* called *> named 4*"
autopickup_exception=">* called *> named 5*"
autopickup_exception=">* called *> named 6*"
autopickup_exception=">* called *> named 7*"
autopickup_exception=">* called *> named 8*"
autopickup_exception=">* called *> named 9*"

One of each kind of magical object

Usually, you need only one of each type of magical armor / ring / amulet / spellbook / magic 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 a good but cursed one from a bones pile is "#2 bones <" (to pick up a second one).

# AUTOPICKUP_EXCEPTION="<*robe"
# AUTOPICKUP_EXCEPTION="<*faded pall"
# AUTOPICKUP_EXCEPTION="<*apron"
# AUTOPICKUP_EXCEPTION="<*polished silver shield"
# AUTOPICKUP_EXCEPTION="<*smooth shield"
# #              blind       ^^^^^^
AUTOPICKUP_EXCEPTION="<*conical hat"
AUTOPICKUP_EXCEPTION="<*plumed helmet"
AUTOPICKUP_EXCEPTION="<*etched helmet"
AUTOPICKUP_EXCEPTION="<*crested helmet"
AUTOPICKUP_EXCEPTION="<*visored helmet"
AUTOPICKUP_EXCEPTION="<*tattered cape"
AUTOPICKUP_EXCEPTION="<*opera cloak"
AUTOPICKUP_EXCEPTION="<*ornamental cope"
AUTOPICKUP_EXCEPTION="<*piece of cloth"
AUTOPICKUP_EXCEPTION="<*old gloves"
AUTOPICKUP_EXCEPTION="<*padded gloves"
AUTOPICKUP_EXCEPTION="<*riding gloves"
AUTOPICKUP_EXCEPTION="<*fencing gloves"
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 then on an Elbereth square. This prevents 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="<*athame"
AUTOPICKUP_EXCEPTION="<*knife"

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.

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 lamp"
AUTOPICKUP_EXCEPTION="<lamp"
AUTOPICKUP_EXCEPTION="<*d lamp"
AUTOPICKUP_EXCEPTION="<*amulet of life saving"
AUTOPICKUP_EXCEPTION="<*amulet called life"


Avoiding loadstones

This ruleset should never pick up a loadstone, regardless if you are blind or how well you know loadstones. You can still automatically pick up agate stones etc.

AUTOPICKUP_EXCEPTION=">*stone called loa*"
AUTOPICKUP_EXCEPTION=">*loadstone"
AUTOPICKUP_EXCEPTION=">*loadstone named *"
AUTOPICKUP_EXCEPTION=">*gray stone"
# #blind: glass/gems show up as gem, all else as stone.
AUTOPICKUP_EXCEPTION=">stone"
# # blessed, uncursed, cursed, greased
AUTOPICKUP_EXCEPTION=">*sed stone"

Using only exceptions

If you want only the exceptions to pick anything up, you would normally set pickup_tyes to "". Unfortunately, that picks up everything. The solution are iron balls:

OPTIONS=pickup_types:0
AUTOPICKUP_EXCEPTION=">*heavy iron ball*"

External references

Advertisement