purchase the cheapest of a set of items

razorboy

Member
I'd like to write a script will purchase the cheapest of a set of items given to it. I'm thinking specifically of TPS fruit, but it could work for pine needles/chunk of rock salt, etc.

I just wanted to check if this functionality already exists. Has someone made a script that will do something like this, already?
 

Winterbay

Active member
You will never arrive at a better comparison than one of the 5 price of each item.

There is a CLI-command to find the cheapest of an item "cheapest[?] [+]item [,[-]item]... [; cmds] - compare prices, do cmds with "it" replaced with best.".
 

slyz

Developer
Here is an example of how "cheapest" works:
Code:
> cheapest lime, jumbo olive, cherry

Searching for "cherry"...
Search complete.
Searching for "jumbo olive"...
Search complete.
cherry @ 1,075
lime @ 1,075
jumbo olive @ 1,285
If you want to add commands that use the cheapest item, replace the item name by "it" in the commands:
Code:
> cheapest lime, jumbo olive, cherry; buy 1 it

Searching for "cherry"...
Search complete.
Purchasing cherry (1 @ 1,075)...
You acquire an item: cherry
Purchases complete.
And another little trick: a "+" in front of the item name will make Mafia consider all of that item's zap group:
Code:
> cheapest +cherry

cherry @ 1,075
lime @ 1,075
jumbo olive @ 1,285

> cheapest +divine

Searching for "divine"...
Search complete.
Searching for "gordon bennett"...
Search complete.
Searching for "mae west"...
Search complete.
Searching for "mon tiki"...
Search complete.
Searching for "gimlet"...
Search complete.
Searching for "mandarina colada"...
Search complete.
Searching for "prussian cathouse"...
Search complete.
Searching for "tangarita"...
Search complete.
Searching for "teqiwila slammer"...
Search complete.
Searching for "vodka stratocaster"...
Search complete.
Searching for "yellow brick road"...
Search complete.
gimlet @ 5,555
mandarina colada @ 5,599
prussian cathouse @ 5,700
tangarita @ 5,700
vodka stratocaster @ 5,700
yellow brick road @ 5,725
Divine @ 5,775
Gordon Bennett @ 5,790
Mae West @ 5,800
Neuromancer @ 5,800
teqiwila slammer @ 5,820
Mon Tiki @ 5,985

EDIT: unfortunately, there isn't an ASH equivalent. You would need to write that function yourself. But if you poke around these forums, you will probably find what you need.
 
Last edited:
Top