Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scripts;
- import java.awt.Graphics;
- import java.awt.Point;
- import org.tribot.api.Timing;
- import org.tribot.api.input.Keyboard;
- import org.tribot.api.input.Mouse;
- import org.tribot.api.types.generic.Condition;
- import org.tribot.api.types.generic.Filter;
- import org.tribot.api2007.Banking;
- import org.tribot.api2007.Camera;
- import org.tribot.api2007.Interfaces;
- import org.tribot.api2007.Inventory;
- import org.tribot.api2007.Objects;
- import org.tribot.api2007.Player;
- import org.tribot.api2007.Projection;
- import org.tribot.api2007.Walking;
- import org.tribot.api2007.types.RSItem;
- import org.tribot.api2007.types.RSObject;
- import org.tribot.api2007.types.RSTile;
- import org.tribot.script.Script;
- import org.tribot.script.interfaces.Painting;
- public class AeroGildedAltar extends Script implements Painting {
- public static RSTile[] yanillePath = new RSTile[] {
- new RSTile(2610, 3093),
- new RSTile(2598, 3098),
- new RSTile(2586, 3097),
- new RSTile(2575, 3090),
- new RSTile(2560, 3089),
- new RSTile(2545, 3091)
- };
- public static RSTile[] yanillePathReverse;
- public static int ITEM_BIG_BONES = 532;
- public static int OBJECT_EXIT_PORTAL = 13405;
- public static int OBJECT_YANILLE_PORTAL = 15482;
- public static int OBJECT_BANK_BOOTH = 2213;
- public static String NAME = "Goodwin";
- @Override
- public void run() {
- if (!onStart()) {
- stopScript();
- } else {
- while (true) {
- loop();
- }
- }
- }
- public boolean onStart()
- {
- Mouse.setSpeed(100);
- yanillePathReverse = reversePath(yanillePath);
- return true;
- }
- public void loop()
- {
- RSObject[] portalObject = Objects.find(20, OBJECT_YANILLE_PORTAL);
- RSObject[] altairObject = Objects.find(20, new Filter<RSObject>() {
- @Override
- public boolean accept(RSObject arg0) {
- return arg0.getID() == 13197;
- }
- });
- if (Inventory.find(ITEM_BIG_BONES).length > 0) {
- if (altairObject.length > 0) {
- if (Interfaces.get(399) == null) {
- if (Player.getPosition().distanceTo(altairObject[0].getPosition()) > 5) {
- Walking.walkTo(altairObject[0].getPosition());
- } else if (altairObject[0].isOnScreen()) {
- RSItem[] bones = Inventory.find(ITEM_BIG_BONES);
- if (bones[0].click("use")) {
- if (altairObject[0].click("-> Altar")) {
- Timing.waitCondition(new Condition() {
- @Override
- public boolean active() {
- return Player.getAnimation() == 3705;
- }
- }, 2000);
- }
- }
- } else {
- Camera.turnToTile(altairObject[0].getPosition());
- }
- }
- } else if (Interfaces.get(232, 3) != null) {
- if (Interfaces.get(232, 3).click("Continue")) {
- sleep(1750, 2000);
- Keyboard.typeSend(NAME);
- sleep(2000, 3000);
- }
- } else if (portalObject.length > 0) {
- if (portalObject[0].isOnScreen()) {
- if (!Player.isMoving()) {
- Camera.setCameraAngle(0);
- Point point = Projection.tileToScreen(portalObject[0].getPosition(), 10);
- Mouse.click(new Point(point.x + 1, point.y), 1);
- }
- } else {
- Camera.turnToTile(portalObject[0].getPosition());
- Walking.walkTo(portalObject[0].getPosition());
- }
- } else {
- Walking.walkPath(yanillePath);
- }
- } else {
- RSObject[] exitportal = Objects.find(20, OBJECT_EXIT_PORTAL);
- RSObject[] bankbooth = Objects.find(20, OBJECT_BANK_BOOTH);
- if (exitportal.length > 0) {
- if (exitportal[0].isOnScreen()) {
- if (!Player.isMoving()) {
- Camera.setCameraAngle(0);
- Point point = Projection.tileToScreen(exitportal[0].getPosition(), 10);
- Mouse.click(new Point(point.x + 1, point.y), 1);
- }
- } else {
- Walking.walkTo(exitportal[0].getPosition());
- Camera.turnToTile(exitportal[0].getPosition());
- }
- } else if (bankbooth.length > 0) {
- if (bankbooth[0].isOnScreen()) {
- if (!Banking.isBankScreenOpen()) {
- if (bankbooth[0].click("Bank")) {
- Timing.waitCondition(new Condition() {
- @Override
- public boolean active() {
- return Banking.isBankScreenOpen();
- }
- }, 2000);
- }
- } else {
- if (Inventory.getCount(ITEM_BIG_BONES) > 0) {
- Banking.close();
- } else {
- if (Banking.find(ITEM_BIG_BONES)[0].click("Withdraw All")) {
- Banking.close();
- }
- }
- }
- } else {
- Camera.turnToTile(bankbooth[0].getPosition());
- }
- } else {
- Walking.walkPath(yanillePathReverse);
- }
- }
- }
- @Override
- public void onPaint(Graphics arg0) {
- // TODO Auto-generated method stub
- }
- public static RSTile[] reversePath(RSTile[] path) {
- RSTile[] reverse = new RSTile[path.length];
- int index = 0;
- for (int i = path.length - 1; i >= 0; i--) {
- if(path[i] == null) {
- continue;
- }
- reverse[index] = path[i];
- index++;
- }
- return reverse;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement