price.ash: learn how much an item costs, courtesy items.ofloathing.org

ki77bot

Member
Or my personal favorite:
Code:
cheapest +tangarita; buy 4 it; drink 4 it;
The + means it will search the zap group!

Is there a way of doing that in ash, and I don't mean via cli_execute. I'm looking for a way I can use/define the 'variable' it in ash.

Cheers,
ki77bot.
 

jasonharper

Developer
Is there a way of doing that in ash, and I don't mean via cli_execute. I'm looking for a way I can use/define the 'variable' it in ash.
Unfortunately, no; there's no current ASH access to the zap group info, and the zapgroups.txt file doesn't have the structure required to be read into a map so you could parse it yourself.

If for some reason you can't look up the members of the zap group ahead of time and enter them into your script explicitly, the best you could do at the moment would be:
cli_execute("cheapest +tangarita; set temp=it");
and then look at get_property("temp").

If I've misunderstood your question, and what you were wanting to know is how to duplicate "cheapest" itself in ASH, rather than its +zapgroup feature in specific, what you'd need to do is build an array with all the items of interest, sort it by mall_price(value), then look at element 0 of the array for the cheapest item.
 

ki77bot

Member
Yes, the first part of your post answers perfectly what I was looking for. (The second part describes what I've been doing so far. But as I try to look for solutions with less code, the cheapest function is greatly welcome :D).

Thanks a lot.

Cheers,
ki77bot.
 
Top