Feature - Implemented Upkeep of glob of Blank-Out (perhaps similar to stickers or sugar)

VinnyB

Member
Is there a simple way to get mafia to notice when globs of Blank-Out run out? (The accompanying message is "As you're moseying, you notice that the last of the Blank-Out is gone, and that your hand is finally clean. Yay!") Heck, having it automatically use another bottle of Blank-Out seems like a reasonable default option.
 

lostcalpolydude

Developer
Staff member
There's probably someone out there that will want to use globs until they run out and save the other bottles for some later time. Making it an option could work, but making it the default doesn't seem good.
 

heeheehee

Developer
Staff member
Always, ashq if (!have_item($item[glob of blank-out])) use(1, $item[bottle of blank-out]);

Or something like that. Actually, you might need to make that more complicated, since Mafia doesn't necessarily know when your blank-out's gone.

Always, ashq if (run_combat().contains_text("last of the Blank-Out")) use(1, $item[bottle of blank-out]);

I'm assuming that run_combat() works nicely in this context.
 

antimarty

Member
Always, ashq if (!have_item($item[glob of blank-out])) use(1, $item[bottle of blank-out]);
Or something like that. Actually, you might need to make that more complicated, since Mafia doesn't necessarily know when your blank-out's gone.

Mafia (as of r8875) assumes that your glob of blank-out disappears when used the first time, so the have_item() doesn't work. Looking at the run_combat() text seems awkward; my own context was a slimeling run where my script runs the combats. I made my script look at the combat text, but that doesn't play nicely with a mood...

If mafia recognized that the glob was used up, so that have_item() returned the correct value, all would be well in my little world.
 

heeheehee

Developer
Staff member
Spam cli_execute("refresh inv") after each turn, then? There really isn't any clean fix aside from Mafia being patched to specifically check globs of blank-out.

I don't believe there's actually a precedent in terms of functionality, since other items that might be consumed upon use in combat (e.g. rogue swarmer) can just be updated by the next entered combat, so blank-out seems like it'd have to be hardcoded. edit: This is why you can use the run_combat() thingy, but I'm not sure how it plays with script-run combats. Will do some testing.

Also, have_item isn't actually a function built into Mafia. Should be item_amount($item[glob of blank-out]) > 0. Silly me, was thinking about skills. Probably.

yet another edit: Is it the use of run_combat() for something other than running a combat the part that's tripping you up? It's a "secret" bit of functionality that, whenever called outside a combat, it'll return the last page of combat you saw. So when called unconditionally by a mood, it'll always execute after finishing up whatever combat you were in. But yeah, documented in the Mafia wiki, although it's not the first thing that jumps out at you.
 
Last edited:

HippoKing

Member
Most simply,

Unconditional trigger
use bottle of blank-out

It'll only succeed if you don't have one - KoL handles that rather than Mafia.
 

Darzil

Developer
Whilst that is simple, it's at least five times as many server hits, which Mafia normally likes to reduce.
 

slyz

Developer
I don't think Mafia will try to use a blank-out if it thinks you don't have any in your inventory.

EDIT: it looks like Veracity fixed the problem =)
 
Top