Pressing p while inside a shop will attempt to pay the nearest shopkeeper you can see - this will automatically pay any debts incurred from usage fees or used/destroyed items, then prompt you to ask for itemized billing. Selecting yes will allow you to pay for each item individually, while saying no will attempt to pay for all unpaid items at once. If in an area with multiple shopkeepers, such as Minetown, you will be prompted to select the shopkeeper you are paying via cursor.
The command can also be used outside of a shop, though in a majority of cases it will not do anything. However, if a shopkeeper is outside of their shop - e.g., chasing you down after you steal from them or damage their shop - you can use the pay command to cover any applicable debts or else try to pacify them. Using this with a shopkeeper that you did not steal from, but angered through other means, will attempt to give them 1000 zorkmids; this has a 2⁄3 chance of pacifying them.
- There appears to be no shopkeeper here to receive your payment.
- You used the pay command while not inside a shop.
- <Foo> is not near enough to receive your payment.
- As above, but you are outside a shop.
- <Foo> is not interested in your payment.
- You were prompted to select a monster to pay and chose a non-shopkeeper.
While payment is mostly restricted to use with shopkeepers in NetHack, variants may also employ it for additional purposes.