Bug - Fixed r9984 - buy(int,item) doesn't use the proper NPC shop for daily_special()

Fluxxdog

Active member
Code:
> ash daily_special()

Returned: tobiko-infused sake
<snip>

> ash buy(1,$item[tobiko-infused sake])

Searching for "tobiko-infused sake"...
Search complete.
Purchasing tobiko-infused sake (1 @ 440)...
You acquire an item: tobiko-infused sake
Purchases complete.
Returned: true
ashwiki said:
Without the optional price parameter, first preference is given to NPC stores when attempting purchases, after which it will attempt to use the mall.
I would expect it to buy from the Micromicrobrewery for 15 meat rather than the mall for 440.
 

zarqon

Well-known member
It probably slipped your mind that drinks from the microbrewery are consumed upon purchase. You wanted to buy one, not drink one.

I could understand this bug report if you'd said that drink() or eat() was buying from the mall rather than an NPC shop, but for buy() this is intended (and desirable) behavior.
 

lostcalpolydude

Developer
Staff member
> ash daily_special()

Returned: liver popsicle
<stuff>

> ash eat(1,$item[liver popsicle])

You need 1 more liver popsicle to continue.
Returned: false

> pref autosatisfywithnpc

autoSatisfyWithNPCs (global, now 'true', default false)
 

Veracity

Developer
Staff member
As zarqon clearly explained, it is Not A Bug that "buy" does not get a daily special. However:

ashq print( daily_special() )

tobiko-infused sake

From Item Manager:
Purchasing tobiko-infused sake at the The Gnomish Micromicrobrewery...
You gain 15 Adventures
You gain 8 Strongness
You gain 9 Magicalness
You gain 7 Roguishness
You acquire an effect: Pisces in the Skyces (duration: 30 Adventures)
You gain 3 Drunkenness
You spent 15 Meat
You lose some of an effect: Ode to Booze
Goodie purchased.

CLI command:
> drink 1 tobiko-infused sake

Purchasing tobiko-infused sake at the The Gnomish Micromicrobrewery...
You gain 9 Adventures
You gain 6 Strengthliness
You gain 7 Mysteriousness
You gain 7 Roguishness
You acquire an effect: Pisces in the Skyces (duration: 30 Adventures)
You gain 3 Drunkenness
You spent 15 Meat
You lose some of an effect: Ode to Booze
Goodie purchased.

ASH function:
> ash drink(1,$item[tobiko-infused sake])

Verifying ingredients for tobiko-infused sake (1)...
You need 1 more Ye Wizard's Shack snack voucher to continue.
Returned: false

Turning off auto-satisfy with Coinmaster:
> ash drink(1,$item[tobiko-infused sake])

You need 1 more tobiko-infused sake to continue.
Returned: false
Considering that the drink() function calls the CLI drink command, this is a little puzzling.
 

Veracity

Developer
Staff member
The "drink" and "eat" commands had special handling such that an item name that matches something on the restaurant, brewery, or kitchen menu would buy from the appropriate cafe. The eat() and drink() ASH functions pass in a specially delimited item id rather than an item name.

> ash drink(1,$item[tobiko-infused sake])

Visiting The Gnomish Micromicrobrewery...
Menu retrieved.
Purchasing tobiko-infused sake at the The Gnomish Micromicrobrewery...
You gain 11 Adventures
You gain 7 Beefiness
You gain 6 Mysteriousness
You gain 8 Roguishness
You acquire an effect: Pisces in the Skyces (duration: 30 Adventures)
You gain 3 Drunkenness
You spent 15 Meat
You lose some of an effect: Ode to Booze
Goodie purchased.
Returned: true
Revision 9990
 
Top