Bug - Fixed guardians() gives blank page error if character has no turns left

Bale

Minion
Going through strange RFIs on the wiki sometimes leads to unexpected results. Here's what happens if I have insufficient adventures while using the poorly known guardians() command:

Code:
[COLOR="#808000"]> ash print( guardians() );[/COLOR]

Checking prerequisites...
Climbing the tower...
Fighting guardian on level 5 of the tower...

[1016] Sorceress Tower: Level 5
Encounter: concert pianist
Round 0: bale wins initiative!
Round 1: bale uses the Knob Goblin firecracker!
After Battle: Enn Reitel leans against a cactus, produces a bottle of tequila, and drinks it. A few minutes later, he belches some murky fluid back into the bottle and hands it to you.
You acquire an item: agua de vida
You gain 14 Muscleboundness
You gain 12 Enchantedness
You gain 14 Smarm
[COLOR="#ff0000"]Server www3.kingdomofloathing.com returned a blank page from lair6.php. Complain to Jick, not us.[/COLOR]

[COLOR="#808000"]> ash guardians()[/COLOR]

Checking prerequisites...
Climbing the tower...
[COLOR="#ff0000"]Server www3.kingdomofloathing.com returned a blank page from lair6.php. Complain to Jick, not us.[/COLOR]
I'm pretty sure it shouldn't have tried to do that without any adventures simply because nothing else makes mafia adventure when it is out of adventures.

I admit I'm not real sure what the return value for guardians() should be when it is out of adventures, but that is probably not it. Perhaps it would be good if it returned $item[steaming evil] in that case. ;)
 

Bale

Minion
Another odd thing about guardians() is that it will deal with the door code, shadow and sorcesses' giant familiars. That seems odd since there is also a chamber() command, but I cannot exactly call it a bug. It should probably leave all those other things to the chamber() command though, since returning an item seems odd if it handles those obstacles.
 

jasonharper

Developer
r8323 should abort on lack of adventures, rather than try to do the next tower step...

The return value of guardians() isn't very useful; other than the cases that return a required item, the only distinction between success and failure is whether an error was generated - and the act of doing anything with the return value captures any error, losing it. About the only thing that could be done would be to make up a required item to indicate each possible error state:

* Prerequisites not met, you shouldn't be here at all => disembodied brain
* Out of adventures => bottle of time juice
* Stats too low => ultimate wad
* Already defeated NS => instant karma
* Server-side change detected => bugfinder blade
* Door code couldn't be solved => sack of doorknobs
* Insufficient healing items for Shadow => scroll of drastic healing
* Failed to defeat Shadow => consolation ribbon
* Unable to restore 50HP to face a giant familiar => pungent unguent
* Don't have needed familiar => corresponding hatchling
* Unable to buff to 20 lbs. => lead necklace

(The above isn't really intended as a serious suggestion, but I don't really have a better one to offer - short of rewriting KoLmafia to have a proper exception-handling mechanism, which I don't have time to do today. And I mean "today" in the same sense as the Tweedleporium jam not being available today.)
 

Bale

Minion
Thank you for the sanity check to this command.

* Prerequisites not met, you shouldn't be here at all => disembodied brain
* Out of adventures => bottle of time juice
* Stats too low => ultimate wad
* Already defeated NS => instant karma
* Server-side change detected => bugfinder blade
* Door code couldn't be solved => sack of doorknobs
* Insufficient healing items for Shadow => scroll of drastic healing
* Failed to defeat Shadow => consolation ribbon
* Unable to restore 50HP to face a giant familiar => pungent unguent
* Don't have needed familiar => corresponding hatchling
* Unable to buff to 20 lbs. => lead necklace
LOL! That is awesome. Funny and practical BOTH! Could you implement it? Please!

Though, insufficient healing items for the Shadow should be => red pixel potion
 

StDoodle

Minion
As humorous as that suggestion is, I'd prefer that if time were spent on guardians(), it was spent de-coupling the tower climb from the top of the tower. Not really a huge deal, but just sayin'...
 

StDoodle

Minion
Just bumping this, as I really, really like to change my equipment & buffs out between the tower (where I'm maximizing ML / stats, since I'm going to win anyway) and the shadow (where I'm maximizing initiative, and doing stuff with HP that depends on the situation).

Edit to add: It also used my red pixel potion, which I prefer to save for the NS if it is at all possible to defeat the shadow without it. :(

(Not huge, as this was a lazy run, hence why I was trying these out.)
 

bumcheekcity

Active member
Could there be a form of guardians() that returns strings of item name or "ERROR: Shadow not defeated" or something? Then we could:

Code:
if (contains_text(guardians(), "ERROR:")) {
//some switch statement
} else {
item i = to_item(guardians());
//get the item somehow.
}
 
Last edited:
Top