darkcodelagsniper
Member
I had that problem, seems the CLI command doesn't want the "cuppa " part. "teatree royal tea" works fine.
cli_execute("teatree" + ( $item[cuppa that I want to summon].to_string().substring(6) ) );
void mallcuppa(boolean silent) {
int[item]prices;
item[int]cuppas;
float pricetotal;
for i from 8601 to 8637 {
item tea = to_item(i);
cuppas[count(cuppas)]=tea;
prices[tea] = mall_price(tea);
pricetotal += prices[tea];
}
sort cuppas by 0-mall_price(value);
pricetotal /= 37;
int avgprice = pricetotal;
print("Avg value " + avgprice + " meat, total = " + (avgprice * 3),"blue");
print("Best tea is " + cuppas[0] + " at " + prices[cuppas[0]] + " meat","blue");
string cuppacmd;
string cuppaconfirm;
if (avgprice*3 > prices[cuppas[0]]) {
cuppacmd = "shake";
cuppaconfirm = "Shake teatree?";
}
else {
cuppacmd = cuppas[0].to_string().substring(6);
cuppaconfirm = "Pick " + cuppacmd + " from teatree?";
}
if (silent || user_confirm(cuppaconfirm)) cli_execute("teatree " + cuppacmd);
}
Avg value 53545 meat, total = 160635
Best tea is cuppa Royal tea at 950000 meat
int price(item it) {
return historical_age(it) > .8? mall_price(it): historical_price(it);
}
// mallcuppa by darkcodelagsniper
void mallcuppa(boolean silent) {
item [int] cuppas;
float pricetotal;
for i from 8601 to 8637 {
item tea = to_item(i);
cuppas[ count(cuppas) ]=tea;
pricetotal += price(tea);
}
sort cuppas by -price(value);
int shaketree = pricetotal * 3 / 37;
if(!silent) {
print("Avg value from shaking the tree is " + shaketree + " meat","blue");
print("Best tea is " + cuppas[0] + " at " + historical_price(cuppas[0]) + " meat","blue");
}
string cuppacmd;
string cuppaconfirm;
if(shaketree > historical_price(cuppas[0])) {
cuppacmd = "shake";
cuppaconfirm = "Shake teatree?";
} else {
cuppacmd = cuppas[0].to_string().substring(6);
cuppaconfirm = "Pick " + cuppacmd + " from teatree?";
}
if(silent || user_confirm(cuppaconfirm))
cli_execute("teatree " + cuppacmd);
}
teatree shake | [tea name] - Harvest random or specific tea
$CUSTOM|Combo|Teatree|_pottedTeaTreeUsed|$ITEM|Activi tea|false|teatree Activi tea|$ITEM|shake the tree|false|teatree shake|$ITEM|Activi tea|false|teatree Activi tea|$ITEM|Alacri tea|false|teatree Alacri tea|$ITEM|Boo tea|false|teatree Boo tea|$ITEM|Chari tea|false|teatree Chari tea|$ITEM|Craft tea|false|teatree Craft tea|$ITEM|Cruel tea|false|teatree Cruel tea|$ITEM|Dexteri tea|false|teatree Dexteri tea|$ITEM|Feroci tea|false|teatree Feroci tea|$ITEM|Flamibili tea|false|teatree Flamibili tea|$ITEM|Flexibili tea|false|teatree Flexibili tea|$ITEM|Frost tea|false|teatree Frost tea|$ITEM|Gill tea|false|teatree Gill tea|$ITEM|Impregnabili tea|false|teatree Impregnabili tea|$ITEM|Improprie tea|false|teatree Improprie tea|$ITEM|Insani tea|false|teatree Insani tea|$ITEM|Irritabili tea|false|teatree Irritabili tea|$ITEM|Loyal tea|false|teatree Loyal tea|$ITEM|Mana tea|false|teatree Mana tea|$ITEM|Mediocri tea|false|teatree Mediocri tea|$ITEM|Monstrosi tea|false|teatree Monstrosi tea|$ITEM|Morbidi tea|false|teatree Morbidi tea|$ITEM|Nas tea|false|teatree Nas tea|$ITEM|Net tea|false|teatree Net tea|$ITEM|Neuroplastici tea|false|teatree Neuroplastici tea|$ITEM|Obscuri tea|false|teatree Obscuri tea|$ITEM|Physicali tea|false|teatree Physicali tea|$ITEM|Proprie tea|false|teatree Proprie tea|$ITEM|Royal tea|false|teatree Royal tea|$ITEM|Serendipi tea|false|teatree Serendipi tea|$ITEM|Sobrie tea|false|teatree Sobrie tea|$ITEM|Toast tea|false|teatree Toast tea|$ITEM|Twen tea|false|teatree Twen tea|$ITEM|Uncertain tea|false|teatree Uncertain tea|$ITEM|Vitali tea|false|teatree Vitali tea|$ITEM|Voraci tea|false|teatree Voraci tea|$ITEM|Wit tea|false|teatree Wit tea|$ITEM|Yet tea|false|teatree Yet tea
Bale means that all necessary support for the tea tree has been implemented. A built-in teatree deed would be a new feature request.
Here's a custom deed for it that should work (untested):
Code:$CUSTOM|Combo|Teatree|_pottedTeaTreeUsed|$ITEM|Activi tea|false|teatree Activi tea|$ITEM|shake the tree|false|teatree shake|$ITEM|Activi tea|false|teatree Activi tea|$ITEM|Alacri tea|false|teatree Alacri tea|$ITEM|Boo tea|false|teatree Boo tea|$ITEM|Chari tea|false|teatree Chari tea|$ITEM|Craft tea|false|teatree Craft tea|$ITEM|Cruel tea|false|teatree Cruel tea|$ITEM|Dexteri tea|false|teatree Dexteri tea|$ITEM|Feroci tea|false|teatree Feroci tea|$ITEM|Flamibili tea|false|teatree Flamibili tea|$ITEM|Flexibili tea|false|teatree Flexibili tea|$ITEM|Frost tea|false|teatree Frost tea|$ITEM|Gill tea|false|teatree Gill tea|$ITEM|Impregnabili tea|false|teatree Impregnabili tea|$ITEM|Improprie tea|false|teatree Improprie tea|$ITEM|Insani tea|false|teatree Insani tea|$ITEM|Irritabili tea|false|teatree Irritabili tea|$ITEM|Loyal tea|false|teatree Loyal tea|$ITEM|Mana tea|false|teatree Mana tea|$ITEM|Mediocri tea|false|teatree Mediocri tea|$ITEM|Monstrosi tea|false|teatree Monstrosi tea|$ITEM|Morbidi tea|false|teatree Morbidi tea|$ITEM|Nas tea|false|teatree Nas tea|$ITEM|Net tea|false|teatree Net tea|$ITEM|Neuroplastici tea|false|teatree Neuroplastici tea|$ITEM|Obscuri tea|false|teatree Obscuri tea|$ITEM|Physicali tea|false|teatree Physicali tea|$ITEM|Proprie tea|false|teatree Proprie tea|$ITEM|Royal tea|false|teatree Royal tea|$ITEM|Serendipi tea|false|teatree Serendipi tea|$ITEM|Sobrie tea|false|teatree Sobrie tea|$ITEM|Toast tea|false|teatree Toast tea|$ITEM|Twen tea|false|teatree Twen tea|$ITEM|Uncertain tea|false|teatree Uncertain tea|$ITEM|Vitali tea|false|teatree Vitali tea|$ITEM|Voraci tea|false|teatree Voraci tea|$ITEM|Wit tea|false|teatree Wit tea|$ITEM|Yet tea|false|teatree Yet tea
alternatively, guard the aborting command with a "try":
try ; teatree whatevertea