landstander
New member
I'm returning to kol after nearly a decade away, crazy this game is still kicking. I see some of your names and get flashbacks and nostalgia from high school. Its kind of weird.
Anyway, I need to farm a bunch of meat to make up for giving all my sweet loot away and I am trying to make my farming script smart enough to check mall prices of +meat% and +familiar weight items and buy them if their cost is cheaper than what I expect to get from the bonus. Something like
Ideally I would be able to loop over items looking for ones that contains meat/item/familiar buffs so I wouldnt need to keep hard coded lists around I'd need to update to take advantage of new items. The problem is I cant find any way of determining what the meat (/item/familiar weight/foo) buff and number of turns an effect lasts at runtime. I can get the item, the effect and the "effect modifier" but never enough information to do what I need.
I found the source file kolmafia uses internally (from what I can tell): https://sourceforge.net/p/kolmafia/code/HEAD/tree/src/data/modifiers.txt which is probably perfect but I dont think I can make use of it and I see other scripts seemingly making their own databases that end up in the data/ in the installation directiony.
Am I missing something obvious? Is there a simpler way? At this point I'll just hard code my own lists when I have time, I havent figured out how to do file IO yet, need to dig into a more complicated script like Universal Recovery to see what they do. Any tips are appreciated, thanks.
Anyway, I need to farm a bunch of meat to make up for giving all my sweet loot away and I am trying to make my farming script smart enough to check mall prices of +meat% and +familiar weight items and buy them if their cost is cheaper than what I expect to get from the bonus. Something like
Code:
boolean is_meat_item_economical(item i, int meat_per_adv, float meat_buff_percent, int turns){
int purchase_price = mall_price(i);
return ((meat_per_adv * meat_buff_percent) * turns) > purchase_price;
}
Ideally I would be able to loop over items looking for ones that contains meat/item/familiar buffs so I wouldnt need to keep hard coded lists around I'd need to update to take advantage of new items. The problem is I cant find any way of determining what the meat (/item/familiar weight/foo) buff and number of turns an effect lasts at runtime. I can get the item, the effect and the "effect modifier" but never enough information to do what I need.
Code:
void main(){
print($item[love song of icy revenge]);
print(effect_modifier($item[love song of icy revenge], "effect"));
print(numeric_modifier(effect_modifier($item[love song of icy revenge], "effect"), "familiar weight"));
}
Prints:
love song of icy revenge
Cold Hearted
1.0
I found the source file kolmafia uses internally (from what I can tell): https://sourceforge.net/p/kolmafia/code/HEAD/tree/src/data/modifiers.txt which is probably perfect but I dont think I can make use of it and I see other scripts seemingly making their own databases that end up in the data/ in the installation directiony.
Am I missing something obvious? Is there a simpler way? At this point I'll just hard code my own lists when I have time, I havent figured out how to do file IO yet, need to dig into a more complicated script like Universal Recovery to see what they do. Any tips are appreciated, thanks.