Advertisement
lostcalpolydude

Best Zap Targets

Dec 16th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. # save as anything.ash, then run it for a sorted list of things
  2. # to zap, sorted by profitability
  3. # Since mafia uses the 5th cheapest price for items, scarce
  4. # items will have results that aren't sensible, so make sure
  5. # to manually check prices before committing to an item
  6. # Change threshold below to see more (or fewer) options
  7. int threshold = 10000;
  8. boolean only_use_inv = true;
  9.  
  10. record my_type
  11. {
  12. item itm;
  13. int price;
  14. };
  15.  
  16. my_type[int] prices;
  17.  
  18.  
  19. int get_price( item it )
  20. {
  21. if ( historical_age( it ) < 3 )
  22. {
  23. return historical_price( it );
  24. }
  25. return mall_price( it );
  26. }
  27.  
  28. foreach it in $items[]
  29. {
  30. if ( only_use_inv && item_amount( it ) == 0 ) continue;
  31. int[item] stuff = get_related( it, "zap" );
  32. if ( count( stuff ) != 0 & it.tradeable )
  33. {
  34. int total = 0;
  35. foreach x in stuff
  36. {
  37. total += get_price( x );
  38. }
  39. total /= count( stuff );
  40. total -= get_price( it );
  41. int priceindex = count(prices);
  42. prices[priceindex].itm = it;
  43. prices[priceindex].price = total;
  44. }
  45. }
  46.  
  47. sort prices by value.price;
  48.  
  49. foreach j in prices
  50. {
  51. if ( prices[j].price > threshold )
  52. {
  53. print_html( prices[j].itm + ": " + prices[j].price );
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement