matt.chugg
Moderator
I spent 20 minutes yesterday scanning the list of cookable and mixablie items in mafia gui, and comparing to my crafting page to see if I could cook/mix any booze/food that I hadn't already discovered to help me move closer to the discovery trophies.
Then I realized that with the right set of words, mafia could do it for me!
small function to scan through a list of all items, discover which ones are food/booze, determine if you can create one, check if your've already discovered one, then let you know
since this is discussion not repository heres a few points.
one, does mafia have select case ?
two, I'll probably add meat pastable items too, but i'm always wary of creating something with meatpaste incase I use something else important to create it.
three, should possible have an option to automatically cook, mix, paste (and possibly untinker) possible items to save more time.
four, will probably store each type (food, drink, meat pastable) in seperate arrays or something untill the end so that I can report each section together (only other way to do this is to loop each time, and is time conssuming.
five, do any of the functions I used hit the server (apart from visit_url of course)?
I remember someone doing a trophy progress script somewhere, this might be vaugly useful to them.
Then I realized that with the right set of words, mafia could do it for me!
small function to scan through a list of all items, discover which ones are food/booze, determine if you can create one, check if your've already discovered one, then let you know
Code:
void main() {
print("Getting list of discovered food...");
string foodpage = visit_url("craft.php?mode=discoveries&what=cook");
print("Getting list of discovered booze...");
string boozpage = visit_url("craft.php?mode=discoveries&what=cocktail");
print("Running comparison..");
//
// For loop Copyright (C) 1968 zarqon
//
for i from 1 to 4000 {
item currentitem = to_item(i);
string itemtype = item_type(currentitem);
if (itemtype == "food") {
if (creatable_amount(currentitem) > 0) {
if (!contains_text(foodpage, to_string(currentitem))) {
print(to_string(currentitem) + " (cookable)");
}
}
}
if (itemtype == "booze") {
if (creatable_amount(currentitem) > 0) {
if (!contains_text(boozpage, to_string(currentitem))) {
print(to_string(currentitem) + " (mixable)");
}
}
}
}
// takes a while to run! can't tell when its the end!
print("Comparison Complete!");
}
since this is discussion not repository heres a few points.
one, does mafia have select case ?
two, I'll probably add meat pastable items too, but i'm always wary of creating something with meatpaste incase I use something else important to create it.
three, should possible have an option to automatically cook, mix, paste (and possibly untinker) possible items to save more time.
four, will probably store each type (food, drink, meat pastable) in seperate arrays or something untill the end so that I can report each section together (only other way to do this is to loop each time, and is time conssuming.
five, do any of the functions I used hit the server (apart from visit_url of course)?
I remember someone doing a trophy progress script somewhere, this might be vaugly useful to them.
Last edited: