DanielT / NitroHack

A fork of NetHack 3.4.3
nitrohack.org
21 stars 2 forks source link

autopickup_rules can't tell if item is unpaid #11

Closed tung closed 12 years ago

tung commented 12 years ago

Try this:

  1. Find a shop with unpaid items on the ground.
  2. Ensure autopickup is on.
  3. In autopickup_rules, add a LEAVE rule for name pattern *unpaid*.
  4. In autopickup_rules, add a GRAB rule for all items.
  5. Walk over an unpaid item.

The player character will pick up the item, instead of leaving it as expected. There should be some way for autopickup_rules to tell if an item is unpaid.

DanielT commented 12 years ago

Right. I'd hit the same problem.

Change 9d7ef3904492ad26030c76577e17bc992f2dd5f8 makes this possible.

The core of the issue is that autopickup uses the description of the item on the floor for matching, but "(unpaid ...)" is only added when the item is in your inventory. However UnNetHack has this nice patch to show the cost of items that are on the floor without chatting. I've now imported that.

You'll want to match *zorkmid* though, because the descriptions look like a candle (20 zorkmids)