Now that there is a benefit for mafia to have matching names,
How does this "benefit" KoLmafia users who don't have the Florist?
(Just curious and not intending to start an argument).
Now that there is a benefit for mafia to have matching names,
The same way that exactly-matching monster names helps people without Manuel, I suppose.
foreach loc, plants in get_florist_plants() {
print( "Location '" + loc + "'" );
foreach plant in plants
print( " plant '" + plant + "'" );
}
foreach plant in get_florist_plants( to_location( loc ) ) {
print( " plant '" + plant + "'" );
}
You keep talking about a string key. I think you mean a "location" key, right?
And here is where having a location type vs. a string type is a little problem: if what you store is KoL's (possibly ambiguous) location names, how do you return the "correct" location value?Before I bother with that, KoL will hopefully deal with some locations having identical names (pre/post crypt cemetary, (un)hydrated desert). Eleron asked me before about having mafia location names match KoL location names (probably because it would let him use mafia data files for more stuff in kolproxy), and I said no because it would break scripts and bring no benefit to mafia users. Now that there is a benefit for mafia to have matching names, I asked him about bugging TPTB to provide unique location names, and he's going to work on that.
foreach loc, counter, plant in get_florist_plants() {
print( "Location '" + loc + "'" );
print( "Counter '" + counter + "'" );
print( "Plant '" + plant + "'" );
}
string [location][int] plants = get_florist_plants();
foreach loc in plants {
print( "Location '" + loc + "'" );
string [int] array = plants[ loc ];
foreach index in array {
string plant = array[index];
if ( plant != "" )
print( "Plant = " + plant );
}
}
> Florist.ash
Location 'The Mer-Kin Outpost'
Plant = Kelptomaniac
I've been messing with these functions and I've made some progress on automatically planting flowers, but for some reason get_florist_plants() doesn't list any flowers in Castle in the Clouds in the Sky (Top Floor), but the florist shows I have them planted there and the flowers show up in the used list properly. I planted them with the cli command, but that worked okay for The Spooky Forest.
I even tried logging out and back in.The only reason that should happen (especially after looking at the table of everything planted, which wipes mafia's list and parses it from scratch) is if KoL and mafia use different names for a location, but the castle stuff has already been updated to match, so I don't have any ideas for that.