Advertisement
Ferric

Untitled

Feb 1st, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.06 KB | None | 0 0
  1. import static org.rev317.min.api.methods.Players.getMyPlayer;
  2.  
  3. import java.awt.*;
  4. import java.io.IOException;
  5. import java.net.URL;
  6.  
  7. import org.parabot.environment.api.interfaces.Paintable;
  8. import org.parabot.environment.api.utils.Time;
  9. import org.parabot.environment.scripts.Category;
  10. import org.parabot.environment.scripts.Script;
  11. import org.parabot.environment.scripts.ScriptManifest;
  12. import org.parabot.environment.scripts.framework.LoopTask;
  13. import org.rev317.min.api.events.MessageEvent;
  14. import org.rev317.min.api.events.listeners.MessageListener;
  15. import org.rev317.min.api.methods.Inventory;
  16. import org.rev317.min.api.methods.Menu;
  17. import org.rev317.min.api.methods.Players;
  18. import org.rev317.min.api.methods.Skill;
  19. import org.rev317.min.api.wrappers.Item;
  20. import org.rev317.min.api.wrappers.Player;
  21.  
  22. @ScriptManifest(author = "God Poe X D",
  23. category = Category.COMBAT, description = "Makes you santaly",
  24. name = "AutoEater 0.6",
  25. servers = { "Ikov" },
  26. version = 0.6)
  27.  
  28. public class Autoeater extends Script implements Paintable, MessageListener, LoopTask {
  29.  
  30. String status = "Idling...";
  31.  
  32. boolean ragbot420 = true;
  33. boolean isOnCurses = false;
  34.  
  35. int restoreID;
  36. int[] restoresIDs = {14416, 14414, 14412, 14410, 14408, 14406, 3025, 3027, 3029, 3031};
  37. int restoreArrayID = 0;
  38.  
  39. int brewID;
  40. int[] brewIDs = {14129, 14127, 14125, 14123, 14420, 14418, 6686, 6688, 6690, 6692};
  41. int brewArrayID = 0;
  42.  
  43. int foodID = 0;
  44. int[] foodIDs = {1386, 392, 15273};
  45. int foodArrayID = 0;
  46.  
  47.  
  48. Character target;
  49. Player[] targetArray;
  50.  
  51. @Override
  52. public int loop() {
  53. checkPrayerBook();
  54. Time.sleep(50); //to slow program to prevent lagg
  55.  
  56. if (ragbot420 == true) {
  57.  
  58. if ((Inventory.containts(6692, 6690, 6688, 6686, 14418, 14420, 14123, 14125, 14127, 14129) //check to see if i still have either brews
  59. || Inventory.containts(1386, 392, 15273)) //or food
  60. && Inventory.containts(3031, 3029, 3027, 3025, 14406, 14408, 14410, 14412, 14414, 14416)) { //check to see if i still have restores
  61.  
  62. if (Skill.PRAYER.getLevel() < 1) { //if smited then try to tele, need to improve this cuz tb + dbow = ez divine
  63.  
  64. status = "Smited. Panic mode = true";
  65. teleToHome(); //tries to tele
  66.  
  67. while (Skill.PRAYER.getLevel() < 20) {
  68.  
  69. drinkRestore(); //spams restore, it's a while loop so that it wont brew
  70. Time.sleep(300);
  71. }
  72.  
  73. reactivatePray();
  74. }
  75.  
  76. if (Skill.PRAYER.getLevel() < 66) { //check if i need to ppot
  77.  
  78. status = "Prayer low. Restoring";
  79. drinkRestore();
  80.  
  81. }
  82.  
  83. if (Skill.HITPOINTS.getLevel() < 78) { //check if i need to eat
  84.  
  85. status = "Eating up";
  86. eatFood();
  87.  
  88. }
  89.  
  90. if (Skill.HITPOINTS.getLevel() < 99) { //check if i need to brew
  91.  
  92. status = "Safing like a boss";
  93. drinkBrew();
  94.  
  95. } else {
  96.  
  97. if (Skill.RANGE.getLevel() < 71) { //check if i need to restore, not with ppot part because this is lower priority/importance than hp/brew
  98.  
  99. status = "Restoring stats";
  100. drinkRestore();
  101. }
  102. }
  103.  
  104.  
  105.  
  106. } else { //either no food or restores, so you need to tele, gf divine if tbed #pm5wayin
  107.  
  108. status = "Out. Teleing home";
  109. teleToHome();
  110. Time.sleep(5000);
  111.  
  112. }
  113. }
  114. return 0;
  115. }
  116.  
  117.  
  118.  
  119. void drinkRestore() {
  120.  
  121. while (Inventory.getCount(restoresIDs[restoreArrayID]) < 1) { //if there are no pots of that dosage in inv, try next dosage, it's gauranteed that
  122. //there'll be a pot of correct dosage due to containts check at start of script
  123. restoreArrayID += 1;
  124.  
  125. if (restoreArrayID > restoresIDs.length) {
  126. restoreArrayID = 0;
  127. }
  128. }
  129.  
  130. restoreID = restoresIDs[restoreArrayID];
  131. Item[] superRes = Inventory.getItems(restoreID);
  132. Menu.sendAction(74, restoreID - 1, superRes[0].getSlot(), 3214, 2106, 4); //drinks restore
  133. Time.sleep(100);
  134. }
  135.  
  136.  
  137.  
  138. void drinkBrew() { //maybe make this have an array of all food (all brew flask/pot/shark/manta/rocktail, that it cycles through until it eats one instead?
  139.  
  140. if (Inventory.containts(14129, 14127, 14125, 14123, 14420, 14418, 6686, 6688, 6690, 6692)) { //check for brews
  141.  
  142. while (Inventory.getCount(brewIDs[brewArrayID]) < 1) { //check to make sure that you have a potion of that dose before you try drinking it
  143.  
  144. brewArrayID += 1;
  145.  
  146. if (brewArrayID > brewIDs.length) {
  147. brewArrayID = 0;
  148. }
  149. }
  150. }
  151.  
  152. brewID = brewIDs[brewArrayID];
  153. Item[] saraBrews = Inventory.getItems(brewID);
  154. Menu.sendAction(74, brewID - 1, saraBrews[0].getSlot(), 3214, 2106, 4); //drinks brew
  155. Time.sleep(100);
  156.  
  157. }
  158.  
  159.  
  160.  
  161. void eatFood() { //maybe make this have an array of all food (all brew flask/pot/shark/manta/rocktail, that it cycles through until it eats one instead?
  162.  
  163. if (Inventory.containts(1386, 392, 15273)) {
  164. while (Inventory.getCount(foodIDs[foodArrayID]) < 1) { //check to make sure that you have a potion of that dose before you try drinking it
  165.  
  166. foodArrayID += 1;
  167.  
  168. if (foodArrayID > foodIDs.length) {
  169. foodArrayID = 0;
  170. }
  171. }
  172.  
  173. foodID = foodIDs[foodArrayID];
  174. Item[] food = Inventory.getItems(foodID);
  175. Menu.sendAction(74, foodID - 1, food[0].getSlot(), 3214, 2106, 4);
  176. Time.sleep(100);
  177. }
  178. }
  179.  
  180.  
  181.  
  182. void teleToHome() {
  183.  
  184. //if normal spellbook
  185. Menu.sendAction(646, 14419, 5, 1195, 1282, 1); //home tele in spellbook
  186. Menu.sendAction(315, 14419, 439, 2461, 1282, 1);//click on teleport to home (as opposed to other option, market)
  187.  
  188. //if ancients
  189. Menu.sendAction(315, 36257792, 55, 12856, 2231, 1); //home tele in spellbook
  190. Menu.sendAction(315, 36257792, 492, 2461, 2231, 1); //click on teleport to home (as opposed to other option, market)
  191.  
  192. //if lunars
  193. Menu.sendAction(646, 666, 0, 30000, 17010, 1); //home tele in spellbook
  194. Menu.sendAction(315, 553, 251, 2461, 5497, 1); //click on teleport to home (as opposed to other option, market)
  195.  
  196. Time.sleep(100);
  197. }
  198.  
  199.  
  200.  
  201. void reactivatePray() {
  202.  
  203. Menu.sendAction(169, 93, 0, 22503, 409, 1); //prot 1 item
  204. Time.sleep(100);
  205. Menu.sendAction(169, 21446656, 176, 22521, 1309, 1); //melee pray
  206. Time.sleep(100);
  207. Menu.sendAction(169, 21446656, 176, 22535, 1309, 1); //leech idk
  208. Time.sleep(100);
  209. Menu.sendAction(169, 21446656, 176, 22535, 1309, 1); //leech idk
  210. Time.sleep(100);
  211. Menu.sendAction(169, 21446656, 176, 22525, 1309, 1); //leech idk
  212. Time.sleep(100);
  213. Menu.sendAction(169, 21446656, 176, 22529, 1309, 1); //leech idk
  214. Time.sleep(100);
  215. }
  216.  
  217. void checkPrayerBook() {
  218. Menu.sendAction(169, 90062848, 502, 22541, 5497, 1);
  219. Time.sleep(1000);
  220.  
  221. if (Players.getMyPlayer().getAnimation() == 12565) {
  222. isOnCurses = true;
  223. System.out.println("Curses are true");
  224. }
  225. else {
  226. isOnCurses = false;
  227. System.out.println("Curses are false");
  228. }
  229. }
  230.  
  231. private final Color color1 = new Color(0, 153, 153);
  232. private final Font font1 = new Font("Trebuchet MS", 1, 13);
  233.  
  234.  
  235.  
  236. @Override
  237. public void paint(Graphics g1) {
  238. Graphics2D g = (Graphics2D)g1;
  239. g.setFont(font1);
  240. g.setColor(color1);
  241. g.drawString("Status: " + status, 292, 336);
  242. }
  243.  
  244. @Override
  245. public void messageReceived(MessageEvent m) {
  246. if (m.getType() >= 0) {
  247. if ((m.getMessage().contains("Your prayer switch is now active."))) {
  248.  
  249. }
  250. }
  251. }
  252. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement