/btp { var %counter = 1 var %cblines = $cb(0) var %looky = Funds:¯Gardener¯[Land]¯[Tree]¯[Bush]¯[Flower]¯[Grass] while (%counter <= %cblines) { if ($findtok(%looky,$gettok($cb(%counter),1,32),1,175) != $null) { var %btpblah = $ifmatch if (%btpblah == 1) { var %btpfunds = $remove($gettok($cb(%counter),2,32),£,$chr(44)) var %btptime = $gettok($cb(%counter),-1,32) } elseif (%btpblah == 2) { var %btpgards = $remove($gettok($cb(%counter),2,9),[,],$chr(44)) var %btpharvs = $remove($gettok($cb(%counter),4,9),[,],$chr(44)) } elseif (%btpblah isnum 3-7) { var % $+ btp $+ %btpblah $+ acres $remove($gettok($gettok($cb(%counter),2,9),1,32),[,$chr(44)) var % $+ btp $+ %btpblah $+ planted $remove($gettok($gettok($cb(%counter),3,9),1,32),[,$chr(44)) var % $+ btp $+ %btpblah $+ plants $remove($gettok($gettok($cb(%counter),4,9),1,32),[,$chr(44)) var % $+ btp $+ %btpblah $+ seeds $remove($gettok($gettok($cb(%counter),5,9),1,32),[,$chr(44)) var % $+ btp $+ %btpblah $+ planting 0 } } inc %counter 1 } if ((%btptime == Morning) || (%btptime == Midday)) { if ($calc(%btp4acres *180 - %btp4planted) != 0) { inc %btp4planting $ifmatch | dec %btp4plants $ifmatch } if ($calc(%btp5acres *360 - %btp5planted) != 0) { inc %btp5planting $ifmatch | dec %btp5plants $ifmatch } if ($calc(%btp6acres *800 - %btp6planted) != 0) { inc %btp6planting $ifmatch | dec %btp6plants $ifmatch } if ($calc(%btp7acres *1600 - %btp7planted) != 0) { inc %btp7planting $ifmatch | dec %btp7plants $ifmatch } var %btptruefunds = $calc(%btpfunds + 300*%btp4plants + 175* %btp5plants + 35* %btp6plants + 15* %btp7plants) var %btpnewacres = $int($calc($sqrt($calc((%btp3acres + 9.0556)^2 +14 + %btptruefunds /4500)) - %btp3acres - 9.0556)) var %btpendfunds = $calc(%btptruefunds - %btpnewacres *(9000* %btp3acres + 4500* %btpnewacres +18500 +360*175)) inc %btp5planting $calc(360* %btpnewacres) dec %btp5plants $calc(360* %btpnewacres) if (%btpendfunds < 0) { dec %btp5planting $calc($int($calc(%btpendfunds /-175)) +1) inc %btp5plants $calc($int($calc(%btpendfunds /-175)) +1) inc %btpendfunds $calc(175*(1 + $int($calc(%btpendfunds /-175)))) } if (%btp3seeds > $calc(%btpgards *100 - %btp4planting - %btp5planting - %btp6planting - %btp7planting )) { if (%btp3seeds > $calc(100*( %btpgards + %btpendfunds /2200)- %btp4planting - %btp5planting - %btp6planting - %btp7planting )) { inc %btpbuygards $int($calc(%btpendfunds /2200)) dec %btpendfunds $calc(%btpbuygards *2200) } inc %btpbuygards $int($calc((%btp3seeds + %btp4planting + %btp5planting + %btp6planting + %btp7planting - 100* %btpgards )/100 +1) dec %btpendfunds $calc(%btpbuygards *2200) } echo 7 -a %btptime echo 12 -a Sell $iif(%btp4planting == 0,a,$bytes(%btp4plants,b)) / $bytes(%btp5plants,b) / $iif(%btp6planting == 0,a,$bytes(%btp6plants,b)) / $iif(%btp6planting == 0,a,$bytes(%btp7plants,b)) plants echo 12 -a Buy %btpnewacres acres and set them to bush type echo 12 -a Plant %btp4planting / %btp5planting / %btp6planting / %btp7planting plants echo 12 -a Grow a / a / a / a echo 12 -a Buy %btpbuygards gards echo 12 -a You should be left with £ $+ $bytes(%btpendfunds ,b) } elseif (%btptime == Afternoon) { if ($calc(%btp4acres *180 - %btp4planted) != 0) { inc %btp4planting $ifmatch | dec %btp4plants $ifmatch } if ($calc(%btp5acres *360 - %btp5planted) != 0) { inc %btp5planting $ifmatch | dec %btp5plants $ifmatch } if ($calc(%btp6acres *800 - %btp6planted) != 0) { inc %btp6planting $ifmatch | dec %btp6plants $ifmatch } if ($calc(%btp7acres *1600 - %btp7planted) != 0) { inc %btp7planting $ifmatch | dec %btp7plants $ifmatch } var %btpneedharvs = $calc(42.64* %btp4acres +136.37* %btp5acres + 530.4* %btp6acres +2123.6* %btp7acres) var %btptruefunds = $calc(%btpfunds +300* %btp4plants +175* %btp5plants +35* %btp6plants +15* %btp7plants +2600* (%btpharvs - %btpneedharvs) + $iif(%btp3acres < 31,$calc(140* %btp4seeds +75* %btp5seeds +15* %btp6seeds +6* %btp7seeds),0)) var %btpnewacres = $int($calc($sqrt($calc((%btp3acres +48.46)^2 +92.81+ %btptruefunds /4500)) - %btp3acres -48.46)) var %btpendharvs = $int($calc(1+ 42.632* %btp4acres +136.37* %btp5acres +530.38* %btp6acres +2123.61* %btp7acres +136.37* %btpnewacres)) var %btpendfunds = $calc(%btptruefunds - %btpnewacres *(4500* %btpnewacres + 9000*%btp3acres +81500) -2200*(%btpendharvs - %btpneedharvs)) if (%btp3acres < 31) { var %btpendseeds = $int($calc(%btpendfunds / 75)) dec %btpendfunds $calc(%btpendseeds * 75) } elseif (%btpendfunds > $calc(9000*( %btp3acres + %btpnewacres ) -526000)) { inc %btpnewacres 1 dec %btpendfunds $calc(%btp3acres *9000 + 23000 + 300*175 + 136.37*2600) inc %btpendharvs 136.37 var %btpseedsell = $calc(1+ $int(%btpendfunds /75)) inc %btpendfunds $calc(%btpseedsell *75) } var %btpseedgrow = $calc(((7102.7* ( %btpnewacres + %btp3acres ) + %btp3seeds - 18012 +1989* $sqrt($calc(( %btp3acres + %btpnewacres )^2 + 197.1*( %btpnewacres + %btp3acres ) +96)))/300 - %btpgards - %btpendfunds /2200)/19.375) if (%btpseedgrow > 0) { if (%btpseedgrow > $calc(%btp5seeds - %btpseedsell)) { var %btpseedgrow = $calc(%btp5seeds - %btpseedsell) } } else { var %btpseedgrow = 0 } if ($calc(( %btp3acres + %btpnewacres ) *360*3*0.857/100 +0.01* %btp3seeds - %btpgards ) > 0) { inc %btpbuygards $int($calc(1 + $ifmatch )) dec %btpendfunds $calc(2200 * %btpbuygards) } echo 5 -a %btptime echo 12 -a Sell $iif(%btp4planting == 0,a,$bytes(%btp4plants,b)) / $bytes($calc(%btp5plants -360* %btpnewacres ),b) / $iif(%btp6planting == 0,a,$bytes(%btp6plants,b)) / $iif(%btp6planting == 0,a,$bytes(%btp7plants,b)) plants echo 12 -a Sell $iif(%btp3acres < 31,a,0) / $bytes($calc(%btp5seeds - %btpseedsell),b) / $iif(%btp3acres < 31),a,0) / $iif(%btp3acres < 31,a,0) seeds echo 12 -a Buy %btpnewacres acres and set them to bush type echo 12 -a Buy $bytes($calc(%btpendharvs - %btpharvs),b) harvesters and $bytes($iif(%btpbuygards,%btpbuygards,0),b) gardeners echo 12 -a Plant $bytes(%btp4planting,b) / $bytes(%btp5planting,b) / $bytes(%btp6planting,b) / $bytes(%btp7planting plants,b) echo 12 -a Grow 0 / $bytes(%btpseedgrow,b) / 0 / 0 echo 12 -a You should be left with £ $+ $bytes(%btpendfunds ,b) } elseif ((%btptime == Evening) || (%btptime == Midnight)) { echo 2 -a %btptime echo 12 -a Sell a / a / a / a plants var %btptruefunds = $calc(%btpfunds + 300* %btp4plants +175* %btp5plants +35* %btp6plants +15* %btp7plants) var %btpseedgrow = $calc((($iif(%btptime == Evening,5398.1,3693.6) * ( %btpnewacres + %btp3acres ) + %btp3seeds - 18012 +1989* $sqrt($calc(( %btp3acres + %btpnewacres )^2 + 197.1*( %btpnewacres + %btp3acres ) +96)))/300 - %btpgards - %btptruefunds /2200)/19.375) if (%btpseedgrow > 0) { if (%btpseedgrow > $calc(%btp5seeds - %btpseedsell)) { var %btpseedgrow = $calc(%btp5seeds - %btpseedsell) } } else { var %btpseedgrow = 0 } if ($calc(( %btp3acres + %btpnewacres ) *360* $iif(%btptime == Evening,2,1) *0.857/100 +0.01* %btp3seeds - %btpgards ) > 0) { inc %btpbuygards $int($calc(1 + $ifmtach )) dec %btptruefunds $calc(2200 * %btpbuygards) } echo 12 -a Buy $bytes($iif(%btpbuygards,%btpbuygards,0),b) gards echo 12 -a You should be left with $bytes(%btptruefunds,b) } elseif (%btptime == Hours) { echo 10 -a Early Hours echo 12 -a Sell a / a / a / a plants var %btptruefunds = $calc(%btpfunds + 300* %btp4plants +175* %btp5plants +35* %btp6plants +15* %btp7plants) if (%btpgards < $calc(%btp3seeds /100)) { if ($calc((%btpgards + %btptruefunds /2200)*100) <= %btp3seeds) { var %btpnewgards = $int($calc(%btptruefunds /2200)) } else { var %newgards = $int($calc(1+ %btp3seeds /100 - %btpgards)) } echo 12 -a Buy $bytes(%btpnewgards,b) gardeners } echo 12 -a Grow a / a / a / a seeds echo 12 -a You should be left with £ $+ $bytes($calc(%btptruefunds - 2200* %btpnewgards),b) } else { echo 12 -a Not implemented other seasons yet | halt } }