Advertisement
kolpastebin

Burn warehouse keys on things you probably don't need.ash

Jan 1st, 2018
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.39 KB | None | 0 0
  1. //Spends warehouse keys on the consumables in a certian ratio, DOES NOT GET YOUR EQUIPMENT so do that first.
  2. //Not completely accurate.
  3.  
  4. //Edit these ratios:
  5. int [item] __setting_item_ratios;
  6. __setting_item_ratios[$item[mime army wine]] = 1; //hobopolis food is better
  7. __setting_item_ratios[$item[mime army rations]] = 1; //hobopolis drink is better
  8. __setting_item_ratios[$item[mime army superserum]] = 1; //spleen item, +HP% / DA / something effect
  9. __setting_item_ratios[$item[mime army camouflage kit]] = 1; //-15% combat item
  10.  
  11. void tryCoordinate(int [int] coordinate)
  12. {
  13. if (coordinate.count() != 3)
  14. return;
  15. visit_url("choice.php?whichchoice=1273&option=1&num1=" + coordinate[0] + "&num2=" + coordinate[1] + "&num3=" + coordinate[2]);
  16. }
  17.  
  18. void main()
  19. {
  20. boolean stop = false;
  21. foreach it in $items[mime army insignia (cryonics),mime army insignia (morale),mime army insignia (psychological warfare),mime army insignia (pyrotechnics),mime army insignia (sanitation),mime army insignia (espionage),mime army insignia (infantry),mime army insignia (intelligence),mime army infiltration glove,mime army challenge coin,mime army shotglass,miming corduroys,miming beret,miming gloves,miming boots,miming shirt]
  22. {
  23. if (it.available_amount() == 0)
  24. {
  25. print("Collect " + it + " first.", "red");
  26. stop = true;
  27. }
  28. }
  29. if (stop)
  30. return;
  31. visit_url("place.php?whichplace=crimbo17_silentnight&action=crimbo17_warehouse");
  32.  
  33. int [int][int] rations = {{1,1,7},{1,1,11},{1,1,30},{1,1,32},{1,1,37},{1,1,42},{1,1,75},{1,1,80},{1,1,81},{1,1,83},{1,1,86},{1,2,7},{1,2,13},{1,2,20},{1,2,26},{1,2,28},{1,2,44},{1,2,56},{1,2,61},{1,2,62},{1,2,65},{1,2,78},{1,2,92},{1,3,10},{1,3,38},{1,3,41},{1,3,59},{1,3,64},{1,3,66},{1,3,84},{1,3,85},{1,3,86},{1,4,5},{1,4,26},{1,5,4},{1,8,18},{1,16,3},{2,2,2},{2,3,4},{2,3,5},{2,3,7},{2,3,16},{2,8,82},{2,11,3},{2,16,53},{2,98,43},{3,1,80},{3,5,7},{3,28,96},{3,86,10},{4,19,26},{4,19,31},{4,19,42},{4,19,44},{4,19,46},{4,89,84},{4,89,88},{4,90,90},{4,90,94},{5,2,90},{5,19,79},{5,32,68},{6,17,19},{7,76,7},{9,9,1},{9,10,11},{10,1,5},{11,2,4},{11,11,8},{11,11,11},{11,11,22},{11,11,29},{11,11,31},{11,11,37},{11,11,42},{11,11,44},{11,12,13},{11,22,84},{11,53,90},{12,6,85},{12,20,17},{12,22,17},{12,23,34},{12,28,70},{12,31,99},{13,1,10},{13,14,15},{15,2,21},{16,16,42},{17,1,1},{17,2,82},{17,12,1},{17,17,17},{17,70,48},{18,1,3},{18,1,9},{18,1,16},{18,19,20},{18,69,39},{18,70,39},{19,86,2},{20,1,17},{20,78,95},{21,21,17},{23,1,8},{23,1,10},{23,1,13},{23,37,47},{23,37,67},{24,59,85},{25,1,8},{25,10,4},{28,1,1},{28,1,14},{28,1,21},{28,17,81},{30,30,31},{31,12,11},{32,12,18},{32,32,81},{33,32,34},{35,66,49},{37,7,1},{37,7,18},{37,7,27},{37,7,33},{37,7,41},{37,7,45},{37,7,50},{37,11,94},{37,11,99},{37,12,4},{37,12,14},{37,12,15},{37,12,22},{37,12,25},{37,23,23},{37,36,42},{39,2,23},{40,2,1},{46,46,11},{46,46,48},{46,46,57},{47,3,73},{47,48,49},{49,50,51},{50,50,51},{54,23,34},{58,85,58},{59,61,10},{59,61,22},{59,61,26},{59,61,56},{59,61,62},{59,61,67},{60,1,46},{61,45,99},{62,15,34},{62,20,3},{62,20,11},{69,23,37},{74,1,4},{75,75,75},{76,76,76},{76,99,21},{77,7,1},{77,7,8},{77,7,18},{77,7,22},{77,7,40},{77,7,45},{77,77,11},{77,77,55},{77,88,99},{79,56,90},{79,56,91},{80,1,2},{80,1,9},{80,2,95},{80,77,76},{80,80,80},{81,14,7},{82,2,1},{84,84,84},{85,85,85},{88,1,1},{90,2,10},{91,18,64},{91,91,91},{93,23,53},{93,47,71},{97,23,37},{98,98,98},{99,1,1},{99,66,33},{99,99,83},{100,45,99},{100,100,5},{100,100,24},{100,100,25},{100,100,39},{100,100,46},{100,100,66},{100,100,93},{100,100,96},{100,100,98}};
  34.  
  35. int [int][int] superserum = {{1,1,20},{1,1,68},{1,1,74},{1,1,78},{1,1,82},{1,1,85},{1,2,1},{1,2,18},{1,2,23},{1,2,24},{1,2,25},{1,2,27},{1,2,38},{1,2,51},{1,2,83},{1,2,88},{1,3,5},{1,3,14},{1,3,21},{1,3,33},{1,3,34},{1,3,40},{1,3,53},{1,3,83},{1,3,88},{1,4,20},{1,5,5},{1,5,6},{1,51,1},{1,44,29},{1,99,99},{1,100,2},{1,100,13},{2,1,90},{2,4,1},{2,5,14},{2,10,3},{2,82,17},{3,100,3},{4,1,3},{4,19,11},{4,19,22},{4,19,30},{4,19,47},{4,19,50},{4,19,52},{4,89,94},{5,4,80},{6,61,11},{7,24,44},{8,8,8},{9,4,55},{9,5,5},{9,12,12},{9,23,47},{10,1,10},{10,2,3},{10,10,37},{10,12,65},{10,31,50},{11,11,1},{11,11,2},{11,11,6},{11,11,20},{11,11,21},{11,11,32},{11,11,33},{11,11,45},{11,29,79},{11,55,99},{12,2,4},{12,25,77},{12,57,15},{13,1,5},{13,1,11},{13,69,42},{14,14,14},{16,24,42},{17,12,2},{17,12,5},{17,17,42},{18,1,15},{20,1,18},{20,46,77},{23,1,18},{23,19,81},{23,42,97},{23,47,99},{25,1,3},{25,72,34},{26,1,83},{26,27,28},{27,27,27},{27,28,29},{28,1,6},{28,1,25},{28,2,11},{29,12,79},{29,29,72},{30,30,32},{30,86,37},{32,26,36},{32,48,67},{34,86,20},{36,24,36},{36,49,64},{37,7,11},{37,7,44},{37,7,52},{37,12,9},{37,12,10},{37,12,13},{37,12,17},{37,12,23},{38,12,12},{40,1,1},{40,50,30},{40,100,99},{41,9,54},{41,9,57},{42,37,42},{46,46,25},{46,46,27},{46,46,32},{46,46,35},{46,46,40},{46,46,49},{46,46,60},{50,3,1},{50,55,50},{58,7,20},{59,10,3},{59,10,25},{59,61,19},{59,61,23},{59,61,24},{59,61,40},{59,61,43},{59,61,50},{59,61,95},{62,20,8},{63,38,10},{71,19,11},{71,71,71},{72,82,92},{74,1,2},{77,7,39},{77,7,52},{77,19,76},{77,77,22},{78,1,1},{80,1,6},{80,8,5},{81,28,8},{81,81,81},{84,74,64},{86,75,30},{89,79,45},{90,86,7},{93,23,1},{94,55,14},{97,37,23},{97,89,83},{99,1,8},{99,1,54},{99,2,2},{99,100,100},{100,1,2},{100,1,11},{100,1,20},{100,100,6},{100,100,7},{100,100,9},{100,100,17},{100,100,32},{100,100,54},{100,100,62},{100,100,90},{100,100,99}};
  36.  
  37. int [int][int] camouflage = {{1,1,26},{1,1,35},{1,1,56},{1,1,57},{1,1,97},{1,2,3},{1,2,4},{1,2,54},{1,2,69},{1,2,81},{1,2,84},{1,2,85},{1,3,28},{1,3,29},{1,3,30},{1,3,39},{1,3,67},{1,3,68},{1,3,69},{1,3,72},{1,3,73},{1,3,75},{1,3,76},{1,3,96},{1,4,10},{1,4,23},{1,4,31},{1,5,3},{1,9,7},{1,23,46},{1,31,59},{1,33,1},{1,34,33},{1,100,5},{2,1,2},{2,1,4},{2,2,1},{2,3,14},{2,4,2},{2,4,3},{2,4,8},{2,11,4},{3,1,32},{3,3,33},{3,5,8},{4,5,6},{4,10,67},{4,19,2},{4,19,10},{4,19,15},{4,19,24},{4,19,28},{4,19,37},{4,19,48},{4,34,77},{4,89,85},{4,96,96},{6,33,93},{7,7,7},{7,7,43},{8,13,21},{8,28,81},{9,9,12},{9,13,13},{10,5,92},{10,10,12},{10,10,38},{10,25,64},{11,11,28},{11,11,36},{11,11,43},{11,16,74},{11,22,44},{11,22,44},{11,23,36},{12,13,14},{12,39,6},{13,1,3},{13,1,13},{14,1,21},{14,17,93},{15,57,12},{16,16,16},{17,2,84},{17,2,85},{17,12,10},{17,12,13},{17,17,41},{17,23,45},{18,1,1},{18,1,6},{18,1,80},{18,14,1},{18,18,18},{19,3,81},{20,40,60},{23,1,6},{23,1,14},{23,1,21},{23,37,11},{24,1,1},{24,48,1},{25,1,1},{25,1,6},{25,24,25},{26,77,65},{27,18,67},{28,1,4},{28,1,9},{28,1,28},{28,1,30},{30,30,35},{31,41,59},{32,11,73},{34,12,77},{34,34,34},{36,36,36},{37,7,22},{37,7,30},{37,7,47},{37,7,55},{37,7,56},{37,7,65},{37,11,37},{37,12,6},{37,12,19},{37,23,42},{37,69,11},{39,39,39},{39,51,57},{39,95,95},{40,1,3},{40,1,12},{40,12,12},{40,42,24},{46,46,37},{46,46,39},{46,46,42},{46,46,44},{46,46,54},{47,47,42},{52,2,52},{53,54,55},{54,32,87},{54,86,20},{56,30,60},{57,12,15},{58,95,42},{59,10,14},{59,10,23},{59,10,24},{59,61,5},{59,61,35},{59,61,37},{59,61,42},{59,61,57},{59,61,61},{59,61,66},{59,61,69},{59,61,72},{59,61,87},{59,61,88},{61,45,98},{61,61,61},{62,20,4},{62,20,10},{70,80,90},{71,13,24},{73,11,47},{74,1,3},{74,33,92},{75,25,7},{77,7,4},{77,7,12},{77,7,20},{77,7,23},{77,7,30},{77,7,31},{77,12,13},{77,17,7},{77,17,51},{77,17,71},{77,21,50},{77,77,100},{80,1,8},{82,1,1},{82,81,80},{82,99,99},{84,72,12},{85,35,93},{93,23,37},{93,23,43},{93,58,81},{94,4,57},{97,1,1},{97,23,11},{98,12,12},{98,76,54},{99,1,5},{100,1,8},{100,6,100},{100,10,1},{100,10,60},{100,44,3},{100,49,2},{100,100,19},{100,100,30},{100,100,51},{100,100,55},{100,100,58}};
  38.  
  39. int [int][int] wine = {{1,1,8},{1,1,12},{1,1,16},{1,1,17},{1,1,25},{1,1,31},{1,1,43},{1,1,50},{1,1,64},{1,1,87},{1,1,90},{1,1,92},{1,2,11},{1,2,21},{1,2,37},{1,2,49},{1,2,99},{1,3,3},{1,3,9},{1,3,31},{1,3,36},{1,3,54},{1,3,57},{1,3,89},{1,4,8},{1,4,2},{1,5,1},{1,34,32},{1,34,37},{1,100,7},{1,100,12},{1,100,14},{1,100,16},{2,3,8},{2,3,10},{2,3,12},{2,3,81},{2,15,2},{3,13,37},{3,60,100},{4,1,1},{4,8,16},{4,19,18},{4,19,49},{4,19,55},{4,69,20},{5,12,13},{6,7,8},{6,17,90},{8,9,10},{8,15,17},{10,1,2},{10,10,11},{11,7,13},{11,11,3},{11,11,10},{11,11,14},{11,11,38},{11,23,58},{11,23,63},{12,15,57},{12,20,59},{12,24,17},{13,1,6},{13,2,91},{13,42,69},{14,48,50},{15,15,39},{17,12,6},{17,12,7},{17,12,8},{18,1,8},{18,1,11},{18,1,13},{18,1,25},{18,4,85},{18,22,22},{19,1,13},{19,59,73},{19,86,10},{20,4,5},{20,41,30},{21,7,21},{21,7,25},{23,1,16},{23,36,40},{24,24,24},{24,59,87},{25,1,100},{26,93,91},{27,77,9},{28,1,22},{28,1,24},{28,1,27},{28,3,96},{30,75,75},{30,100,1},{32,23,81},{33,48,51},{33,63,93},{36,44,25},{37,7,16},{37,7,26},{37,7,46},{37,7,62},{37,7,64},{37,11,100},{37,12,2},{37,12,8},{37,12,26},{37,12,28},{37,23,37},{40,1,7},{40,60,80},{41,9,56},{41,9,58},{41,14,52},{41,42,84},{42,13,69},{42,69,11},{46,46,26},{46,46,34},{46,46,55},{50,3,50},{50,4,1},{50,6,1},{50,8,1},{50,17,36},{51,35,10},{54,71,92},{55,45,35},{55,55,55},{59,10,15},{59,10,17},{59,10,21},{59,10,22},{59,61,18},{59,61,30},{59,61,36},{59,61,45},{59,61,47},{59,61,48},{59,61,68},{59,61,76},{59,61,79},{59,61,99},{61,45,100},{62,15,33},{63,63,63},{63,77,89},{64,8,12},{65,43,21},{66,44,92},{69,56,61},{73,11,32},{73,73,73},{74,1,5},{74,1,7},{74,3,27},{75,50,25},{77,7,9},{77,7,24},{77,7,33},{77,7,38},{77,7,49},{77,7,56},{77,22,50},{78,33,25},{79,52,3},{80,56,28},{83,59,20},{84,61,67},{87,87,87},{88,12,12},{90,48,27},{92,92,92},{97,97,97},{98,73,86},{99,1,9},{99,100,1},{100,1,21},{100,4,100},{100,5,100},{100,12,12},{100,12,13},{100,49,1},{100,49,3},{100,50,25},{100,50,50},{100,81,64},{100,100,2},{100,100,12},{100,100,22},{100,100,37},{100,100,41},{100,100,45},{100,100,53},{100,100,64},{100,100,67},{100,100,92}};
  40.  
  41. int [item][int][int] key_locations;
  42. key_locations[$item[mime army rations]] = rations;
  43. key_locations[$item[mime army superserum]] = superserum;
  44. key_locations[$item[mime army camouflage kit]] = camouflage;
  45. key_locations[$item[mime army wine]] = wine;
  46.  
  47.  
  48. int [item] desired_amounts;
  49. //desired_amounts[$item[mime army rations]] = 50;//100;
  50. //desired_amounts[$item[mime army superserum]] = 20;//59;
  51. //desired_amounts[$item[mime army camouflage kit]] = 50;//100;
  52. //desired_amounts[$item[mime army wine]] = 50;//100;
  53. //Calculate desired_amounts:
  54.  
  55. int keys_remaining = $item[warehouse key].item_amount();
  56.  
  57. int total_item_amount = keys_remaining;
  58. int total_ratios = 0;
  59. foreach it, ratio in __setting_item_ratios
  60. {
  61. total_item_amount += it.available_amount();
  62. total_ratios += ratio;
  63. }
  64.  
  65.  
  66.  
  67. foreach it, ratio in __setting_item_ratios
  68. {
  69. float percentage = to_float(ratio) / to_float(total_ratios);
  70. desired_amounts[it] = ceil(keys_remaining * percentage);
  71. }
  72. string output = "";
  73. int keys_used = 0;
  74. foreach it, amount in desired_amounts
  75. {
  76. if (output != "")
  77. output += ", ";
  78. output += amount + " " + it;
  79. keys_used += amount;
  80. }
  81. boolean ready = user_confirm("Use " + keys_used + " warehouse keys on " + output + "?");
  82. if (!ready)
  83. {
  84. print_html("Stopping.");
  85. return;
  86. }
  87.  
  88. foreach it in desired_amounts
  89. desired_amounts[it] += it.available_amount();
  90.  
  91. foreach it in desired_amounts
  92. {
  93. print_html("Earning " + desired_amounts[it] + " " + it);
  94. int key_position = it.available_amount();
  95. while (it.available_amount() < desired_amounts[it])
  96. {
  97. if ($item[warehouse key].item_amount() == 0) abort("no more keys");
  98. print_html("Need " + (desired_amounts[it] - it.available_amount()) + " more " + it + ".");
  99. int [int] coordinate = key_locations[it][key_position];
  100. tryCoordinate(coordinate);
  101. key_position += 1;
  102. }
  103.  
  104.  
  105. }
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement