Advertisement
yojimbos_law

horrible script for potion acquisition in TCRS

May 22nd, 2019
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. cli_execute("refresh status");
  2. //familiar weight[itemname][effectname][duration][meat drop][item drop]
  3. int[item][effect][int][int][int] butt;
  4.  
  5. //hardcoded list of all meat/item/fam weight potions and their durations and other stuff.
  6. file_to_map("tcrs boa potions.txt",butt);
  7.  
  8. float[item] double_butt;
  9.  
  10. foreach first,second,third,fourth,fifth,sixth in butt{
  11. //print(first+" "+second+" "+third+" "+fourth+" "+fifth+" "+sixth);
  12. //compute half the profit from each potion to preserve mall supply.
  13. //use 20 meat/lb as lower bound for boa profit and 5 meat/+item% for contribution from spice melanges.
  14. double_butt[first] = (( (fifth * 5 + sixth * 20 ) * third ).to_float() / 2.0 - first.mall_price().to_float());
  15. //print(first+": "+double_butt[first]);
  16. cli_execute("refresh inventory");
  17. if(!(first == $item[pirate pamphlet])){
  18. cli_execute("try; acquire "+1000/third+" "+first);
  19. }
  20. else{
  21. if(available_amount(first) < 100){
  22. cli_execute("mallbuy 100 pirate pamphlet");
  23. }
  24. }
  25. if(second.have_effect() < 1000 && (double_butt[first] > 0.0 || first == $item[yellow candy heart] || first == $item[giant breath mint]) ){
  26. cli_execute("try; use "+max(((1000 - second.have_effect())/third),1)+" "+first);
  27. cli_execute("refresh inventory");
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement