Sure...
if($c->money > 100,000,000) {
// buy food
// place food on market @$400
}
I noticed you already have a destock function, so at end of set, have the bots destock the $400 food.
Eventually the bushels will drop off market., so....
Have another function that:
if($c->food > 2,000,000) {
// place all food on market @$400 (if farmer) (but leave X amount on hand for other classes)(x amount has already been programmed into your code)
}
Both of these would prevent the bots from stocking over 100mil cash / 2mil food.
both codes should be placed just after:
if(!$c->turns%5){ //Grab new copy every 5 turns
$main = get_main(); //Grab a fresh copy of the main stats //we probably don't need to do this *EVERY* turn
$c->money = $main->money; //might as well use the newest numbers?
$c->food = $main->food; //might as well use the newest numbers?
$c->networth = $main->networth; //might as well use the newest numbers?
$c->oil = $main->oil; //might as well use the newest numbers?
$c->pop = $main->pop; //might as well use the newest numbers?
$c->turns = $main->turns; //This is the only one we really *HAVE* to check for
}
== place it here ===
Edited By: Celphi on May 5th 2015, 21:50:00. Reason: [ Irrelevant ]