A New Method Of Item Targeting

Date: 4/3/2014 at 22:27
From: Ieptix the Anomaly
To : Everyone
Subj: A New Method Of Item Targeting

I bring wonderful news for those of you who have ever been flummoxed and
vexed by the utter horror of trying to select a single item out of a
pile of five hundred copies of the same sort of item! Instead of having
to dig through and use the proper item number like some sort of savage,
I bring forth a better way for a more civilized era!

It is now possible to select the ith item in a room using the syntax
[<i>.]<item>, where `i` is an integer and `item` is any old item

So, how does this work, exactly? Let's break it down:

- If `item` is an item number, then the search will only and ever
attempt to find that specific item, regardless of the value of `i`.

- If `i` is a positive integer, then the item found will be the `i`th
item found whereever the searching is taking place. If the room has less
than `i` items of that match the `item` search, then the search fails.

- if `i` is either 0 or the word "last", then the search will return the
last `item` in the searched room.

- Otherwise, if `i` is none of the above (including not being present!),
the search will return the first `item` in the searched room. Note that
this means you can never use this feature, and everything will work
exactly as it did in the past.

Note, however, that this doesn't carry across search spaces*. For
example, if I use a command like PROBE that attempts to search both my
inventory and the room I'm in, each room will be searched for the ith
item separately.


Example time!

Say I am standing in a room with the following items, and I wish to
GET** a particular one:

1234h, 1234m ex- ih
"earwort36080" a group of 26 pieces of earwort
"earwort72942" a group of 17 pieces of earwort
"earwort72764" a group of 34 pieces of earwort
Number of objects: 4

If I want to be tedious and boring, I can get the second item using GET
72942, or I can GET 2.EARWORT and be awesome.

The last batch of earwort (#72764) can be obtained using the new syntax
via either GET 3.EARWORT or GET 0.EARWORT or GET LAST.EARWORT, though
note that the first choice here will not work if an earwort is removed,
and will still only grab #72764 if another is dropped in the room (even
though it is no longer the last item).

Attempting to GET EARWORT or GET 1.EARWORT or GET -10.EARWORT or GET
ROBOT.EARWORT will all return the first earwort in the room (#36080).



*I am currently looking into a similar syntax to specify where to search
(mainly inventory vs. room), but this is more difficult because
currently it will require updating every relevant command individually.
I'm working on figuring something out, though, so stay tuned!

** This should work for all commands that allow targeting of items. If
you happen to find any that don't work, or other issues with this
mechanic, please either message me or file a bug report.

Penned by My hand on the 23rd of Urlachmar, in the year 380 CE.