Bug - Not A Bug CLI 'drink 5 oh, the humanitini' drinks 6 instead

rlbond86

Member
I'll post the CLI output:

Code:
> drink 5 oh, the humanitini

Drinking 6 Oh, the Humanitini...
You gain 10 Adventures
You gain 19 Beefiness
You gain 19 Enchantedness
You gain 17 Sarcasm
You gain 36 hit points
You gain 2 Drunkenness
You lose some of an effect: Ode to Booze
You gain 11 Adventures
You gain 16 Beefiness
You gain 17 Wizardliness
You gain 19 Chutzpah
You gain 32 hit points
You gain 2 Drunkenness
You lose some of an effect: Ode to Booze
You gain 11 Adventures
You gain 19 Fortitude
You gain 18 Enchantedness
You gain 16 Smarm
You gain 33 hit points
You gain 2 Drunkenness
You lose some of an effect: Ode to Booze
You gain 10 Adventures
You gain 15 Muscleboundness
You gain a Muscle point!
You gain 19 Mysteriousness
You gain 15 Sarcasm
You gain 35 hit points
You gain 2 Drunkenness
You lose some of an effect: Ode to Booze
You gain 11 Adventures
You gain 16 Muscleboundness
You gain 22 Mysteriousness
You gain 19 Chutzpah
You gain 34 hit points
You gain 2 Drunkenness
You lose some of an effect: Ode to Booze
You gain 11 Adventures
You gain 19 Fortitude
You gain 21 Mysteriousness
You gain 15 Roguishness
You gain 40 hit points
You gain 2 Drunkenness
You lose some of an effect: Ode to Booze
Finished drinking 6 Oh, the Humanitini.
 

Veracity

Developer
Staff member
You can drink multiple things with one command. You separate them with a comma. So, you could do this:

> drink 2 green beer, 3 imp ale

and that is the equivalent of

> drink 2 green beer
> drink 3 imp ale

You typed:

> drink 5 oh, the humanitini

which is the equivalent of

> drink 5 oh
> drink the humanitini

Apparently, when considering items you had available to drink, both "oh" and "the humanitini" unambiguously matched "oh, the humanitini".

I think it is very clever of KoLmafia to recognize that the two items you asked it drink were really the same drink and to combine them into a single multi-drink request.
 
Is there a way to make mafia interpret commas as part of the name rather than as parameter separator? Putting it in quotes, maybe? Would
> drink "oh, the humanitini"
work, or would it consider the quotations as part of the item name?
 

Veracity

Developer
Staff member
There is no way to quote or escape things in the CLI. As coded, there is no unified syntax for commands, other than "the first word is the command and the rest of the line is the parameters". So, some commands - using items, selling items, what have you - allow comma-separated lists. Some simply have individual tokens separated by whitespace. Each command has its own way of splitting the "parameters" into chunks to look at.

I think that refactoring command parsing to be more uniform, allowing for quoting and escaping (at least in the commands where you can deal with multi-word parameters, like item names) is not a bad idea, but would be a huge amount of work. It's not something that I, personally, have any interest in tackling, although I won't deign to speak for other devs.

I expect that at this point, Theraze has already started composing a Feature Request.
 

Theraze

Active member
Meh, nah. If
drink oh\, the humanitini
doesn't work, and
ashq drink(1, $item[oh\, the humanitini])
don't work, then people should just let mafia's fuzzy matcher work on
drink oh the humanitini
and be happy. I've skipped out of quotes and apostrophes before because I wasn't sure where mafia would break the connection.
 

Bale

Minion
On my system I hold the alt key while typing 0182 on the keypad. Depending on your operating system it may be different.

So, yes. You do have to remember it. :D



Or I suppose you could just copy-paste...
 

Theraze

Active member
Or use $item[5590] and that should work as well, without needing to deal with charmap.exe or the horrors of alt-numpad on a laptop... Also, both to_item(5590) and to_item("5590") give the same results, so...
 

lostcalpolydude

Developer
Staff member
Well, $item[Oh, the Humanitini] works perfectly fine since mafia doesn't need to split the string inside there. An item name with ] in it would be interesting there. Using the CLI drink command means you aren't using ASH, and any effort to include ASH will be more than the effort of leaving out commas.
 
Top