Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scripts.Liam;
- import org.tribot.api.DynamicClicking;
- import org.tribot.api.General;
- import org.tribot.api.Timing;
- import org.tribot.api.input.Mouse;
- import org.tribot.api.types.generic.Condition;
- import org.tribot.api.util.ABCUtil;
- import org.tribot.api2007.Banking;
- import org.tribot.api2007.Camera;
- import org.tribot.api2007.Inventory;
- import org.tribot.api2007.Objects;
- import org.tribot.api2007.Player;
- import org.tribot.api2007.Players;
- import org.tribot.api2007.Trading;
- import org.tribot.api2007.WebWalking;
- import org.tribot.api2007.Skills.SKILLS;
- import org.tribot.api2007.WorldHopper;
- import org.tribot.api2007.ext.Filters;
- import org.tribot.api2007.types.RSArea;
- import org.tribot.api2007.types.RSItem;
- import org.tribot.api2007.types.RSObject;
- import org.tribot.api2007.types.RSPlayer;
- import org.tribot.api2007.types.RSTile;
- public class Variables {
- public static boolean RunScript = true;
- public static int RockIDs[] = {14864,14883,14863};
- public static int CoalRockIDs[] = {14861,14860};
- static RSTile coal1 = new RSTile(3149,3151,0);
- static RSTile coal2 = new RSTile(3147,3148,0);
- static RSTile CoalCorner1 = new RSTile(3143,3144,0);
- static RSTile CoalCorner2 = new RSTile(3150,3154,0);
- static RSTile TinCorner1 = new RSTile(3223,3145,0);
- static RSTile TinCorner2 = new RSTile(3230,3150,0);
- static RSArea TinMine = new RSArea(TinCorner1,TinCorner2);
- static RSArea WholeMine = new RSArea(CoalCorner1,CoalCorner2);
- static RSArea CoalMine = new RSArea(coal1,coal2);
- public static int OresMined = 0;
- public static boolean GUI_COMPLETE = false;
- public static String MuleName = "";
- public static int MuleWorld;
- public static boolean NeedTrade = false;
- public static int PickIDs[] = {1265,1267,1267,1273,1271,1275};
- public static final int BotWorld = WorldHopper.getWorld();
- static ABCUtil abc = new ABCUtil();
- public static void StartBank(){
- if(!Banking.isInBank()){
- WebWalking.walkToBank();
- }
- General.sleep(200,2000);
- Banking.openBank();
- General.sleep(500,1000);
- if(Inventory.getAll().length > 0){
- Banking.depositAll();
- }
- General.sleep(1000,3000);
- RSItem[] pick = Banking.find(PickIDs);
- if(pick.length > 0){
- Banking.withdrawItem(pick[0], 1);
- }else
- {
- General.println("Could not find pickaxe....");
- }
- General.sleep(200,500);
- Banking.close();
- General.sleep(2000,4000);
- }
- public static void WalkToRocks(){
- WebWalking.walkTo(TinMine.getRandomTile());
- General.sleep(100,500);
- }
- public static boolean IsAtRocks(){
- return TinMine.contains(Player.getPosition());
- }
- public static boolean randomPercent(int min, int max){
- return General.random(1, 100) <= General.random(min, max);
- }
- public static boolean isMining(){
- return true;
- }
- public static boolean MineTin(){
- if(abc.TIME_TRACKER.ROTATE_CAMERA.next() > System.currentTimeMillis()){
- abc.performRotateCamera();
- abc.TIME_TRACKER.ROTATE_CAMERA.reset();
- }
- abc.performTimedActions(SKILLS.MINING);
- if(!Player.isMoving() && Player.getAnimation() == -1 && !Inventory.isFull()){
- final RSObject rocks[]= Objects.findNearest(15, RockIDs);
- if(rocks.length > 0){
- RSObject rock = rocks[randomPercent(40,90) ? 0:General.random(0, rocks.length - 1)];
- if(rock != null){
- if(rock.isOnScreen()){
- if(DynamicClicking.clickRSObject(rock,"Mine")){
- Timing.waitCondition(new Condition()
- {
- @Override
- public boolean active()
- {
- General.sleep(100);
- abc.performTimedActions(SKILLS.MINING);
- return Player.getAnimation() != -1;
- }
- }, General.random(4000, 6000));
- }
- }else {
- Camera.turnToTile(rock);
- }
- }
- }
- }
- return false;
- }
- public static void DropTin(){
- Inventory.dropAllExcept(PickIDs);
- }
- public static void WalkToCoalMine(){
- WebWalking.walkTo(CoalMine.getRandomTile());
- }
- public static boolean MineCoal(){
- if(abc.TIME_TRACKER.ROTATE_CAMERA.next() > System.currentTimeMillis()){
- abc.performRotateCamera();
- abc.TIME_TRACKER.ROTATE_CAMERA.reset();
- }
- abc.performTimedActions(SKILLS.MINING);
- if(Player.getAnimation() == -1 && !Inventory.isFull()){
- final RSObject rocks[]= Objects.findNearest(15, CoalRockIDs);
- if(rocks.length != 0){
- RSObject rock = rocks[randomPercent(40,90) ? 0:General.random(0, rocks.length - 1)];
- if(rock != null){
- if(rock.isOnScreen()){
- if(DynamicClicking.clickRSObject(rock,"Mine")){
- Timing.waitCondition(new Condition()
- {
- @Override
- public boolean active()
- {
- General.sleep(100);
- abc.performTimedActions(SKILLS.MINING);
- return Player.getAnimation() != -1;
- }
- }, General.random(4000, 6000));
- }
- }
- }
- }
- }
- return false;
- }
- public static boolean AtCoalMine(){
- return WholeMine.contains(Player.getPosition());
- }
- public static void WalkToBank(){
- WebWalking.walkToBank();
- Timing.waitCondition(new Condition()
- {
- @Override
- public boolean active()
- {
- General.sleep(100);
- return !Player.isMoving();
- }
- }, General.random(10000, 20000));
- }
- public static void BankCoal(){
- if(Banking.isInBank()){
- if(!Banking.isBankScreenOpen()){
- Banking.openBank();
- }
- General.sleep(1000,3000);
- Banking.depositAllExcept(PickIDs);
- if(Inventory.find("Adamant pickaxe").length == 0){
- Banking.deposit(1, "Bronze pickaxe");
- General.sleep(200,500);
- RSItem[] AddyPick = Banking.find("Adamant pickaxe");
- if(AddyPick.length > 0){
- Banking.withdraw(1,"Adamant pickaxe");
- General.sleep(200,500);
- }else{
- General.println("Could find find addy pick!");
- }
- }
- General.sleep(1000,2000);
- if(Banking.find("Coal")[0].getStack() >= 2000){
- NeedTrade = true;
- }
- General.sleep(100,500);
- if(!NeedTrade){
- Banking.close();
- }
- }
- }
- public static void WithdrawCoal(){
- General.sleep(1500,2500);
- RSItem[] coal = Banking.find("Coal");
- if(coal[0] != null){
- Mouse.clickBox(292, 316, 362, 325,1);
- General.sleep(200,900);
- Banking.withdraw(0,"Coal");
- General.sleep(1000,3000);
- Banking.close();
- }
- }
- static RSPlayer getMuleRSPlayer(String muleName) {
- RSPlayer[] players = Players.find(Filters.Players.nameEquals(muleName));
- if (players.length > 0) return players[0];
- return null;
- }
- public static void TradeMule(){
- WorldSwitcher.scrollToWorld(MuleWorld);
- General.sleep(1000,1500);
- while(WorldHopper.getWorld() != MuleWorld){
- WorldSwitcher.switchWorld(MuleWorld);
- }
- General.sleep(6000,9000);
- getMuleRSPlayer(MuleName).click("Trade");
- Timing.waitCondition(new Condition()
- {
- @Override
- public boolean active()
- {
- General.sleep(100);
- return Trading.getWindowState() == Trading.WINDOW_STATE.FIRST_WINDOW;
- }
- }, General.random(10000, 20000));
- if(Trading.offer(0, "Coal")){
- Trading.accept();
- General.sleep(1000,2000);
- if(Trading.getWindowState() == Trading.WINDOW_STATE.SECOND_WINDOW){
- Trading.accept();
- NeedTrade = false;
- General.sleep(2000,4000);
- WorldSwitcher.scrollToWorld(BotWorld);
- General.sleep(1000,2000);
- if(WorldHopper.getWorld() != BotWorld){
- WorldSwitcher.switchWorld(BotWorld);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement