Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import impsoft.bots.ColorBot;
- import impsoft.bots.input.MouseCommand;
- import impsoft.bots.reflection.Interface;
- import impsoft.bots.reflection.NPC;
- import impsoft.bots.reflection.NPCIterator;
- import impsoft.bots.reflection.PhysicalObject;
- import impsoft.scripting.ibot.builtin.itemrec.ItemSlot;
- import impsoft.scripting.ibot.builtin.tabs.TabSkelton;
- import impsoft.scripting.ibot.clusters.HeatCluster;
- import impsoft.scripting.ibot.enums.Skill;
- import impsoft.scripting.ibot.interfaces.AutoPaint;
- import impsoft.scripting.ibot.interfaces.ChatListener;
- import impsoft.scripting.ibot.itemrec.ItemCondition;
- import impsoft.scripting.ibot.itemrec.ItemIdExact;
- import impsoft.scripting.ibot.itemrec.ItemNameExact;
- import impsoft.scripting.ibot.structs.AryanTile;
- import impsoft.scripting.ibot.structs.AryanTileZone;
- import impsoft.scripting.ibot.structs.XY;
- import impsoft.scripting.types.ColorScript;
- import impsoft.scripting.types.parallel.scriptjobs.ScriptJob;
- import impsoft.utils.general.Timer;
- import impsoft.utils.ibot.RandomGenerator;
- import impsoft.utils.uber.UberClickOptions;
- import impsoft.utils.uber.UberScriptUtils;
- import impsoft.values.constant.Areas;
- import impsoft.values.constant.SC;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Rectangle;
- import java.awt.event.KeyEvent;
- import java.io.IOException;
- import java.net.URL;
- import java.util.ArrayList;
- import java.util.EnumSet;
- import java.util.HashMap;
- import java.util.List;
- import java.util.regex.Pattern;
- import javax.imageio.ImageIO;
- import javax.swing.JFrame;
- import javax.swing.JOptionPane;
- import javax.swing.UIManager;
- import java.awt.*;
- import java.text.DecimalFormat;
- import impsoft.scripting.types.parallel.scriptjobs.WorldObjectClickingScriptJobV2;
- import impsoft.utils.ruler.RulerClickOptions;
- import impsoft.utils.ruler.RulerScriptUtils;
- import bergCoder.BergUtils;
- import bergCoder.Object3D;
- public class ZAltarPrayer extends ColorScript implements AutoPaint {
- public ZAltarPrayer(ColorBot c) {
- super(c);
- }
- BergUtils util = new BergUtils(this);
- RulerScriptUtils Ruler = new RulerScriptUtils();
- public static String author = "zbubblez";
- public static String description = "Uses ur bonez";
- public static double version = 1;
- Timer Time = new Timer(0);
- Timer f = new Timer((random(15, 54)) * (1000 * 60));
- long scriptStartTIME = System.currentTimeMillis();
- Timer t2 = new Timer(10000L);
- Timer KyattTimer = new Timer((random(35, 45)) * (1000 * 60));
- String bones;
- String altarGuy;
- String Status = "Waiting......";
- boolean POH = false;
- boolean Go = false;
- boolean First = true;
- int StartXP = 0;
- int Tries = 0;
- int CurrentXP = 0;
- int Runs = 0;
- int a = 0;
- int[] Doors = {};
- public int altars[] = {
- 13194, 13197, 13198, 13199
- };
- AryanTileZone Enter = new AryanTileZone(new AryanTile(2542,3096),new AryanTile(2547,3094));
- public AryanTile houseTile;
- public void script() throws InterruptedException, Exception {
- XPThread.start();
- AntiBan.start();
- CheckPlayer.start();
- try
- {
- while(!isLoggedIn())
- {
- sleep(1000);
- log("Waiting for login.");
- }
- log("Version 1.00");
- StartXP = theTabs.Statistics.getStatExperience(Skill.PRAYER);
- altarGuy = JOptionPane.showInputDialog("Whats the name of the Altar owner? (me = using your altar)");
- bones = JOptionPane.showInputDialog("What bones? (Bones, Big bones, Dragon bones)");
- if(altarGuy == "me")
- {
- POH = true;
- log("POH = true");
- }
- else
- {
- POH = false;
- log("POH = false");
- }
- log("Using "+bones+" Bones");
- if(theTabs.Inventory.count(bones) != 0)
- {
- Walk();
- }
- else
- {
- Bank();
- }
- }
- catch(InterruptedException interruptedexception)
- {
- log("We Gained: "+(CurrentXP - StartXP)+" XP!");
- throw interruptedexception;
- }
- }
- public void Walk() throws InterruptedException, Exception {
- Status = "Walking";
- while(!Enter.isInZone(getLocation()))
- {
- theWorldMap.walkTo(Enter.random());
- }
- PhysicalObject Entrance = util.getInteractiveObject(15482);
- while(Entrance == null)
- {
- sleep(400, 600);
- }
- while(!this.isInterfaceNotNullAndValid(232,2) || !this.isInterfaceNotNullAndValid(232,4))
- {
- RulerScriptUtils.clickWorldObject(this, null,
- Entrance, null,
- Pattern.compile(Entrance.toString(), Pattern.CASE_INSENSITIVE),
- Pattern.compile(".*Enter.*", Pattern.CASE_INSENSITIVE),
- EnumSet.of(RulerClickOptions.WALK_USING_ANY,
- RulerClickOptions.GOAL_MENU_CLICK));
- sleep(3000, 4000);
- }
- if(POH == true)
- {
- mouseClickLeft(new Rectangle(199,386,119, 10));
- sleep(1000, 2000);
- }
- else
- {
- mouseClickLeft(new Rectangle(184,425,150, 11));
- sleep(1000, 2000);
- if(First == true)
- {
- SendText(altarGuy);
- sleep(1, 400);
- SendKey(10);
- First = false;
- }
- else
- {
- mouseClickLeft(new Rectangle(186,453,143, -7));
- }
- }
- sleep(7000, 9000);
- Grind();
- }
- public void Grind() throws InterruptedException, Exception {
- Status = "Grinding bones";
- PhysicalObject Altar = util.getInteractiveObject(altars, null);
- if(Altar != null)
- {
- theWorldMap.walkTo(Altar.getLocation());
- util.sleepUntilNotMoving();
- }
- while(theTabs.Inventory.countEmptySlots() != 28)
- {
- if(Altar != null)
- {
- if(Altar.getGameScreenLocation() == null)
- {
- if(Altar != null)
- {
- theWorldMap.walkTo(Altar.getLocation());
- util.sleepUntilNotMoving();
- }
- }
- }
- theTabs.Inventory.doAction(bones, "Use", 1, false);
- sleep(1000, 2500);
- if(theTabs.Inventory.isAItemSelected())
- {
- RulerScriptUtils.clickWorldObject(this, null,
- Altar, null,
- Pattern.compile(Altar.toString(), Pattern.CASE_INSENSITIVE),
- Pattern.compile(".*-> Altar.*", Pattern.CASE_INSENSITIVE),
- EnumSet.of(RulerClickOptions.WALK_USING_ANY,
- RulerClickOptions.GOAL_MENU_CLICK));
- sleep(3000, 4000);
- mouseClickRight(new Rectangle(234,393,41, 31));
- theMenuFinder.doMenu("All");
- Go = false;
- }
- while(Go == false)
- {
- a = theTabs.Inventory.count(bones);
- sleep(6000, 8000);
- if(theTabs.Inventory.count(bones) == a)
- {
- log("DoingAction = false");
- Go = true;
- }
- }
- sleep(500, 1000);
- }
- Bank();
- }
- public void Bank() throws InterruptedException, Exception {
- Status = "Banking";
- for(; theTabs.Inventory.count(bones) == 0 && Enter.random().distanceTo(getLocation()) > 200; sleep(6000, 7500))
- {
- theCamera.setCameraToTile(new AryanTile(getLocation().x + random(-10, 10), getLocation().y + random(-10, 10)));
- util.clickInteractiveObject(new int[] {
- 13405
- }, null, "Portal", "Enter", new Object3D(-20, 20, -20, 20, 0, 50, true));
- }
- theWorldMap.walkToBank();
- theBank.open();
- if(theTabs.Inventory.countEmptySlots() != 28)
- {
- theBank.doDepositAll();
- }
- theBank.doWithDrawAll(bones, false);
- theBank.exit();
- Runs++;
- Walk();
- }
- Thread CheckPlayer = new Thread() {
- public void run() {
- log("Running Thread Started!");
- while (getHandler().isScriptRunning()) {
- try {
- if (theMiniMapIndicators.getEnergy() > (random(40, 55))) {
- util.setFastRun(true);
- }
- if (!theTabs.Inventory.isSelected() && !theTabs.Attack.isSelected()) {
- if(!theTabs.Inventory.isSelected())
- {
- theTabs.Inventory.click();
- }
- }
- sleep(2000, 3000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- try {
- switch (random(0, 350)) {
- case 4:
- theCamera.setYawRandom();
- break;
- case 23:
- theCamera.setYawRandom();
- break;
- case 37:
- theCamera.setYawRandom();
- break;
- case 55:
- theCamera.setYawRandom();
- break;
- case 64:
- theCamera.setYawRandom();
- break;
- case 78:
- theCamera.setYawRandom();
- break;
- case 99:
- theCamera.setYawRandom();
- break;
- case 105:
- theCamera.setYawRandom();
- break;
- case 173:
- theCamera.setYawRandom();
- break;
- case 244:
- theCamera.setYawRandom();
- break;
- case 285:
- theCamera.setYawRandom();
- break;
- case 299:
- theCamera.setYawRandom();
- break;
- }
- sleep(random(3000, 20000));
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
- };
- Thread XPThread = new Thread() {
- public void run() {
- log("XP Thread Started!");
- while (getHandler().isScriptRunning()) {
- try {
- CurrentXP = theTabs.Statistics.getStatExperience(Skill.PRAYER);
- sleep(500, 1000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
- };
- Thread AntiBan = new Thread() {
- public void run() {
- log("AntiBan Thread Started!");
- while (getHandler().isScriptRunning()) {
- try {
- switch (random(0, 200)) {
- case 12:
- mouseMove(Areas.GAME);
- break;
- case 25:
- theCamera.setYawRandom();
- break;
- case 29:
- theCamera.setYawRandom();
- break;
- case 36:
- mouseMove(Areas.ENTIRE);
- break;
- case 44:
- switch (random(1, 5)) {
- case 1:
- theTabs.Friends.click();
- break;
- case 2:
- theTabs.Statistics.click();
- break;
- case 3:
- theTabs.Attack.click();
- break;
- case 4:
- theTabs.Options.click();
- break;
- case 5:
- break;
- }
- break;
- case 58:
- theCamera.setYawRandomNormal();
- break;
- case 63:
- theCamera.setYawRandom();
- break;
- case 77:
- mouseMove(Areas.ENTIRE);
- break;
- case 91:
- theCamera.setYawRandom();
- break;
- case 114:
- mouseMove(Areas.ENTIRE);
- break;
- case 133:
- theCamera.setYawRandom();
- break;
- case 145:
- theCamera.setYawRandom();
- break;
- case 166:
- theCamera.setYawRandom();
- break;
- case 178:
- theCamera.setYawRandom();
- break;
- case 184:
- theCamera.setYawRandom();
- break;
- case 200:
- theCamera.setYawRandom();
- break;
- }
- sleep(1000, 6000);
- } catch (InterruptedException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
- };
- public void paint(Graphics g) {
- final StringBuilder gg = new StringBuilder();
- final long runtime = Time.timePassed();
- final long TotalSec = runtime / 1000;
- final long TotalMin = TotalSec / 60;
- final long TotalHour = TotalMin / 60;
- final int second = (int) TotalSec % 60;
- final int minute = (int) TotalMin % 60;
- final int hour = (int) TotalHour % 60;
- long runTime = 0;
- runTime = System.currentTimeMillis() - scriptStartTIME;
- int mPerHour = 0;
- if ((runTime / 1000) > 0) {
- mPerHour = (int) ((3600000.0 / (double) runTime) * (Runs));
- }
- int PerHour = 0;
- if ((runTime / 1000) > 0) {
- PerHour = (int) ((3600000.0 / (double) runTime) * ((CurrentXP - StartXP)));
- }
- if (hour < 10)
- gg.append("0");
- gg.append(hour);
- gg.append(" : ");
- if (minute < 10)
- gg.append("0");
- gg.append(minute);
- gg.append(" : ");
- if (second < 10)
- gg.append("0");
- gg.append(second);
- int Y = 280;
- g.setColor(new Color(0, 0, 0, 200));
- g.fillRect(255, 245, 258, 90);
- g.setColor(new Color(0, 204, 204, 129));
- g.fillRect(258, 247, 252, 85);
- g.setFont(new Font("LilyUPC", 0, 35));
- g.setColor(new Color(0, 0, 0));
- g.drawString("ZAltarPrayer", 324, 266);
- g.setFont(new Font("LilyUPC", 0, 22));
- g.setColor(new Color(0, 0, 0));
- g.drawString("Time Running: "+String.valueOf(gg.toString()), 260, Y);
- g.drawString("XP Gained: "+(CurrentXP - StartXP)+" ("+PerHour+"/H)", 260, Y+15);
- g.drawString("Runs Made: "+Runs+" ("+mPerHour+"/H)", 260, Y+30);
- g.drawString("Status: "+Status, 260, Y+45);
- }
- }//END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement