I'm working on a script that checks how many tiny plastic drinks I can make, but I've never used maps before, and I seem to be doing it wrong.
This gives me a wierd error:
Function 'available_amount( string )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (whatsdrinkable.ash, line 12)
I'm using the "total possible" example from the wiki, but I think there's some issues with the type. The example uses item afue = $item[scroll of ancient forbidden unspeakable evil]; but I tried item foo = $item[map1]; but that didn't work at all. The error was "Cannot store string in foo of type item (whatsdrinkable.ash, line 12)".
What am I doing wrong here?
Code:
string [int] map1;
map1[1] = "sangria del diablo";
map1[2] = "cherry bomb";
map1[3] = "bodyslam";
map1[4] = "grogtini";
map1[5] = "dirty martini";
map1[6] = "vesper";
for i from 1 to 6
{
print("Total possible " +map1[i]+ " is: " + to_string(available_amount(map1[i]) + creatable_amount(map1[i])));
}
This gives me a wierd error:
Function 'available_amount( string )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (whatsdrinkable.ash, line 12)
I'm using the "total possible" example from the wiki, but I think there's some issues with the type. The example uses item afue = $item[scroll of ancient forbidden unspeakable evil]; but I tried item foo = $item[map1]; but that didn't work at all. The error was "Cannot store string in foo of type item (whatsdrinkable.ash, line 12)".
What am I doing wrong here?
Last edited: