Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.BasicStroke;
- import java.awt.Color;
- import java.awt.Container;
- import java.awt.Dimension;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Insets;
- import java.awt.Point;
- import java.awt.Rectangle;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.KeyEvent;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- import javax.swing.DefaultComboBoxModel;
- import javax.swing.JButton;
- import javax.swing.JCheckBox;
- import javax.swing.JComboBox;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.SwingConstants;
- import com.rarebot.event.events.MessageEvent;
- import com.rarebot.event.listeners.MessageListener;
- import com.rarebot.event.listeners.PaintListener;
- import com.rarebot.script.Script;
- import com.rarebot.script.ScriptManifest;
- import com.rarebot.script.methods.Equipment;
- import com.rarebot.script.methods.Magic;
- import com.rarebot.script.util.Timer;
- import com.rarebot.script.wrappers.RSArea;
- import com.rarebot.script.wrappers.RSComponent;
- import com.rarebot.script.wrappers.RSItem;
- import com.rarebot.script.wrappers.RSObject;
- import com.rarebot.script.wrappers.RSTile;
- import com.rarebot.script.wrappers.RSTilePath;
- @ScriptManifest(authors = { "Tossut" }, keywords = "Prayer", name = "Tossut's Gilded Altar", version = 1.45, description = "Options in the GUI")
- public class TossutsGildedAltar extends Script implements PaintListener,
- MessageListener, MouseListener {
- // INTS
- private int expPer, portalIn, bones, pouchID, startExp,
- startLevel, rnd, gainedExp, expToLevel, attempts;
- private int doorOpen = -1, doorClosed = -1, burner = -1,
- burnerBurning = -1, altar = -1, BoB = -1, usesCount = -1,
- bobRoom = -1;
- private int mspeed;
- private int tinderBoxID = 590;
- private int marrentillID = 251;
- private int hTabs = 8013;
- private int ringID[] = { 2564, 2562, 2560, 2558, 2556, 2554, 2552 };
- private int ringID8 = 2552;
- private int portalOut = 13405;
- private static final int INTERFACE_TAB_SUMMONING = 747;
- private static final int INTERFACE_TAB_SUMMONING_CHILD = 2;
- // TIMERS
- private Timer ABt = new Timer(random(10000, 20000));
- private Timer XPcheck = new Timer(random(120000, 180000));
- private Timer failSafeT = new Timer(5500);
- private Timer bankLoad = new Timer(5000);
- private Timer bw = new Timer(3000);
- private Timer failSafe = new Timer(1000);
- private Timer Zzz = new Timer(600000);
- private Timer SmeltedT = new Timer(45000);
- private Timer failSafeStuck = new Timer(360000);
- // BOOLEANS
- private boolean[] burnahs = { true, true };
- private boolean showPaint = true;
- private boolean guidone, useRod, useRunes, bankWalkYanille, useKinship,
- useFriends, allowTeleport, smelted, houseStyleDetected,
- itemsNeeded, BoBemptied, useBoB, timeToRefresh, altMethodb,
- houseLeech, needPouch;
- private boolean west = false, north = false, east = false, south = false;
- // TILES
- private RSArea bankCW = new RSArea(new RSTile(2440,3082),new RSTile(2446,3093));
- private RSTile chestL = new RSTile(2444, 3083);
- private RSTile tile4 = new RSTile(3449, 3718);
- private RSTile obeliskTile = new RSTile(2462, 3087);
- private RSTile burnerLoc, altarLoc, altarF, portalLoc, kBank = new RSTile(
- 3448, 3720);
- RSTile doorCoordinates;
- RSTile[] walkToKinshipB = { new RSTile(3448, 3698), new RSTile(3449, 3703),
- new RSTile(3449, 3709), new RSTile(3449, 3715),
- new RSTile(3449, 3719) };
- RSTile[] toObelisk = { new RSTile(2448, 3089), new RSTile(2455, 3090),
- new RSTile(2462, 3087) };
- // OTHERS
- private Angle angle;
- private Pitch pitch;
- private String status, whichBones, whichBanking, whichMouseSpeed, whichBoB;
- private long startTime;
- private int bonesSmelt = 0;
- private long runTime = 0, seconds = 0, minutes = 0, hours = 0;
- private long secToLevel = 0;
- private long minutesToLevel = 0;
- private long hoursToLevel = 0;
- private float secExp = 0;
- private float minuteExp = 0;
- private float hourExp = 0;
- private RSItem ringItem;
- private RSItem ringItemTemp;
- RSObject chest, burnerX, burnerBurningX, altarX, Obelisk, box, yanille,
- taverley, pollnivneach, rimmington, rellekka, brimhaven, portalInX,
- portalOutX, doorOpenX, doorClosedX, booth, door, bankdoor;
- TGAninegui2 gui;
- public boolean onStart() {
- log.severe("Fill the GUI and hit start");
- java.awt.EventQueue.invokeLater(new Runnable() {
- public void run() {
- gui = new TGAninegui2();
- gui.setVisible(true);
- }
- });
- while (!guidone) {
- sleep(100);
- }
- log("Please post your proggies and report bugs");
- startTime = System.currentTimeMillis();
- startLevel = skills.getRealLevel(5);
- startExp = skills.getCurrentExp(5);
- {
- if (useRunes == true) {
- log("Have Staff of earth equipped and the runes needed in inv");
- }
- if (whichBones.equals("Bones")) {
- bones = 526;
- expPer = 14;
- }
- if (whichBones.equals("Big Bones")) {
- bones = 532;
- expPer = 105 / 2;
- }
- if (whichBones.equals("Dragon")) {
- bones = 536;
- expPer = 252;
- }
- if (whichBones.equals("Baby Dragon")) {
- bones = 534;
- expPer = 105;
- }
- if (whichBones.equals("Dagannoth Bones")) {
- bones = 6729;
- expPer = 875 / 2;
- }
- if (whichBones.equals("Frost Dragon")) {
- bones = 18832;
- expPer = 630;
- }
- if (whichBones.equals("Infernal Ashes")) {
- bones = 20268;
- expPer = 875 / 4;
- }
- if (whichMouseSpeed.equals("3 (Fastest)")) {
- mspeed = 3;
- }
- if (whichMouseSpeed.equals("4")) {
- mspeed = 4;
- }
- if (whichMouseSpeed.equals("5")) {
- mspeed = 5;
- }
- if (whichMouseSpeed.equals("6")) {
- mspeed = 6;
- }
- if (whichMouseSpeed.equals("7")) {
- mspeed = 7;
- }
- if (whichMouseSpeed.equals("8")) {
- mspeed = 8;
- }
- if (whichMouseSpeed.equals("9 (Slowest)")) {
- mspeed = 9;
- }
- if (altMethodb == true) {
- log("Script now clicks altar and opens closest door.");
- }
- if (whichBanking.equals("Duelling")) {
- useRod = true;
- log("Using Ring of Duellings");
- }
- if (whichBanking.equals("Yanille walk")) {
- bankWalkYanille = true;
- log("Walking to Yanille Bank, must have house in Yanille");
- }
- if (whichBanking.equals("Kinship")) {
- useKinship = true;
- log("Using Ring of Kinship");
- }
- if (whichBoB.equals("Don't use")) {
- useBoB = false;
- }
- if (whichBoB.equals("Spirit terrorbird")) {
- useBoB = true;
- pouchID = 12007;
- bobRoom = 11;
- }
- if (whichBoB.equals("War Tortoise")) {
- useBoB = true;
- pouchID = 12031;
- bobRoom = 17;
- }
- if (useBoB == true && useRod != true) {
- log
- .severe("Reminder: Beast of Burden only works with Duelling atm...");
- stopScript();
- }
- log("Mouse speed is: " + mouse.getSpeed());
- angle = new Angle();
- pitch = new Pitch();
- angle.start();
- pitch.start();
- Zzz.reset();
- failSafeStuck.reset();
- }
- return true;
- }
- public int loop() {
- //Objects//
- com.rarebot.script.wrappers.RSNPC kinBank = npcs.getNearest(9710);
- chest = objects.getNearest(4483); // CW
- bankdoor = objects.getNearest(36315);
- burnerX = objects.getNearest(burner);
- burnerBurningX = objects.getNearest(burnerBurning);
- altarX = objects.getNearest(altar);
- doorClosedX = objects.getNearest(doorClosed);
- doorOpenX = objects.getNearest(doorOpen);
- taverley = objects.getNearest(15477);
- pollnivneach = objects.getNearest(15479);
- rimmington = objects.getNearest(15478);
- rellekka = objects.getNearest(15480);
- brimhaven = objects.getNearest(15481);
- yanille = objects.getNearest(15482);
- taverley = objects.getNearest(15477);
- pollnivneach = objects.getNearest(15479);
- rimmington = objects.getNearest(15478);
- rellekka = objects.getNearest(15480);
- brimhaven = objects.getNearest(15481);
- yanille = objects.getNearest(15482);
- portalInX = objects.getNearest(portalIn);
- portalOutX = objects.getNearest(portalOut); // Leave house
- Obelisk = objects.getNearest(29954); // CW
- mouse.setSpeed(random(mspeed-1,mspeed+2));
- if (game.getClientState() != 11) {
- if (!angle.pause)
- angle.pause = true;
- if (!pitch.pause)
- pitch.pause = true;
- }
- // Beast of Burden Methods
- if (game.isLoggedIn() == true && useBoB == true
- && bank.isOpen() == false && game.getClientState() == 11) {
- needPouch();
- // Summon BoB
- if (chest != null || Obelisk != null) {
- if (summoning.isFamiliarSummoned() != true
- && inventory.contains(pouchID) && chest != null) {
- refreshBoB();
- }
- }
- if (game.isLoggedIn() == true && useBoB == true
- && bank.isOpen() == false && game.getClientState() == 11) {
- if (summoning.getSummoningPoints() <= 10
- && summoning.getTimeLeft() <= 7
- && calc.distanceTo(obeliskTile) <= 50
- && BoB == (bobRoom + 1)
- && inventory.getCount(bones) >= 20
- && inventory.getCount(marrentillID) == 2
- && usesCount > 1
- || summoning.isFamiliarSummoned() == true
- && summoning.getTimeLeft() <= 2.5
- && inventory.contains(pouchID)
- && bank.isOpen() == false
- && summoning.getSummoningPoints() >= 10) {
- timeToRefresh = true;
- refreshBoB();
- } else {
- timeToRefresh = false;
- }
- if (BoB == -1 && summoning.isFamiliarSummoned() == true) {
- checkBoB();
- }
- if (smelted == true && summoning.isFamiliarSummoned() == true
- && inventory.getCount(bones) <= 4
- && BoBemptied == false) {
- emptyBoB();
- }
- }
- // Fill beast of burden
- if (chest != null || kinBank != null) {
- while (summoning.isFamiliarSummoned() == true
- && BoB != (bobRoom + 1)
- && inventory.getCount(bones) > 20
- && game.getClientState() == 11) {
- fillBoB();
- }
- }
- }
- // antiban
- final int AB = (random(1, 30));
- if (AB == 1 && ABt.isRunning() != true
- && getMyPlayer().isMoving() == true) {
- antiban();
- ABt.reset();
- }
- // ring checks of doom
- if (useRod == true) {
- if (inventory.containsOneOf(ringID) && usesCount <= 1) {
- equipRing();
- duelCheck();
- }
- if (usesCount == -1) {
- duelCheck();
- }
- }
- // Stay running
- if (walking.getEnergy() > random(20, 40)
- && walking.isRunEnabled() == false) {
- walking.setRun(true);
- sleep(1500);
- }
- // Got Items needed?
- if (useBoB == false && houseLeech == false) {
- if (inventory.getCount(bones) >= 20
- && inventory.getCount(marrentillID) == 2
- && portalOutX == null && inventory.contains(tinderBoxID)
- && !inventory.contains(2566)
- && !inventory.containsOneOf(ringID)) {
- itemsNeeded = true;
- } else {
- itemsNeeded = false;
- }
- }
- // allow Teleport to house (without BoB).
- if (useBoB == false) {
- if (usesCount > 1 && itemsNeeded == true && useRod == true) {
- allowTeleport = true;
- } else if (itemsNeeded == true && useKinship == true) {
- allowTeleport = true;
- } else if (itemsNeeded == true && bankWalkYanille == true) {
- allowTeleport = true;
- } else {
- allowTeleport = false;
- }
- }
- // allow Teleport to house (with BoB).
- if (useBoB == true) {
- BoBTele();
- }
- // Teleport to house
- if (allowTeleport == true) {
- if (useRunes == false && chest != null || useRunes == false
- && kinBank != null || useRunes == false && Obelisk != null) {
- teleHouse();
- }
- if (useRunes == true && chest != null || useRunes == true
- && kinBank != null || useRunes == true && Obelisk != null) {
- teleHouseR();
- }
- }
- // Detect house objects
- if (portalOutX != null && houseStyleDetected == false) {
- detectHouse();
- }
- // Detect Location and the action to be done
- if (yanille != null || taverley != null || brimhaven != null
- || pollnivneach != null || rimmington != null
- || rellekka != null) {
- if (!inventory.contains(bones) && useRod == true) {
- duelTele();
- }
- if (!inventory.contains(bones) && useKinship == true) {
- Kinshiptele();
- }
- if (inventory.contains(bones) == true && useFriends == false
- && bankWalkYanille == false) {
- usePortal();
- }
- }
- // Walk to banker
- // Castle wars
- if (chest != null || Obelisk != null) {
- if (calc.distanceTo(chestL) <= 100 && allowTeleport == false) {
- openbank();
- }
- }
- // Daemonheim
- if (calc.distanceTo(tile4) >= 5 && calc.distanceTo(tile4) < 100) {
- Kinshipwalk();
- }
- if (kinBank != null || getMyPlayer().getLocation() == kBank) {
- if (calc.distanceTo(kinBank.getLocation()) <= 10 && kinBank != null
- && allowTeleport == false
- || calc.tileOnScreen(kinBank.getLocation()) == true
- && kinBank != null && allowTeleport == false
- || getMyPlayer().getLocation() == kBank) {
- KinshipBanker();
- }
- }
- // Door methods
- if (doorClosedX != null && doorOpenX == null
- && houseStyleDetected == true && inventory.contains(bones)
- && altMethodb == true) {
- walkToDoorOld();
- }
- // detect altar location
- if (doorOpenX == null && doorClosedX != null && altarX != null
- && portalOutX != null && houseStyleDetected == true
- && inventory.contains(bones) && altMethodb == false
- && smelted == false) {
- newDoorMethod();
- }
- if (calc.distanceTo(doorClosedX) <= 2 && doorClosedX != null
- && altMethodb == true && doorOpenX == null) {
- openDoor();
- }
- if (burnerX != null && inventory.contains(marrentillID)
- && doorOpenX != null && houseStyleDetected == true) {
- lightBurner();
- }
- if (inventory.contains(bones) && burnerBurningX != null
- && !inventory.contains(marrentillID)
- && houseStyleDetected == true) {
- offer();
- }
- if (inventory.contains(bones) && burnerBurningX != null
- && burnerX == null && houseStyleDetected == true) {
- offer();
- }
- // BANKING METHOD//
- if (!inventory.contains(bones) && chest == null && useRod == true
- && BoB == 0 && useBoB == true || !inventory.contains(bones)
- && chest == null && useRod == true && useBoB == false
- || inventory.contains(bones)
- && !inventory.contains(marrentillID) && burnerBurningX == null
- && burnerX != null && houseStyleDetected == true
- && useRod == true && houseLeech == false || useRod == true
- && burnerBurningX == null && burnerX != null
- && !inventory.contains(marrentillID)) {
- duelTele();
- }
- if (altarX != null || taverley != null || portalOutX != null
- || pollnivneach != null || yanille != null | brimhaven != null
- || rimmington != null || rellekka != null) {
- if (!inventory.contains(bones)
- && box == null
- && useKinship == true
- && kinBank == null
- && BoB == 0
- && useBoB == true
- || (!inventory.contains(bones) && box == null
- && useKinship == true && kinBank == null || inventory
- .contains(bones)
- && !inventory.contains(marrentillID)
- && burnerBurningX == null
- && burnerX != null
- && houseStyleDetected == true
- && useKinship == true
- && box == null
- && kinBank == null
- && houseLeech == false)) {
- Kinshiptele();
- }
- }
- if (portalInX != null && inventory.contains(bones)
- && useFriends == false) {
- usePortal();
- }
- // Withdraw items
- if (bank.isOpen() == true) {
- withdrawitemsNeeded();
- }
- // Failsafes//
- if (failSafeStuck.isRunning()!=true){
- log.severe("We're stuck?!");
- if (useRod){
- duelTele();
- } else {
- Kinshiptele();
- }
- }
- if (Zzz.isRunning() != true) {
- log.severe("No action for 10 min. Stopping script");
- stopScript();
- return -1;
- }
- return (random(100, 200));
- }
- // / finding out your house style
- public void detectHouse() {
- sleep(2000, 2500);
- if (objects.getNearest(13100) != null) {
- doorOpen = 13102;
- doorClosed = 13100;
- log("Detected house style: Basic Wood");
- } else if (objects.getNearest(13094) != null) {
- doorOpen = 13095;
- doorClosed = 13094;
- log("Detected house style: Basic Stone");
- } else if (objects.getNearest(13119) != null) {
- doorOpen = 13121;
- doorClosed = 13119;
- log("Detected House style: Fancy Stone");
- } else if (objects.getNearest(13016) != null) {
- doorOpen = 13018;
- doorClosed = 13016;
- log("Detected House style: Tropical Wood");
- } else if (objects.getNearest(13109) != null) {
- doorOpen = 13110;
- doorClosed = 13109;
- log("Detected House style: Fremmennik-style");
- } else if (objects.getNearest(13006) != null) {
- doorOpen = 13008;
- doorClosed = 13006;
- log("Detected House style: Whitewashed");
- } else if (objects.getNearest(36625) != null) {
- doorClosed = 36625;
- doorOpen = 36649;
- log("Detected House style: Dark Stone");
- }
- // Detect Altar. One altar type may have several IDs
- if (objects.getNearest(13197) != null) {
- altar = 13197;
- log("Detected Gilded Altar");
- } else if (objects.getNearest(13198) != null) {
- altar = 13198;
- log("Detected Gilded Altar");
- } else if (objects.getNearest(13199) != null) {
- altar = 13199;
- log("Detected Gilded Altar");
- } else if (objects.getNearest(13188) != null) {
- altar = 13188;
- log("Detected Mahogany Altar");
- }
- // Detect Burners.
- if (objects.getNearest(13208) != null
- || objects.getNearest(13209) != null) {
- burner = 13208;
- burnerBurning = 13209;
- log("Detected Incense Burners");
- } else if (objects.getNearest(13212) != null
- || objects.getNearest(13213) != null) {
- burner = 13212;
- burnerBurning = 13213;
- log("Detected Marble Burners");
- } else if (objects.getNearest(13210) != null
- || objects.getNearest(13211) != null) {
- burner = 13210;
- burnerBurning = 13211;
- log("Detected Mahogany Burners");
- }
- if (doorOpen != -1 && doorClosed != -1 && altar != -1 && burner != -1
- && burnerBurning != -1) {
- houseStyleDetected = true;
- log(Color.green, "Detected all needed objects!");
- }
- }
- public void openbank() {
- angle.pause = true;
- pitch.pause = true;
- status = "Banking";
- if (calc.distanceTo(chestL) >= 5) {
- walking.walkTo(chestL);
- sleep(2000);
- }
- if (chest != null) {
- if (chest.isOnScreen() != true && getMyPlayer().isMoving() == false) {
- camera.turnTo(chest);
- walking.walkTileOnScreen(chestL);
- sleep(500);
- }
- }
- if (chest != null && (calc.distanceTo(chest) <= 5)) {
- if (chest.interact("Use") == true) {
- sleep(random(1000, 2000));
- bankLoad.reset();
- }
- }
- }
- public void needPouch(){
- if (!inventory.contains(pouchID) && summoning.getTimeLeft() <= 5
- || !inventory.contains(pouchID)
- && summoning.isFamiliarSummoned() != true) {
- needPouch = true;
- } else if (summoning.getTimeLeft() > 5
- && summoning.isFamiliarSummoned() == true) {
- needPouch = false;
- }
- }
- public void newDoorMethod() {
- try {
- angle.pause = true;
- pitch.pause = true;
- status = "Locating the altar room";
- int x = 0;
- int y = 0;
- if (objects.getNearest(altar) != null
- && objects.getNearest(portalOut) != null) {
- altarLoc = objects.getNearest(altar).getLocation();
- portalLoc = objects.getNearest(portalOut).getLocation();
- if (altarLoc.getX() > (portalLoc.getX() + 4)) {
- east = true;
- x = +4;
- y = 0;
- } else {
- east = false;
- }
- if (altarLoc.getY() > (portalLoc.getY() + 4)) {
- north = true;
- x = -1;
- y = +4;
- } else {
- north = false;
- }
- if (altarLoc.getX() < (portalLoc.getX() - 4)) {
- west = true;
- x = -5;
- y = -1;
- } else {
- west = false;
- }
- if (altarLoc.getY() < (portalLoc.getY() - 4)) {
- south = true;
- x = 0;
- y = -5;
- } else {
- south = false;
- }
- doorOpenX = objects.getNearest(doorOpen);
- doorCoordinates = new RSTile(portalLoc.getX() + x, portalLoc
- .getY()
- + y);
- door = objects.getTopAt(doorCoordinates);
- attempts = 0;
- if (door.getID() != doorOpen && door.isOnScreen() == true) {
- if (door.interact("Open Door") == true
- || door.interact("Open Large door") == true) {
- failSafe.reset();
- while(door.getID()!=doorOpen && failSafe.isRunning()){
- sleep(50);
- }
- }
- }
- if (calc.distanceTo(doorCoordinates) > 1
- && doorOpenX == null
- && getMyPlayer().isMoving() != true) {
- walking.walkTileMM(doorCoordinates);
- sleep(1000,1500);
- }
- if (calc.distanceTo(doorCoordinates) <= 1
- && calc.distanceTo(doorClosedX) <= 1
- && doorOpenX == null) {
- if (doorClosedX.interact("Open Door") == true
- || doorClosedX.interact("Open Large Door") == true) {
- sleep(1000, 1350);
- }
- }
- }
- } catch (final Exception e) {
- }
- }
- public void withdrawitemsNeeded() {
- try {
- if (!interfaces.get(13).isValid() && !interfaces.get(14).isValid()) {
- if (bank.isOpen() == true && game.getClientState() == 11) {
- angle.pause = true;
- pitch.pause = true;
- status = "Banking";
- smelted = false;
- attempts = 0;
- sleep(450, 550);
- if (bank.getCount(bones) == 0
- || bankLoad.isRunning() != true) {
- interfaces.getComponent(762, 63).doClick();
- }
- while (inventory.contains(2566) && bank.isOpen()) {
- if (inventory.getItem(2566).doClick(true) == true) {
- sleep(500);
- }
- }
- if (bankWalkYanille == true) {
- if (bank.depositAllExcept(bones, marrentillID,
- tinderBoxID) == true) {
- }
- }
- if (inventory.getCount(marrentillID) == 2) {
- bank.depositAllExcept(tinderBoxID, hTabs, bones,
- marrentillID, 563, 556, 15707, pouchID);
- } else if (timeToRefresh == true
- && inventory.contains(pouchID) == false) {
- bank.depositAllExcept(tinderBoxID, marrentillID, hTabs,
- 563, 556, 15707, pouchID);
- } else if (inventory.getCount(marrentillID) == 1
- && inventory.getCount(bones) < 20
- && houseLeech == false) {
- bank.depositAllExcept(tinderBoxID, hTabs, 563, 556,
- 15707, pouchID, bones, marrentillID);
- bank.getItem(marrentillID).doClick(true);
- sleep(1500);
- } else if (inventory.getCount(marrentillID) == 1
- && inventory.isFull() == true) {
- if (bank.deposit(bones, 1) == true) {
- sleep(1500);
- }
- } else if (houseLeech == false) {
- bank.depositAllExcept(tinderBoxID, hTabs, 563, 556,
- 15707, pouchID);
- } else if (houseLeech == true) {
- bank.depositAllExcept(bones, hTabs, 563, 556, 15707,
- pouchID);
- }
- if (needPouch == true && !inventory.contains(pouchID)) {
- if (inventory.isFull()) {
- if (bank.deposit(bones, 1) == true) {
- sleep(1500);
- }
- }
- bank.withdraw(pouchID, 1);
- sleep(1500, 1750);
- } else if (needPouch == false
- && inventory.contains(pouchID)) {
- bank.deposit(pouchID, 0);
- sleep(1500);
- }
- if (houseLeech == false) {
- if (!inventory.contains(tinderBoxID)) {
- log
- .severe("No tinderbox in inventory. Stopping script");
- stopScript();
- }
- if (bank.getCount(marrentillID) < 2
- && bank.isOpen() == true) {
- log.severe("out of marrentill. Stopping script");
- stopScript();
- }
- if (!inventory.contains(marrentillID)) {
- bank.withdraw(marrentillID, 2);
- bw.reset();
- }
- while (!inventory.contains(marrentillID)
- && bw.isRunning()) {
- sleep(50);
- }
- }
- if (inventory.getCount(marrentillID) != 2) {
- withdrawitemsNeeded();
- }
- }
- if (bank.getCount(hTabs) < 1 && bank.isOpen() == true
- && inventory.getCount(true, hTabs) < 1
- && useRunes == false && bankWalkYanille == false) {
- log.severe("Out of teleport tabs. Stopping script");
- stopScript();
- } else if (bank.getCount(hTabs) >= 1 && useRunes == false) {
- bank.withdraw(hTabs, 0);
- sleep(1500);
- }
- attempts = 0;
- if (bank.getCount(ringID8) < 1
- && (!inventory.containsOneOf(ringID))
- && usesCount <= 1 && useRod == true) {
- log.severe("Out of rings. Stopping script");
- stopScript();
- } else {
- while (!inventory.contains(ringID8) && attempts <= 3 && usesCount <=1 && useRod == true) {
- sleep(150, 200);
- attempts++;
- bank.withdraw(ringID8, 1);
- bw.reset();
- while (!inventory.contains(ringID8) && bw.isRunning()) {
- sleep(50);
- }
- }
- }
- }
- attempts = 0;
- while (inventory.isFull() == false && attempts <= 3) {
- sleep(150, 200);
- attempts++;
- if (bank.getCount(bones) > 0) {
- if (bank.withdraw(bones, 0) == true) {
- bw.reset();
- while (!inventory.contains(bones) && bw.isRunning()) {
- sleep(50);
- }
- }
- } else if (bank.getCount(bones) == 0 && attempts >= 3) {
- log.severe("Out of bones. Stopping script");
- stopScript();
- }
- }
- if (bank.isOpen() == true) {
- bank.close();
- }
- } catch (final Exception e) {
- }
- }
- public void lightBurner() {
- angle.pause = true;
- pitch.pause = true;
- status = "Lighting the burners";
- if (burnerX != null && getMyPlayer().isMoving() == false) {
- burnerLoc = objects.getNearest(burner).getLocation();
- {
- if (!burnerX.isOnScreen() && game.getClientState() == 11
- || !calc.tileOnScreen(burnerX.getLocation())
- && game.getClientState() == 11) {
- camera.turnTo(burnerX, 20);
- camera.setPitch(random(40, 60));
- }
- }
- if (burnerX != null && getMyPlayer().isMoving() != true
- && getMyPlayer().getAnimation() == -1) {
- if (burnerX.interact("Light Incense Burner") == true) {
- smelted = false;
- attempts = 0;
- sleep(1500, 1750);
- }
- }
- if (calc.distanceTo(burnerX) >= 5
- && getMyPlayer().isMoving() != true
- && getMyPlayer().getAnimation() == -1) {
- walking.walkTileOnScreen(burnerLoc);
- attempts++;
- sleep(500, 750);
- if (attempts >= 5) {
- walking.walkTo(burnerLoc);
- sleep(1500, 2000);
- }
- }
- }
- }
- public void usePortal() {
- status = "House portal detected";
- int portalIn = 0;
- smelted = false;
- if (yanille != null) {
- portalIn = 15482;
- }
- if (taverley != null) {
- portalIn = 15477;
- }
- if (rimmington != null) {
- portalIn = 15478;
- }
- if (pollnivneach != null) {
- portalIn = 15479;
- }
- if (brimhaven != null) {
- portalIn = 15481;
- }
- if (rellekka != null) {
- portalIn = 15480;
- }
- final RSObject Portal = objects.getNearest(portalIn);
- RSComponent houseYanilleMenu = interfaces.getComponent(232, 2);
- RSComponent houseYanilleMenu2 = interfaces.getComponent(234, 2);
- if (Portal != null) {
- if (calc.distanceTo(Portal.getLocation()) <= 5
- && Portal.isOnScreen()) {
- Portal.interact("Enter Portal");
- sleep(random(1000, 1600));
- } if (!Portal.isOnScreen()|| calc.distanceTo(Portal.getLocation()) > 5){
- walking.walkTileMM(Portal.getLocation());
- sleep(3500, 4000);
- }
- if (houseYanilleMenu.isValid() || houseYanilleMenu2.isValid()) {
- interfaces.getComponent(234, 2).doClick();
- interfaces.getComponent(232, 2).doClick();
- Zzz.reset();
- sleep(random(3000, 4000));
- }
- }
- }
- public void teleHouse() {
- status = "Teleporting home";
- com.rarebot.script.wrappers.RSNPC kinBank = npcs.getNearest(9710);
- RSItem item = inventory.getItem(hTabs);
- if (chest != null || kinBank != null) {
- if (item.doClick(true) == true) {
- sleep(random(1500, 2000));
- }
- }
- while (getMyPlayer().getAnimation() != -1 && game.getClientState()==11) {
- sleep(100);
- }
- }
- public void teleHouseR() {
- status = "Casting house tele";
- com.rarebot.script.wrappers.RSNPC kinBank = npcs.getNearest(9710);
- if (kinBank != null || chest != null) {
- if ((magic.castSpell(Magic.SPELL_TELEPORT_TO_HOUSE) == true)) {
- sleep(2000,3000);
- }
- }
- }
- public void offer() {
- try {
- if (smelted == false) {
- angle.pause = true;
- pitch.pause = true;
- }
- status = "Offering the bones";
- if (north == true) {
- altarF = new RSTile(doorCoordinates.getX() + 0, doorCoordinates
- .getY() + 2);
- } else if (south == true) {
- altarF = new RSTile(doorCoordinates.getX() + 0, doorCoordinates
- .getY() - 2);
- } else if (west == true) {
- altarF = new RSTile(doorCoordinates.getX() - 2, doorCoordinates
- .getY() + 0);
- } else if (east == true) {
- altarF = new RSTile(doorCoordinates.getX() + 2, doorCoordinates
- .getY() + 0);
- }
- if (getMyPlayer().getAnimation() != -1) {
- failSafeT.reset();
- Zzz.reset();
- failSafeStuck.reset();
- } // is running
- if (failSafeT.isRunning() == true && inventory.getCount(bones) < 24) {
- int rnd3 = (random(0, 100));
- if (rnd3 == 7) {
- mouse.moveRandomly(50, 350);
- }
- if (ABt.isRunning() != true) {
- antiban();
- }
- }
- RSComponent uhrataValikko = interfaces.getComponent(905, 14);
- if (calc.distanceTo(altarX) >= 5 && smelted == false) {
- walking.walkTo(altarF);
- sleep(2000);
- }
- if (uhrataValikko.isValid() == false) {
- if (getMyPlayer().getAnimation() == -1
- && !uhrataValikko.isValid()
- && failSafeT.isRunning() == false || smelted == false
- || SmeltedT.isRunning() == false) {
- if (altarX.isOnScreen()) {
- if (!inventory.isItemSelected() ) {
- inventory.getItem(bones).interact("Use");
- sleep(200,350);
- }
- if (inventory.isItemSelected() ) {
- altarX.interact("Use");
- sleep(2500, 3000);
- }
- }
- }
- }
- if ((uhrataValikko.interact("Offer All") == true)) {
- smelted = true;
- SmeltedT.reset();
- sleep(random(500, 750));
- angle.pause = false;
- pitch.pause = false;
- }
- } catch (final Exception e) {
- }
- }
- public void duelCheck() {
- try {
- if (equipment.containsOneOf(2564)) {
- usesCount = 2;
- }
- if (equipment.containsOneOf(2562)) {
- usesCount = 3;
- }
- if (equipment.containsOneOf(2560)) {
- usesCount = 4;
- }
- if (equipment.containsOneOf(2558)) {
- usesCount = 5;
- }
- if (equipment.containsOneOf(2556)) {
- usesCount = 6;
- }
- if (equipment.containsOneOf(2554)) {
- usesCount = 7;
- }
- if (equipment.containsOneOf(2552)) {
- usesCount = 8;
- }
- if (equipment.containsOneOf(2566)) {
- usesCount = 1;
- }
- if (usesCount <= 0) {
- usesCount = 0;
- }
- } catch (final Exception e) {
- }
- }
- public void equipRing() {
- status = "Equipping ring";
- try {
- if (inventory.containsOneOf(ringID)) {
- ringItem = inventory.getItem(ringID);
- ringItemTemp = ringItem;
- while (ringItem == ringItemTemp) {
- if (failSafe.isRunning() != true) {
- ringItem.doClick(true);
- failSafe.reset();
- }
- ringItemTemp = inventory.getItem(ringID);
- sleep(200, 300);
- }
- }
- } catch (final Exception e) {
- }
- }
- public void duelTele() {
- status = "RoD teleport";
- attempts = 0;
- int anim = getMyPlayer().getAnimation();
- while (anim ==-1 && game.getClientState() == 11 && chest == null && attempts <3) {
- equipment.getItem(Equipment.RING).interact("Castle Wars");
- sleep(500, 1000);
- failSafeStuck.reset();
- anim = getMyPlayer().getAnimation();
- attempts++;
- }
- while (anim!= -1 && game.getClientState() == 12 ||
- game.getClientState() == 11 && anim != -1) {
- sleep(100);
- anim = getMyPlayer().getAnimation();
- status="CW teleing";
- }
- }
- public void Kinshiptele() {
- status = "Kinship teleport";
- int anim = getMyPlayer().getAnimation();
- attempts = 0;
- while (anim==-1
- && game.getClientState() == 11 && attempts <3) {
- equipment.getItem(Equipment.RING)
- .interact("Teleport to Daemonheim");
- sleep(1000, 1500);
- anim = getMyPlayer().getAnimation();
- failSafeStuck.reset();
- attempts++;
- }
- while (anim!= -1 && game.getClientState() == 12 ||
- game.getClientState() == 11 && anim != -1) {
- sleep(100);
- status="Kinship teleing";
- anim = getMyPlayer().getAnimation();
- }
- }
- public void Kinshipwalk() {
- status = "Kinship walk";
- RSTilePath walktoKinshipBpath = walking.newTilePath(walkToKinshipB);
- walktoKinshipBpath.traverse();
- }
- public void KinshipBanker() {
- status = "Kinship banking";
- com.rarebot.script.wrappers.RSNPC kinBank = npcs.getNearest(9710);
- if (getMyPlayer().getLocation() == kBank) {
- angle.pause = true;
- pitch.pause = true;
- RSTile kBank2;
- kBank2 = new RSTile(3450, 3719);
- walking.walkTileOnScreen(kBank2);
- sleep(1500);
- camera.turnTo(kinBank.getLocation());
- camera.setPitch(random(40, 60));
- }
- if (calc.distanceTo(kinBank) <= 3
- || calc.tileOnScreen(kinBank.getLocation()) == true) {
- kinBank.interact("Bank Fremennik banker");
- sleep(random(2000, 2500));
- bankLoad.reset();
- }
- }
- public void emptyBoB() {
- status = "Emptying BoB";
- if (summoning.doTakeBob() == true) {
- SmeltedT.reset();
- sleep(2000);
- }
- if (inventory.getCount(bones) >= bobRoom) {
- BoBemptied = true;
- BoB = 0;
- } else if (inventory.contains(bones) == false && BoBemptied == false) {
- emptyBoB();
- }
- }
- public void checkBoB() {
- try {
- status = "Checking BoB";
- RSComponent BoBslot = interfaces.getComponent(671, 27);
- RSComponent BoBclose = interfaces.getComponent(671, 13);
- if (!interfaces.get(228).isValid()
- || interfaces.get(228).getComponent(3).getRelativeY() == -1) {
- interfaces.getComponent(INTERFACE_TAB_SUMMONING,
- INTERFACE_TAB_SUMMONING_CHILD).interact("Interact");
- sleep(1000);
- }
- if (interfaces.get(228).isValid()) {
- if (interfaces.get(228).getComponent(3).doClick() == true) {
- sleep(500, 1000);
- }
- }
- if (!interfaces.get(671).isValid()) {
- sleep(1000);
- }
- if (interfaces.get(671).isValid()) {
- if (BoBslot.getComponent(bobRoom).getComponentID() == bones) {
- BoBemptied = false;
- BoB = 18;
- } else {
- BoB = 0;
- }
- if (BoB == 18 || BoB == 0) {
- BoBclose.doClick();
- } else {
- checkBoB();
- {
- }
- }
- }
- } catch (final Exception e) {
- }
- }
- public boolean BoBitems() {
- if (useBoB == true) {
- if (inventory.getCount(bones) >= 20
- && inventory.getCount(marrentillID) == 2
- && portalOutX == null && inventory.contains(tinderBoxID)
- && !inventory.contains(2566)) {
- return true;
- }
- }
- return false;
- }
- public boolean BoBTele() {
- if (useBoB == true && game.isLoggedIn() == true
- && game.getClientState() == 11) {
- if (timeToRefresh == false) {
- if (BoBitems() == true
- && summoning.isFamiliarSummoned() == true
- && summoning.getTimeLeft() > 2
- && summoning.getTimeLeft() < 7
- && summoning.getSummoningPoints() > 10 && usesCount > 1
- && useRod == true || BoBitems() == true
- && summoning.getTimeLeft() > 7 && usesCount > 1
- && summoning.isFamiliarSummoned() == true
- && useRod == true) {
- allowTeleport = true;
- return true;
- } else {
- allowTeleport = false;
- return false;
- }
- }
- }
- return false;
- }
- public void fillBoB() {
- try {
- status = "Filling BoB";
- RSComponent BoBslot = interfaces.getComponent(671, 27);
- RSComponent BoBclose = interfaces.getComponent(671, 13);
- RSItem bones2 = inventory.getItem(bones);
- if (!interfaces.get(228).isValid()
- || interfaces.get(228).getComponent(3).getRelativeY() == -1) {
- interfaces.getComponent(INTERFACE_TAB_SUMMONING,
- INTERFACE_TAB_SUMMONING_CHILD).interact("Interact");
- sleep(1000);
- }
- if (interfaces.get(228).isValid()) {
- if (interfaces.get(228).getComponent(3).doClick() == true) {
- sleep(500, 1000);
- }
- }
- if (!interfaces.get(671).isValid()) {
- sleep(1000);
- }
- if (interfaces.get(671).isValid() == true
- && failSafeT.isRunning() != true) {
- while (bones2 != null
- && BoBslot.getComponent(bobRoom).getComponentID() != bones
- && inventory.getCount(bones) >= bobRoom) {
- if (bones2.interact("Store-All") == true) {
- sleep(1000, 1500);
- failSafeT.reset();
- }
- }
- }
- if (interfaces.get(671).isValid() == true) {
- if (BoBslot.getComponent(bobRoom).getComponentID() == bones) {
- BoBemptied = false;
- BoB = (bobRoom + 1);
- } else {
- BoB = 0;
- fillBoB();
- }
- if (BoB == (bobRoom + 1) || BoB == 0) {
- BoBclose.doClick();
- }
- }
- } catch (final Exception e) {
- }
- }
- public void refreshBoB() {
- angle.pause = false;
- pitch.pause = false;
- status = "Renewing BoB";
- final RSObject Obelisk = objects.getNearest(29954);
- while (bankdoor != null && bankCW.contains(getMyPlayer().getLocation()) && summoning.getSummoningPoints()<=10) {
- camera.turnTo(bankdoor);
- camera.setPitch((random(30,40)));
- bankdoor.doClick();
- sleep(1500, 2000);
- }
- while (calc.distanceTo((obeliskTile)) > 5
- && calc.distanceTo(obeliskTile) < 30
- && summoning.getSummoningPoints() <= 10) {
- status = "Walking to obelisk";
- RSTilePath toObeliskPath = walking.newTilePath(toObelisk);
- toObeliskPath.traverse();
- }
- while (calc.distanceTo(obeliskTile) <= 5
- && summoning.getSummoningPoints() <= 10) {
- status = "Renewing points";
- angle.pause = true;
- pitch.pause = true;
- while (Obelisk.isOnScreen() && summoning.getSummoningPoints()<=10){
- angle.pause = true;
- pitch.pause = true;
- camera.turnTo(Obelisk, 20);
- camera.setPitch(random(40,50));
- Obelisk.interact("Renew-points");
- sleep(2500, 3000);
- }
- }
- if (summoning.isFamiliarSummoned() == false
- && inventory.contains(pouchID)
- && summoning.getSummoningPoints() >= 10) {
- status = "Summoning BoB";
- if (inventory.getItem(pouchID).interact("Summon") == true) {
- needPouch = false;
- log("Summoned Beast of Burden");
- BoB = 0;
- sleep(1000, 1500);
- }
- }
- if (summoning.getSummoningPoints() >= 10 && inventory.contains(pouchID) && timeToRefresh==true) {
- if (interfaces.getComponent(INTERFACE_TAB_SUMMONING,
- INTERFACE_TAB_SUMMONING_CHILD).interact("Renew Familiar") == true) {
- log.severe("Refreshed BoB?!");
- timeToRefresh = false;
- needPouch = false;
- sleep(1500);
- }
- }
- }
- public void openDoor() {
- try {
- status = "Opening the door";
- final RSObject doorOpenX = objects.getNearest(doorOpen);
- final RSObject doorClosedX = objects.getNearest(doorClosed);
- if (doorClosedX != null && calc.distanceTo(doorClosedX) <= 1
- && doorOpenX == null) {
- if (doorClosedX.doClick() == true) {
- sleep(1500);
- }
- }
- } catch (final Exception e) {
- }
- }
- public void walkToDoorOld() {
- angle.pause = true;
- pitch.pause = true;
- status = "Locating the altar room";
- altarX = objects.getNearest(altar);
- doorClosedX = objects.getNearest(doorClosed);
- if (altarX != null && calc.distanceTo(altarX.getLocation()) < 20
- && calc.distanceTo(doorClosedX.getLocation()) > 1) {
- walking.walkTileMM(altarX.getLocation());
- sleep(2000);
- }
- }
- public void antiban() {
- status = "AntiBan";
- rnd = random(0, 4);
- switch (rnd) {
- case 0:
- angle.pause = false;
- pitch.pause = false;
- mouse.moveSlightly();
- ABt.reset();
- break;
- case 1:
- angle.pause = true;
- pitch.pause = true;
- mouse.moveSlightly();
- ABt.reset();
- break;
- case 3:
- angle.pause = true;
- pitch.pause = true;
- status = "Antiban - Mouse Off Screen";
- mouse.moveOffScreen();
- ABt.reset();
- break;
- case 2:
- if (smelted == true && XPcheck.isRunning() != true) {
- if (skills.doHover(70) == true) {
- sleep(2500);
- XPcheck.reset();
- ABt.reset();
- break;
- } else {
- mouse.moveOffScreen();
- break;
- }
- }
- }
- }
- class Angle extends Thread {
- private volatile boolean stop = false;
- private volatile boolean pause = false;
- @Override
- public void run() {
- try {
- while (!stop) {
- if (pause) {
- while (pause) {
- Thread.sleep(random(25, 150));
- }
- }
- if (random(1, 15000) == 342) {
- char key = KeyEvent.VK_RIGHT;
- if (random(1, 5) == 2) {
- key = KeyEvent.VK_LEFT;
- }
- long endTime = System.currentTimeMillis()
- + random(250, 1200);
- keyboard.pressKey(key);
- while (System.currentTimeMillis() < endTime) {
- if (pause)
- break;
- Thread.sleep(random(5, 15));
- }
- keyboard.releaseKey(key);
- Thread.sleep(random(random(1000, 5000), random(11000,
- 17000)));
- }
- }
- } catch (Exception ignored) {
- }
- }
- }
- class Pitch extends Thread {
- private volatile boolean stop = false;
- private volatile boolean pause = false;
- @Override
- public void run() {
- try {
- while (!stop) {
- if (pause) {
- while (pause)
- Thread.sleep(random(25, 150));
- }
- if (camera.getPitch() < 40) {
- camera.setPitch(100);
- }
- if (random(1, 15000) == 342) {
- char key = KeyEvent.VK_UP;
- if (camera.getPitch() >= random(random(50, 86), 100))
- key = KeyEvent.VK_DOWN;
- keyboard.pressKey(key);
- long endTime = System.currentTimeMillis()
- + random(random(50, 150), 500);
- while (System.currentTimeMillis() < endTime) {
- if (pause)
- break;
- else if (camera.getPitch() == 0) {
- if (key == KeyEvent.VK_DOWN)
- break;
- } else if (camera.getPitch() == 100) {
- if (key == KeyEvent.VK_UP)
- break;
- }
- Thread.sleep(random(5, 15));
- }
- keyboard.releaseKey(key);
- Thread.sleep(random(random(1000, 5000), 10001));
- }
- }
- } catch (Exception ignored) {
- }
- }
- }
- private final Color color1 = new Color(0, 0, 0);
- private final Color color2 = new Color(0, 0, 0);
- private final Color color3 = new Color(255, 0, 0);
- private final Color color4 = new Color(204, 0, 0);
- private final Color color5 = new Color(255, 255, 255);
- final Color GREEN = new Color(0, 255, 0, 255);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("Vijaya", 1, 25);
- private final Font font2 = new Font("Miriam Fixed", 0, 14);
- private final Font font3 = new Font("Miriam Fixed", 1, 14);
- public void onRepaint(Graphics g1) {
- if (!showPaint || g1 == null) {
- return;
- }
- if (startTime == 0) {
- startTime = System.currentTimeMillis();
- }
- if (startExp == 0) {
- startExp = skills.getCurrentExp(5);
- }
- if (startLevel == 0) {
- startLevel = skills.getRealLevel(5);
- }
- runTime = System.currentTimeMillis() - startTime;
- seconds = runTime / 1000;
- if (seconds >= 60) {
- minutes = seconds / 60;
- seconds -= minutes * 60;
- }
- if (minutes >= 60) {
- hours = minutes / 60;
- minutes -= hours * 60;
- }
- gainedExp = skills.getCurrentExp(5) - startExp;
- expToLevel = skills.getExpToNextLevel(5);
- if ((minutes > 0 || hours > 0 || seconds > 0) && gainedExp > 0) {
- secExp = (float) gainedExp
- / (float) (seconds + minutes * 60 + hours * 60 * 60);
- }
- minuteExp = secExp * 60;
- hourExp = minuteExp * 60;
- if (secExp > 0) {
- secToLevel = (int) (expToLevel / secExp);
- }
- if (secToLevel >= 60) {
- minutesToLevel = secToLevel / 60;
- secToLevel -= minutesToLevel * 60;
- } else {
- minutesToLevel = 0;
- }
- if (minutesToLevel >= 60) {
- hoursToLevel = minutesToLevel / 60;
- minutesToLevel -= hoursToLevel * 60;
- } else {
- hoursToLevel = 0;
- }
- drawMouseLines(g1);
- Graphics2D g = (Graphics2D) g1;
- g.setColor(color1);
- g.fillRoundRect(9, 346, 495, 125, 16, 16);
- g.fillRoundRect(568, 149, 160, 17, 16, 16);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRoundRect(9, 346, 495, 125, 16, 16);
- g.fillRoundRect(568, 149, 160, 17, 16, 16);
- g.setFont(font1);
- double currentVer = TossutsGildedAltar.class.getAnnotation(
- ScriptManifest.class).version();
- g.drawString("TGA " + currentVer, 70, 366);
- g.setColor(color3);
- g.drawString("TGA " + currentVer, 69, 365);
- g.setColor(GREEN);
- g.fillRect(280, 360, 12, 100);
- g.setColor(color4);
- g.fillRect(280, 360, 12, 100 - skills.getPercentToNextLevel(5));
- g.setColor(color2);
- g.drawRect(280, 360, 12, 100);
- g.setFont(font2);
- g.setColor(color5);
- g.drawString("Status: " + status, 12, 388);
- g.drawString("Running for: " + hours + ":" + minutes + ":" + seconds,
- 12, 408);
- g.drawString("Exp Gained: " + gainedExp + " ("
- + (skills.getRealLevel(5) - startLevel) + ")", 12, 420);
- g.drawString("Bones smelt: " + bonesSmelt, 12, 432);
- g.drawString("Exp per hour: " + (int) hourExp / 1000 + "k", 12, 444);
- g.drawString("Exp TNL: " + expToLevel / 1000 + "k ("
- + (int) (expToLevel / expPer) + " Offerings)", 12, 456);
- g.drawString("Time to level: " + hoursToLevel + ":" + minutesToLevel
- + ":" + secToLevel, 12, 468);
- g.drawString("Stuck: " + failSafeStuck.toRemainingString().toString(),
- 572, 161);
- g.setFont(font3);
- g.setColor(color2);
- g.drawString(skills.getPercentToNextLevel(5) + "% to "
- + (skills.getRealLevel(5) + 1), 300, 420);
- g.setColor(color5);
- g.drawString(skills.getPercentToNextLevel(5) + "% to "
- + (skills.getRealLevel(5) + 1), 299, 419);
- g.setFont(font2);
- if (useRod == true) {
- g.drawString("RoD charges: " + usesCount, 300, 456);
- }
- g.drawString("Click paint to hide it", 300, 468);
- if (doorCoordinates != null) {
- drawTile(g, doorCoordinates, new Color(0, 150, 150, 120), true);
- }
- for (RSObject burnah : objects.getAll()) {
- if (burnahs[0]) {
- if (burnah.getID() == burner) {
- drawTile(g, burnah.getLocation(),
- new Color(250, 0, 0, 120), true);
- }
- if (burnahs[1]) {
- if (burnah.getID() == burnerBurning) {
- drawTile(g, burnah.getLocation(), new Color(0, 250, 0,
- 120), true);
- }
- }
- }
- }
- }
- private void drawTile(Graphics render, RSTile tile, Color color,
- boolean drawCardinalDirections) {
- Point southwest = calc.tileToScreen(tile, 0, 0, 0);
- Point southeast = calc.tileToScreen(new RSTile(tile.getX() + 1, tile
- .getY()), 0, 0, 0);
- Point northwest = calc.tileToScreen(new RSTile(tile.getX(),
- tile.getY() + 1), 0, 0, 0);
- Point northeast = calc.tileToScreen(new RSTile(tile.getX() + 1, tile
- .getY() + 1), 0, 0, 0);
- if (calc.pointOnScreen(southwest) && calc.pointOnScreen(southeast)
- && calc.pointOnScreen(northwest)
- && calc.pointOnScreen(northeast)) {
- render.setColor(Color.BLACK);
- render.drawPolygon(new int[] { (int) northwest.getX(),
- (int) northeast.getX(), (int) southeast.getX(),
- (int) southwest.getX() }, new int[] {
- (int) northwest.getY(), (int) northeast.getY(),
- (int) southeast.getY(), (int) southwest.getY() }, 4);
- render.setColor(color);
- render.fillPolygon(new int[] { (int) northwest.getX(),
- (int) northeast.getX(), (int) southeast.getX(),
- (int) southwest.getX() }, new int[] {
- (int) northwest.getY(), (int) northeast.getY(),
- (int) southeast.getY(), (int) southwest.getY() }, 4);
- if (drawCardinalDirections) {
- render.setColor(Color.WHITE);
- }
- }
- }
- private void drawMouseLines(final Graphics render) {
- try {
- if (!mouse.isPresent())
- return;
- render.setColor(Color.BLACK);
- render.drawLine(0, (int) mouse.getLocation().getY(), game
- .getWidth(), (int) mouse.getLocation().getY());
- render.drawLine((int) mouse.getLocation().getX(), 0, (int) mouse
- .getLocation().getX(), game.getHeight());
- } catch (Exception ex) {
- }
- }
- public void mouseClicked(MouseEvent e) {
- RSComponent inter = interfaces.get(137).getComponent(0);
- if (inter.getArea().contains(e.getPoint())) {
- showPaint = !showPaint;
- }
- }
- public void mousePressed(MouseEvent e) {
- }
- public void mouseReleased(MouseEvent e) {
- }
- public void mouseEntered(MouseEvent e) {
- }
- public void mouseExited(MouseEvent e) {
- }
- /**
- * @author Tossut
- */
- public class TGAninegui2 extends JFrame {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- public TGAninegui2() {
- initComponents();
- }
- private void startActionPerformed(ActionEvent e) {
- whichBones = bonesCB.getSelectedItem().toString();
- whichBanking = bankingCB.getSelectedItem().toString();
- whichBoB = BoBCB.getSelectedItem().toString();
- whichMouseSpeed = comboBox1.getSelectedItem().toString();
- if (userunes.isSelected()) {
- useRunes = true;
- }
- if (altMethod.isSelected()) {
- altMethodb = true;
- }
- guidone = true;
- dispose();
- }
- private void exitActionPerformed(ActionEvent e) {
- dispose();
- stopScript();
- }
- private void initComponents() {
- // JFormDesigner - Component initialization - DO NOT MODIFY
- // //GEN-BEGIN:initComponents
- banking = new JLabel();
- bonesl = new JLabel();
- bankingCB = new JComboBox();
- bonesCB = new JComboBox();
- label4 = new JLabel();
- userunes = new JCheckBox();
- label5 = new JLabel();
- BoBCB = new JComboBox();
- start = new JButton();
- exit = new JButton();
- altMethod = new JCheckBox();
- comboBox1 = new JComboBox();
- label2 = new JLabel();
- // ======== this ========
- setTitle("Tossut Gilded Altar");
- setResizable(false);
- Container contentPane = getContentPane();
- contentPane.setLayout(null);
- // ---- banking ----
- banking.setText("Banking Method:");
- banking.setFont(new Font("Comic Sans MS", Font.PLAIN, 14));
- contentPane.add(banking);
- banking.setBounds(30, 170, 130, banking.getPreferredSize().height);
- // ---- bonesl ----
- bonesl.setText("Bones:");
- bonesl.setFont(new Font("Comic Sans MS", Font.PLAIN, 14));
- contentPane.add(bonesl);
- bonesl.setBounds(30, 110, 55, bonesl.getPreferredSize().height);
- // ---- bankingCB ----
- bankingCB.setModel(new DefaultComboBoxModel(new String[] {
- "Duelling", "Kinship",
- // "Yanille walk"
- }));
- bankingCB.setSelectedIndex(1);
- contentPane.add(bankingCB);
- bankingCB.setBounds(195, 170, 120,
- bankingCB.getPreferredSize().height);
- // ---- bonesCB ----
- bonesCB.setModel(new DefaultComboBoxModel(new String[] { "Bones",
- "Big Bones", "Baby Dragon", "Dragon", "Dagannoth Bones",
- "Frost Dragon", "Infernal Ashes" }));
- bonesCB.setSelectedIndex(3);
- contentPane.add(bonesCB);
- bonesCB.setBounds(195, 110, 120, bonesCB.getPreferredSize().height);
- // ---- label4 ----
- label4.setText("Tossut's Gilded Altar");
- label4.setFont(new Font("Gabriola", Font.ITALIC, 36));
- label4.setHorizontalAlignment(SwingConstants.CENTER);
- label4.setForeground(Color.red);
- contentPane.add(label4);
- label4.setBounds(0, 15, 285, 40);
- // ---- userunes ----
- userunes.setText("Use staff of earth and runes instead of tabs");
- userunes.setFont(new Font("Comic Sans MS", Font.PLAIN, 14));
- contentPane.add(userunes);
- userunes.setBounds(30, 55, 335, userunes.getPreferredSize().height);
- // ---- label5 ----
- label5.setText("Beast of Burden:");
- label5.setFont(new Font("Comic Sans MS", Font.PLAIN, 14));
- contentPane.add(label5);
- label5.setBounds(30, 140, 130, label5.getPreferredSize().height);
- // ---- BoBCB ----
- BoBCB.setModel(new DefaultComboBoxModel(new String[] { "Don't use",
- "Spirit terrorbird", "War Tortoise",
- // "Pack Yak"
- }));
- contentPane.add(BoBCB);
- BoBCB.setBounds(195, 140, 120, BoBCB.getPreferredSize().height);
- // ---- start ----
- start.setText("Start");
- start.setFont(new Font("Comic Sans MS", Font.BOLD, 14));
- start.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- startActionPerformed(e);
- }
- });
- contentPane.add(start);
- start.setBounds(30, 235, 85, 30);
- // ---- exit ----
- exit.setText("Exit");
- exit.setFont(new Font("Comic Sans MS", Font.BOLD, 14));
- exit.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- exitActionPerformed(e);
- }
- });
- contentPane.add(exit);
- exit.setBounds(245, 235, 85, 30);
- // ---- altMethod ----
- altMethod.setText("Use alt. method for opening doors.");
- altMethod.setFont(new Font("Comic Sans MS", Font.PLAIN, 14));
- contentPane.add(altMethod);
- altMethod.setBounds(30, 75, 305, 35);
- // ---- comboBox1 ----
- comboBox1.setModel(new DefaultComboBoxModel(new String[] {
- "3 (Fastest)", "4", "5", "6", "7", "8", "9 (Slowest)" }));
- comboBox1.setSelectedIndex(2);
- contentPane.add(comboBox1);
- comboBox1.setBounds(195, 200, 120,
- comboBox1.getPreferredSize().height);
- // ---- label2 ----
- label2.setText("Mouse speed:");
- label2.setFont(new Font("Comic Sans MS", Font.PLAIN, 14));
- contentPane.add(label2);
- label2.setBounds(30, 200, 105, 30);
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for (int i = 0; i < contentPane.getComponentCount(); i++) {
- Rectangle bounds = contentPane.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width,
- preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height,
- preferredSize.height);
- }
- Insets insets = contentPane.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- contentPane.setMinimumSize(preferredSize);
- contentPane.setPreferredSize(preferredSize);
- }
- setSize(395, 300);
- setLocationRelativeTo(getOwner());
- }
- private JLabel banking;
- private JLabel bonesl;
- private JComboBox bankingCB;
- private JComboBox bonesCB;
- private JLabel label4;
- private JCheckBox userunes;
- private JLabel label5;
- private JComboBox BoBCB;
- private JButton start;
- private JButton exit;
- private JCheckBox altMethod;
- private JComboBox comboBox1;
- private JLabel label2;
- }
- public void onFinish() {
- angle.stop = true;
- pitch.stop = true;
- int hourXp = (int) hourExp;
- log("Thanks for using TGA!");
- env.saveScreenshot(true);
- log(Color.RED, "TGA ran for: " + Integer.toString((int) hours) + ":"
- + Integer.toString((int) minutes) + ":"
- + Integer.toString((int) seconds));
- log(Color.DARK_GRAY, "$melted " + Integer.toString(bonesSmelt)
- + " bones!");
- log(Color.GREEN, "You gained: " + Integer.toString(gainedExp / 1000)
- + "k exp @" + Integer.toString(hourXp / 1000)
- + "k exp per hour!");
- }
- @Override
- public void messageReceived(MessageEvent e) {
- final String message = e.getMessage().toLowerCase();
- final int s = e.getID();
- if (message.contains("offer") && s == 109) {
- bonesSmelt++;
- }
- if (message.contains("you've just")) {
- smelted = false;
- log(message);
- }
- if (message.contains("burden has no more items") && s == 0) {
- BoBemptied = true;
- BoB = 0;
- }
- if (message.contains("Your familiar cannot carry any more items")) {
- BoBemptied = false;
- BoB = bobRoom+1;
- }
- if (message.contains("duelling has seven") && s == 0) {
- usesCount = 7;
- }
- if (message.contains("duelling has six") && s == 0) {
- usesCount = 6;
- }
- if (message.contains("duelling has five") && s == 0) {
- usesCount = 5;
- }
- if (message.contains("duelling has four") && s == 0) {
- usesCount = 4;
- }
- if (message.contains("duelling has three") && s == 0) {
- usesCount = 3;
- }
- if (message.contains("duelling has two") && s == 0) {
- usesCount = 2;
- }
- if (message.contains("duelling has one") && s == 0) {
- usesCount = 1;
- }
- }
- }
Add Comment
Please, Sign In to add comment