Bug - Fixed Prefer free clovers over 150 meat clovers

Theraze

Active member
> inv clover

disassembled clover (3)
Requests complete.

> ash retrieve_item(1, $item[ten clover])

Verifying ingredients for ten-leaf clover (1)...
Purchasing chewing gum on a string (1 @ 50)...
You acquire an item: chewing gum on a string
You spent 50 Meat
Purchases complete.
Using 1 chewing gum on a string...
You acquire an item: worthless trinket
Finished using 1 chewing gum on a string.
Purchasing hermit permit (1 @ 100)...
You acquire an item: hermit permit
You spent 100 Meat
Purchases complete.
Creating ten-leaf clover (1)...
You acquire an item: ten-leaf clover
Successfully created ten-leaf clover (1)
Returned: true

Basically, I had 3 disassembled (free) clovers. Instead, retrieve_item purchased gum, used gum, bought a permit, and got a hermit clover. Any way we can prefer the existing clovers over paid ones? Thanks! :)
 

Veracity

Developer
Staff member
That's how it's currently coded to work: "creation" (using a disassembled clover) comes before using a coinmaster (the hermit) - unless your buyScript says to buy a clover at "level 2" (whatever that means).

I tested this on a multi who had visited the Hermit - and therefore knew that 3 clovers were available. (I initially tried with the same multi before visiting the hermit, so the clover quantity was unknown, and got the same result.)

> inv clover

disassembled clover (32)

> ash retrieve_item(1, $item[ten clover])

Verifying ingredients for ten-leaf clover (1)...
Creating ten-leaf clover (1)...
You acquire an item: ten-leaf clover
Successfully created ten-leaf clover (1)
Returned: true
Notice my "inv clover" result. As expected, it simply told me how many clovers I had.
Notice your "inv clover" result.

> inv clover

disassembled clover (3)
Requests complete.
Umm. "Requests complete"? What "requests"? Do you have an alias for "inv"?

And what is your buyScript set to?

Edit: You said:

Basically, I had 3 disassembled (free) clovers. Instead, retrieve_item purchased gum, used gum, bought a permit, and got a hermit clover.
Are you sure it got a hermit clover? I saw the purchase of gum and a permit - in the middle of item creation! - followed by what looks like creation-via-using a disassembled clover. What does your session log say? MINE says:

Use 1 ten-leaf clover
You acquire an item: disassembled clover
 
Last edited:

Theraze

Active member
It's possible that it reconnected around that inventory check... there's no inv alias. The buyScript is set to potionBuy, Bale's script that makes you buy potions if you aren't a Sauceror and can go to the mall.

Was thinking about it... any chance what it's doing is buying the worthless item and hermit permit to validate whether or not the hermit HAS clovers? This generally happens in runs where I haven't been using the hermit for other things yet that day.
 

Theraze

Active member
Here's it happening again... I'll post the log, then the alias that generally causes it to see if that might be the problem. It's the getrock alias posted earlier for relatively easy big-rock grabbing. First, the log. This happened twice today, both times purchasing the permit, on different characters.
cloverProtectActive => false
Verifying ingredients for ten-leaf clover (1)...
Purchasing chewing gum on a string (1 @ 50)...
You acquire an item: chewing gum on a string
You spent 50 Meat
Purchases complete.
Using 1 chewing gum on a string...
You acquire an item: ravioli hat
Finished using 1 chewing gum on a string.
Using cached search results for chewing gum on a string...
Purchasing chewing gum on a string (1 @ 50)...
You acquire an item: chewing gum on a string
You spent 50 Meat
Purchases complete.
Using 1 chewing gum on a string...
You acquire an item: worthless gewgaw
Finished using 1 chewing gum on a string.
Purchasing hermit permit (1 @ 100)...
You acquire an item: hermit permit
You spent 100 Meat
Purchases complete.
Creating ten-leaf clover (1)...
You acquire an item: ten-leaf clover
Successfully created ten-leaf clover (1)

Visit to Casino: Lemon Party in progress...

[348] Lemon Party
Encounter: big rock
You acquire an item: big rock

cloverProtectActive => true
Then, the alias:
getrock => ash if(item_amount($item[casino pass]) > 0 || my_meat() > 99) {retrieve_item(1,$item[casino pass]); if(my_meat() < 10) {print("You need at least 10 meat to play the slots!", "red"); exit;} string old=get_property("cloverProtectActive"); set_property("cloverProtectActive", "false"); if(item_amount($item[ten-leaf clover])+(item_amount($item[disassembled clover]) * to_int(my_path() != "Bees Hate You")) < 1) {if(closet_amount($item[ten-leaf clover]) > 0) take_closet(1, $item[ten-leaf clover]); else if(closet_amount($item[disassembled clover]) > 0 && my_path() != "Bees Hate You") take_closet(1, $item[disassembled clover]);} if(retrieve_item(1, $item[ten-leaf clover])) (!adventure(1, $location[Lemon Party])); else print("You need a clover to get your rock!"); set_property("cloverProtectActive", old);} else print("No access to the Casino.", "red");
 

Veracity

Developer
Staff member
Are you sure it got a hermit clover? I saw the purchase of gum and a permit - in the middle of item creation! - followed by what looks like creation-via-using a disassembled clover. What does your session log say?
Please? Pretty please?
 

Theraze

Active member
Sorry, missed that part of it. :) Here's the session log from that adventure 348.
buy 1 chewing gum on a string for 50 each from Market Demon
You acquire an item: chewing gum on a string
You spent 50 Meat

use 1 chewing gum on a string
You acquire an item: ravioli hat

buy 1 chewing gum on a string for 50 each from Market Demon
You acquire an item: chewing gum on a string
You spent 50 Meat

use 1 chewing gum on a string
You acquire an item: worthless gewgaw

buy 1 hermit permit for 100 each from Market Demon
You acquire an item: hermit permit
You spent 100 Meat
You acquire an item: ten-leaf clover

[348] Lemon Party
Encounter: big rock
You acquire an item: big rock
 

holatuwol

Developer
I can't reproduce this at all, and I don't have any worthless items in stock (so KoLmafia should have tried to retrieve some).

That being said, if you type in:

Code:
ash creatable_amount($item[ten-leaf clover]);

What does it say? Because the one thing I can think of is if KoLmafia thinks the amount is zero (which would be the case in bee-core or something).
 

Veracity

Developer
Staff member
That session log makes no sense at all. Here is an example of one of my session logs showing what I would expect to see if it traded a worthless item for a clover:

buy 1 hermit permit for 100 each from Market Demon
You acquire an item: hermit permit
You spent 100 Meat

trading 1 worthless item for 1 ten-leaf clover
You acquire an item: ten-leaf clover
Instead, you have nothing at all before the "you acquire an item: ten-leaf clover" line to indicate what you did to acquire it.
 

Theraze

Active member
Appears that hola might have hit on it...
> ash creatable_amount($item[ten-leaf clover])

Returned: 0

> inv clover

disassembled clover

> my_path

Returned: None

And since I didn't say it, that was using the 'base' (newly downloaded, unmodified or compiled by me) version of 9781.
 
Last edited:

holatuwol

Developer
Try actually telling KoLmafia to create the ten leaf clover and see if the concoction database spits out a reason for failure (disabling all the other methods of accessing a disassembled clover, like closet / clan stash)?

Code:
create 1 ten-leaf clover
 

Theraze

Active member
> creatable_amount ten-leaf clover

Returned: 0

> debugcreate ten-leaf clover

- worthless item limited to 0 by price 88
- ten-leaf clover limited to 0 by worthless item
ten-leaf clover.canMake(1) => 0

> inv clover

disassembled clover
 
Top