Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import static org.rev317.min.api.methods.Players.getMyPlayer;
- import java.awt.*;
- import java.io.IOException;
- import java.net.URL;
- import org.parabot.environment.api.interfaces.Paintable;
- import org.parabot.environment.api.utils.Time;
- import org.parabot.environment.scripts.Category;
- import org.parabot.environment.scripts.Script;
- import org.parabot.environment.scripts.ScriptManifest;
- import org.parabot.environment.scripts.framework.LoopTask;
- import org.rev317.min.api.events.MessageEvent;
- import org.rev317.min.api.events.listeners.MessageListener;
- import org.rev317.min.api.methods.Inventory;
- import org.rev317.min.api.methods.Menu;
- import org.rev317.min.api.methods.Players;
- import org.rev317.min.api.methods.Skill;
- import org.rev317.min.api.wrappers.Item;
- import org.rev317.min.api.wrappers.Player;
- @ScriptManifest(author = "God Poe X D",
- category = Category.COMBAT, description = "Makes you santaly",
- name = "AutoEater 0.6",
- servers = { "Ikov" },
- version = 0.6)
- public class Autoeater extends Script implements Paintable, MessageListener, LoopTask {
- String status = "Idling...";
- boolean ragbot420 = true;
- boolean isOnCurses = false;
- int restoreID;
- int[] restoresIDs = {14416, 14414, 14412, 14410, 14408, 14406, 3025, 3027, 3029, 3031};
- int restoreArrayID = 0;
- int brewID;
- int[] brewIDs = {14129, 14127, 14125, 14123, 14420, 14418, 6686, 6688, 6690, 6692};
- int brewArrayID = 0;
- int foodID = 0;
- int[] foodIDs = {1386, 392, 15273};
- int foodArrayID = 0;
- Character target;
- Player[] targetArray;
- @Override
- public int loop() {
- checkPrayerBook();
- Time.sleep(50); //to slow program to prevent lagg
- if (ragbot420 == true) {
- if ((Inventory.containts(6692, 6690, 6688, 6686, 14418, 14420, 14123, 14125, 14127, 14129) //check to see if i still have either brews
- || Inventory.containts(1386, 392, 15273)) //or food
- && Inventory.containts(3031, 3029, 3027, 3025, 14406, 14408, 14410, 14412, 14414, 14416)) { //check to see if i still have restores
- if (Skill.PRAYER.getLevel() < 1) { //if smited then try to tele, need to improve this cuz tb + dbow = ez divine
- status = "Smited. Panic mode = true";
- teleToHome(); //tries to tele
- while (Skill.PRAYER.getLevel() < 20) {
- drinkRestore(); //spams restore, it's a while loop so that it wont brew
- Time.sleep(300);
- }
- reactivatePray();
- }
- if (Skill.PRAYER.getLevel() < 66) { //check if i need to ppot
- status = "Prayer low. Restoring";
- drinkRestore();
- }
- if (Skill.HITPOINTS.getLevel() < 78) { //check if i need to eat
- status = "Eating up";
- eatFood();
- }
- if (Skill.HITPOINTS.getLevel() < 99) { //check if i need to brew
- status = "Safing like a boss";
- drinkBrew();
- } else {
- if (Skill.RANGE.getLevel() < 71) { //check if i need to restore, not with ppot part because this is lower priority/importance than hp/brew
- status = "Restoring stats";
- drinkRestore();
- }
- }
- } else { //either no food or restores, so you need to tele, gf divine if tbed #pm5wayin
- status = "Out. Teleing home";
- teleToHome();
- Time.sleep(5000);
- }
- }
- return 0;
- }
- void drinkRestore() {
- while (Inventory.getCount(restoresIDs[restoreArrayID]) < 1) { //if there are no pots of that dosage in inv, try next dosage, it's gauranteed that
- //there'll be a pot of correct dosage due to containts check at start of script
- restoreArrayID += 1;
- if (restoreArrayID > restoresIDs.length) {
- restoreArrayID = 0;
- }
- }
- restoreID = restoresIDs[restoreArrayID];
- Item[] superRes = Inventory.getItems(restoreID);
- Menu.sendAction(74, restoreID - 1, superRes[0].getSlot(), 3214, 2106, 4); //drinks restore
- Time.sleep(100);
- }
- 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?
- if (Inventory.containts(14129, 14127, 14125, 14123, 14420, 14418, 6686, 6688, 6690, 6692)) { //check for brews
- while (Inventory.getCount(brewIDs[brewArrayID]) < 1) { //check to make sure that you have a potion of that dose before you try drinking it
- brewArrayID += 1;
- if (brewArrayID > brewIDs.length) {
- brewArrayID = 0;
- }
- }
- }
- brewID = brewIDs[brewArrayID];
- Item[] saraBrews = Inventory.getItems(brewID);
- Menu.sendAction(74, brewID - 1, saraBrews[0].getSlot(), 3214, 2106, 4); //drinks brew
- Time.sleep(100);
- }
- 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?
- if (Inventory.containts(1386, 392, 15273)) {
- while (Inventory.getCount(foodIDs[foodArrayID]) < 1) { //check to make sure that you have a potion of that dose before you try drinking it
- foodArrayID += 1;
- if (foodArrayID > foodIDs.length) {
- foodArrayID = 0;
- }
- }
- foodID = foodIDs[foodArrayID];
- Item[] food = Inventory.getItems(foodID);
- Menu.sendAction(74, foodID - 1, food[0].getSlot(), 3214, 2106, 4);
- Time.sleep(100);
- }
- }
- void teleToHome() {
- //if normal spellbook
- Menu.sendAction(646, 14419, 5, 1195, 1282, 1); //home tele in spellbook
- Menu.sendAction(315, 14419, 439, 2461, 1282, 1);//click on teleport to home (as opposed to other option, market)
- //if ancients
- Menu.sendAction(315, 36257792, 55, 12856, 2231, 1); //home tele in spellbook
- Menu.sendAction(315, 36257792, 492, 2461, 2231, 1); //click on teleport to home (as opposed to other option, market)
- //if lunars
- Menu.sendAction(646, 666, 0, 30000, 17010, 1); //home tele in spellbook
- Menu.sendAction(315, 553, 251, 2461, 5497, 1); //click on teleport to home (as opposed to other option, market)
- Time.sleep(100);
- }
- void reactivatePray() {
- Menu.sendAction(169, 93, 0, 22503, 409, 1); //prot 1 item
- Time.sleep(100);
- Menu.sendAction(169, 21446656, 176, 22521, 1309, 1); //melee pray
- Time.sleep(100);
- Menu.sendAction(169, 21446656, 176, 22535, 1309, 1); //leech idk
- Time.sleep(100);
- Menu.sendAction(169, 21446656, 176, 22535, 1309, 1); //leech idk
- Time.sleep(100);
- Menu.sendAction(169, 21446656, 176, 22525, 1309, 1); //leech idk
- Time.sleep(100);
- Menu.sendAction(169, 21446656, 176, 22529, 1309, 1); //leech idk
- Time.sleep(100);
- }
- void checkPrayerBook() {
- Menu.sendAction(169, 90062848, 502, 22541, 5497, 1);
- Time.sleep(1000);
- if (Players.getMyPlayer().getAnimation() == 12565) {
- isOnCurses = true;
- System.out.println("Curses are true");
- }
- else {
- isOnCurses = false;
- System.out.println("Curses are false");
- }
- }
- private final Color color1 = new Color(0, 153, 153);
- private final Font font1 = new Font("Trebuchet MS", 1, 13);
- @Override
- public void paint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- g.setFont(font1);
- g.setColor(color1);
- g.drawString("Status: " + status, 292, 336);
- }
- @Override
- public void messageReceived(MessageEvent m) {
- if (m.getType() >= 0) {
- if ((m.getMessage().contains("Your prayer switch is now active."))) {
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement