Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scripts;
- import java.awt.BorderLayout;
- import java.awt.Color;
- import java.awt.Container;
- import java.awt.Desktop;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.GridBagConstraints;
- import java.awt.GridBagLayout;
- import java.awt.Image;
- import java.awt.Insets;
- import java.awt.RenderingHints;
- import org.tribot.api.DynamicClicking;
- import org.tribot.api.General;
- import org.tribot.api.input.Mouse;
- import org.tribot.api2007.Banking;
- import org.tribot.api2007.Camera;
- import org.tribot.api2007.Combat;
- import org.tribot.api2007.Equipment;
- import org.tribot.api2007.GameTab;
- import org.tribot.api2007.GroundItems;
- import org.tribot.api2007.Interfaces;
- import org.tribot.api2007.Inventory;
- import org.tribot.api2007.Login;
- import org.tribot.api2007.NPCs;
- import org.tribot.api2007.Objects;
- import org.tribot.api2007.Player;
- import org.tribot.api2007.Skills;
- import org.tribot.api2007.Walking;
- import org.tribot.api2007.WorldHopper;
- import org.tribot.api2007.ext.Doors;
- import org.tribot.api2007.GameTab.TABS;
- import org.tribot.api2007.Skills.SKILLS;
- import org.tribot.api2007.types.RSGroundItem;
- import org.tribot.api2007.types.RSItem;
- import org.tribot.api2007.types.RSNPC;
- import org.tribot.api2007.types.RSObject;
- import org.tribot.api2007.types.RSTile;
- import org.tribot.script.Script;
- import org.tribot.script.ScriptManifest;
- import org.tribot.script.interfaces.MessageListening07;
- import org.tribot.script.interfaces.Painting;
- import scripts.DTools.DAntiban;
- import scripts.DTools.Newsloader;
- import java.awt.event.*;
- import java.io.IOException;
- import java.net.MalformedURLException;
- import java.net.URI;
- import java.net.URISyntaxException;
- import java.net.URL;
- import java.util.ArrayList;
- import javax.imageio.ImageIO;
- import javax.swing.*;
- import javax.swing.border.EmptyBorder;
- @ScriptManifest(authors = { "TheD" }, category = "TheDScripts", name = "DClay", description = "DScripting - Settings in GUI")
- public class DClay extends Script implements Painting, MessageListening07
- {
- private int taskToDo = 0;
- RSTile[] pos = {
- new RSTile(3180,3371,0), new RSTile(3183,3378,0)
- , new RSTile(2631,3139,0), new RSTile(3054,9818,0)} ;
- RSTile[] ore_locations = {
- new RSTile(3180,3372,0), new RSTile(3179,3371,0), new RSTile(3183,3377,0), new RSTile(0000,0000,0),
- new RSTile(3054,9819,0), new RSTile(3053,9818,0)};
- private int ore_nr = 0;
- private int locUsing = 0;
- private int softClayMade = 0;
- private boolean stopinteraction = false;
- private int dangerousRock = 0;
- private int randomState = 0;
- private boolean can_kill_mugger = false;
- private String debug = "Debug";
- private int pathLocation;
- private State scriptState = State.MINE;
- private WettingState wState = WettingState.W_WAIT;
- private int tactiCal = 0;
- private final long startTime = System.currentTimeMillis();
- private long startTime_switch = System.currentTimeMillis();
- private long startTime_switch2 = System.currentTimeMillis();
- private long Start_XP = Skills.getXP(SKILLS.MINING);
- private long Current_XP = Skills.getXP(SKILLS.MINING);
- private int[] pickaxes = {1265,1267,1269,1271,1273,1275,12297};
- private int Mypickaxe = 0;
- private long startNewsTime = System.currentTimeMillis();
- //Paint variable start
- private int xpGot = 0;
- private int clayMined = 0;
- private int timeRan = 0;
- private double multiplier = 0;
- private int hours = 0;
- private int minutes = 0;
- private int seconds = 0;
- private int clayPH = 0;
- private int softclayPH = 0;
- //Paint variable end
- private int hop_when = 0;
- private boolean isMember = false;
- private final Font font2 = new Font("Arial", Font.BOLD, 14);
- private final Font font3 = new Font("Arial", 1, 16);
- private boolean GUIWait = true;
- private GUI g = new GUI();
- private ArrayList<String> latestNews = new ArrayList<String>();
- private boolean useMajorAB = false;
- ArrayList<String> thechat = new ArrayList<String>();
- private int softenloc = 0;
- private String locuse = "";
- private boolean count_incr = true;
- private int curr_count = 0;
- private boolean can_mine = false;
- private boolean skipWait = false;
- private boolean is_in_respawn = false;
- private boolean is_in_spawn = false;
- private int start_clay = 0;
- private boolean first_time_set_clay = false;
- private boolean isInLumby = false;
- private boolean isAtReSpawn = false;
- private boolean pickeq = false;
- private boolean end_after_time = false;
- private int end_hour = 0;
- private int end_minute = 0;
- private int end_second = General.random(1, 59);
- private boolean equippick = false;
- private final RSTile[] PATH_TO_BANK = {
- new RSTile(3184,3376,0), new RSTile(3178,3381,0),
- new RSTile(3173,3388,0), new RSTile(3168,3396,0),
- new RSTile(3168,3406,0), new RSTile(3170,3415,0),
- new RSTile(3170,3423,0), new RSTile(3178,3429,0),
- new RSTile(3183,3439,0)};
- private final RSTile[] PATH_TO_BANK2 = {
- new RSTile(3175,3387,0), new RSTile(3170,3399,0),
- new RSTile(3170,3412,0), new RSTile(3171,3426,0),
- new RSTile(3179,3428,0), new RSTile(3183,3439,0)};
- private final RSTile[] PATH_TO_MINE = {
- new RSTile(3175,3428,0), new RSTile(3171,3415,0),
- new RSTile(3169,3402,0), new RSTile(3174,3390,0),
- new RSTile(3178,3383,0), new RSTile(3182,3370,0)};
- private final RSTile[] PATH_TO_MINE2 = {
- new RSTile(3178,3428,0), new RSTile(3170,3422,0),
- new RSTile(3170,3408,0), new RSTile(3172,3394,0),
- new RSTile(3177,3383,0), new RSTile(3183,3378,0)};
- private final RSTile[] W_PATH_TO_WELL = {
- new RSTile(3024,3359,0), new RSTile(3032,3358,0),
- new RSTile(3038,3352,0)};
- private final RSTile[] W_PATH_TO_BANK = {
- new RSTile(3030,3357,0), new RSTile(3022,3360,0),
- new RSTile(3013,3356,0)};
- private final RSTile[] YAN_PATH_TO_BANK = {
- new RSTile(2628,3129,0), new RSTile(2629,3122,0),
- new RSTile(2621,3115,0), new RSTile(2617,3105,0),
- new RSTile(2608,3099,0), new RSTile(2610,3094,0)};
- private final RSTile[] YAN_PATH_TO_MINE = {
- new RSTile(2615,3104,0), new RSTile(2616,3111,0),
- new RSTile(2621,3116,0), new RSTile(2625,3123,0),
- new RSTile(2629,3129,0), new RSTile(2629,3136,0)};
- private final RSTile[] PATH_TO_STAIRS = {
- new RSTile(3045,9813,0), new RSTile(3043,9803,0),
- new RSTile(3043,9791,0), new RSTile(3049,9781,0),
- new RSTile(3057,9777,0)};
- private final RSTile[] PATH_TO_FALLY_BANK = {
- new RSTile(3053,3365,0), new RSTile(3044,3358,0),
- new RSTile(3032,3357,0), new RSTile(3022,3360,0),
- new RSTile(3013,3356,0)};
- private final RSTile[] PATH_TO_HOUSE = {
- new RSTile(3021,3361,0), new RSTile(3030,3365,0),
- new RSTile(3043,3369,0), new RSTile(3055,3368,0),
- new RSTile(3061,3372,0)};
- private final RSTile[] FAL_PATH_TO_MINE = {
- new RSTile(3051,9781,0), new RSTile(3046,9788,0),
- new RSTile(3043,9797,0), new RSTile(3044,9806,0),
- new RSTile(3048,9815,0), new RSTile(3054,9818,0)};
- private final RSTile[] PATH_TO_SPAWN = {
- new RSTile(3226,3218,0), new RSTile(3235,3220,0),
- new RSTile(3233,3231,0)};
- private final RSTile[] PATH_TO_FALADOR_BANK = {
- new RSTile(3225,3235,0), new RSTile(3216,3240,0),
- new RSTile(3203,3243,0), new RSTile(3192,3245,0),
- new RSTile(3181,3247,0), new RSTile(3172,3251,0),
- new RSTile(3160,3254,0), new RSTile(3149,3253,0),
- new RSTile(3141,3259,0), new RSTile(3134,3263,0),
- new RSTile(3122,3262,0), new RSTile(3112,3262,0),
- new RSTile(3106,3267,0), new RSTile(3095,3272,0),
- new RSTile(3084,3279,0), new RSTile(3072,3277,0),
- new RSTile(3060,3276,0), new RSTile(3049,3275,0),
- new RSTile(3040,3276,0), new RSTile(3032,3278,0),
- new RSTile(3023,3277,0), new RSTile(3013,3277,0),
- new RSTile(3007,3285,0), new RSTile(3007,3296,0),
- new RSTile(3006,3307,0), new RSTile(3007,3317,0),
- new RSTile(3006,3329,0), new RSTile(3007,3339,0),
- new RSTile(3006,3349,0), new RSTile(3013,3356,0)};
- private final RSTile[] PATH_TO_VARROCK_MINE = {
- new RSTile(3234,3241,0), new RSTile(3232,3251,0),
- new RSTile(3240,3261,0), new RSTile(3241,3272,0),
- new RSTile(3239,3281,0), new RSTile(3240,3292,0),
- new RSTile(3238,3302,0), new RSTile(3228,3308,0),
- new RSTile(3224,3319,0), new RSTile(3217,3325,0),
- new RSTile(3210,3333,0), new RSTile(3205,3341,0),
- new RSTile(3200,3349,0), new RSTile(3201,3360,0),
- new RSTile(3194,3366,0), new RSTile(3187,3370,0),
- new RSTile(3181,3371,0)};
- public enum State
- {
- STARTUP_WALKING_SPAWN,START_UP_WALKING,MINE,WALK_TO_BANK,OPEN_BANK,DEPOSIT,WALK_TO_MINE,GET_ON_POSITION,FLEE,GO_MINE,TRAMP,WALK_TO_STAIRS,GET_OUT_OF_HOUSE,CLIMB_STAIRS,WALK_TO_HOUSE,GET_IN_HOUSE,CLIMB_DOWN_STAIRS,GET_IN_BANK,DWARF_COMBAT,NOTHING
- }
- public enum WettingState{
- W_TO_WELL,W_FILL,W_USE,W_MAKE_ALL,W_TO_BANK,W_START_WITHDRAW,W_WAIT, W_OPEN_BANK, W_DEPOSIT, W_TAKE_CLAY, W_FAILSAFE1, W_FAILSAFE2
- }
- private State getState()
- {
- if(isInFallyBank(Player.getRSPlayer().getPosition()) && pathLocation > 0) pathLocation = 0;
- if(checkHop()) return State.NOTHING;
- //Check if we lost to many resources. If we did, we should think about hopping...
- RSNPC[] mugger = NPCs.findNearest(175);
- int inventorySize = Inventory.getAll().length;
- if(mugger.length > 0)
- {
- if(mugger[0].isInteractingWithMe() && can_kill_mugger)
- {
- return State.TRAMP;
- }
- }
- if(isUnderFallyBank(Player.getRSPlayer().getPosition()))
- return State.GET_IN_BANK;
- if(isInRespawn(Player.getRSPlayer().getPosition())) { is_in_respawn = true; return State.STARTUP_WALKING_SPAWN; }
- if(isInSpawn(Player.getRSPlayer().getPosition())) { is_in_spawn = true; return State.START_UP_WALKING; }
- if(isOnPos(pos[locUsing].getX(),pos[locUsing].getY()) && Player.getRSPlayer().isInCombat()) return State.DWARF_COMBAT;
- if(locUsing < 3 && !isInHouse(Player.getRSPlayer().getPosition()) && Player.getRSPlayer().isInCombat() && scriptState != State.WALK_TO_STAIRS && scriptState != State.CLIMB_STAIRS && scriptState != State.WALK_TO_MINE && scriptState != State.GET_ON_POSITION && Player.getRSPlayer().getPosition().getY() < 5000)
- return State.FLEE;
- if(Player.getPosition().getY() < 3362 && Player.getPosition().getX() < 3170 && locUsing != 2 && locUsing != 3)
- return State.GO_MINE;
- if(isOnPos(pos[locUsing].getX(),pos[locUsing].getY()) && !Inventory.isFull() && (Player.getAnimation() == -1 || can_mine == true))
- return State.MINE;
- if(Inventory.isFull() && Interfaces.get(12, 90) == null && Player.getPosition().getY() < 3433)
- {
- if(locUsing < 2 && !isInVarrockBank(Player.getRSPlayer().getPosition())) return State.WALK_TO_BANK;
- if(locUsing == 2 && Player.getPosition().getY() > 3098) return State.WALK_TO_BANK;
- }
- if(locUsing == 3 && Inventory.isFull() && !Banking.isBankScreenOpen() && Player.getRSPlayer().getPosition().getY() > 9000 && !isAtStairs(Player.getRSPlayer().getPosition())) return State.WALK_TO_STAIRS;
- if(locUsing == 3 && isInHouse(Player.getRSPlayer().getPosition()) && Inventory.isFull()) return State.GET_OUT_OF_HOUSE;
- if(locUsing == 3 && isNearHouse(Player.getRSPlayer().getPosition()) && !isInHouse(Player.getRSPlayer().getPosition()) && !Inventory.isFull()) return State.GET_IN_HOUSE;
- if(locUsing == 3 && isInHouse(Player.getRSPlayer().getPosition()) && !Inventory.isFull()) return State.CLIMB_DOWN_STAIRS;
- if(locUsing == 3 && !Player.getRSPlayer().isMoving() && !isInFallyBank(Player.getRSPlayer().getPosition()) && pathLocation == 4 && isAroundFallyBank(Player.getRSPlayer().getPosition())) return State.GET_IN_BANK;
- if(locUsing == 3 && !isInHouse(Player.getRSPlayer().getPosition()) && Inventory.isFull() && !isInFallyBank(Player.getRSPlayer().getPosition()) && Player.getRSPlayer().getPosition().getX() > 3008 && Player.getRSPlayer().getPosition().getY() < 9000) return State.WALK_TO_BANK;
- if(locUsing == 3 && isAtStairs(Player.getRSPlayer().getPosition()) && Inventory.isFull()) return State.CLIMB_STAIRS;
- if(locUsing == 3 && Inventory.isFull() && isInFallyBank(Player.getRSPlayer().getPosition()) && !Banking.isBankScreenOpen()) return State.OPEN_BANK;
- if(Inventory.isFull() && !Banking.isBankScreenOpen())
- {
- if(locUsing < 2 && isInVarrockBank(Player.getRSPlayer().getPosition())) return State.OPEN_BANK;
- if(locUsing == 2 && Player.getPosition().getY() < 3098) return State.OPEN_BANK;
- }
- if((Inventory.isFull() || inventorySize > 1) && Banking.isBankScreenOpen())
- return State.DEPOSIT;
- if(!Inventory.isFull())
- {
- if(locUsing < 2 && Player.getPosition().getY() > 3384) return State.WALK_TO_MINE;
- if(locUsing == 2 && Player.getPosition().getY() < 3132) return State.WALK_TO_MINE;
- if(locUsing == 3 && Player.getPosition().getX() < 3057 && Player.getPosition().getY() < 3374) return State.WALK_TO_HOUSE;
- if(locUsing == 3 && Player.getPosition().getY() < 9812) return State.WALK_TO_MINE;
- }
- if(!Inventory.isFull() && !isOnPos(pos[locUsing].getX(),pos[locUsing].getY()))
- return State.GET_ON_POSITION;
- return State.NOTHING;
- }
- private WettingState getWstate()
- {
- RSItem[] clay = Inventory.find("Clay");
- RSItem[] emptyBucket = Inventory.find("Bucket");
- RSItem[] waterBucket = Inventory.find("Bucket of water");
- RSItem[] softClay = Inventory.find("Soft clay");
- RSTile pos = Player.getRSPlayer().getPosition();
- if(Interfaces.get(241, 1) != null && Interfaces.get(230, 1) == null)
- {
- if(Interfaces.get(241, 1).getText().startsWith("Bank")) return WettingState.W_FAILSAFE1;
- }
- if(Interfaces.get(230, 1) != null)
- {
- if(Interfaces.get(230, 1).getText().startsWith("I'd like to ac")) return WettingState.W_FAILSAFE2;
- }
- if(Player.getRSPlayer().isInCombat())
- return WettingState.W_TO_BANK;
- if(clay.length < 1 && emptyBucket.length < 1 && waterBucket.length < 1 && softClay.length < 1)
- return WettingState.W_START_WITHDRAW;
- if(clay.length == 14 && emptyBucket.length == 14)
- {
- if(softenloc == 1 && pos.getX() < 3035) return WettingState.W_TO_WELL;
- if(softenloc == 2 && (pos.getY() < 3499 || pos.getX() > 3090)) return WettingState.W_TO_WELL;
- }
- if(emptyBucket.length > 0)
- {
- if(softenloc == 1 && pos.getX() > 3034) return WettingState.W_FILL;
- if(softenloc == 2 && pos.getY() > 3495 && pos.getX() < 3090) return WettingState.W_FILL;
- }
- if(Interfaces.get(309,6) != null)
- return WettingState.W_MAKE_ALL;
- if(Banking.isBankScreenOpen() && waterBucket.length == 14 && clay.length == 14)
- Banking.close();
- if(!Banking.isBankScreenOpen() && waterBucket.length > 0 && clay.length > 0)
- return WettingState.W_USE;
- if(softClay.length == 14 && waterBucket.length == 14)
- {
- if(softenloc == 1 && (pos.getX() > 3019 || pos.getY() > 3360))
- return WettingState.W_TO_BANK;
- if(softenloc == 2 && (pos.getX() < 3089 || pos.getY() > 3498))
- return WettingState.W_TO_BANK;
- }
- if(!Banking.isBankScreenOpen() && softClay.length == 14 && (waterBucket.length == 14 || emptyBucket.length == 14))
- {
- if(softenloc == 1 && pos.getX() < 3019) return WettingState.W_OPEN_BANK;
- if(softenloc == 2 && pos.getX() > 3090 && pos.getY() < 3499) return WettingState.W_OPEN_BANK;
- }
- if(Banking.isBankScreenOpen() && softClay.length > 0)
- return WettingState.W_DEPOSIT;
- if(Banking.isBankScreenOpen() && softClay.length < 1 && clay.length < 1)
- return WettingState.W_TAKE_CLAY;
- return WettingState.W_WAIT;
- }
- private boolean isUnderFallyBank(RSTile p)
- {
- if(p.getX() > 3005 && p.getX() < 3025 && p.getY() < 3354 && p.getY() > 3345)
- return true;
- return false;
- }
- private boolean isInSpawn(RSTile p)
- {
- if(p.getX() < 3237 && p.getX() > 3228 && p.getY() > 3225 && p.getY() < 3236)
- return true;
- return false;
- }
- private boolean isInRespawn(RSTile p)
- {
- if(p.getX() < 3230 && p.getX() > 3216 && p.getY() > 3210 && p.getY() < 3225)
- return true;
- return false;
- }
- private boolean isInVarrockBank(RSTile p)
- {
- if(p.getX() < 3191 && p.getX() > 3179 && p.getY() > 3432 && p.getY() < 3448)
- return true;
- return false;
- }
- private boolean isAroundFallyBank(RSTile p)
- {
- if(p.getX() < 3030 && p.getX() > 3000 && p.getY() > 3358 && p.getY() < 3380)
- return true;
- return false;
- }
- private boolean isInHouse(RSTile p)
- {
- if(p.getX() < 3063 && p.getX() > 3057 && p.getY() > 3374 && p.getY() < 3382)
- return true;
- return false;
- }
- private boolean isNearHouse(RSTile p)
- {
- if(p.getX() < 3066 && p.getX() > 3052 && p.getY() > 3362 && p.getY() < 3386)
- return true;
- return false;
- }
- private boolean isAtStairs(RSTile p)
- {
- if(p.getX() < 3062 && p.getX() > 3052 && p.getY() > 9770 && p.getY() < 9781)
- return true;
- return false;
- }
- private boolean isInFallyBank(RSTile p)
- {
- if(p.getX() < 3020 && p.getX() > 3008 && p.getY() > 3354 && p.getY() < 3359)
- return true;
- return false;
- }
- private boolean isAtVarrockMine(RSTile p)
- {
- if(p.getX() < 3187 && p.getX() > 3170 && p.getY() > 3363 && p.getY() < 3380)
- return true;
- return false;
- }
- private boolean isOnPos(int xxxx, int yyyy)
- {
- if(Player.getPosition().getX() == xxxx && Player.getPosition().getY() == yyyy)
- return true;
- return false;
- }
- @Override
- public void run() {
- hop_when = General.random(15, 30);
- latestNews = Newsloader.getNews();
- General.useAntiBanCompliance(true);
- g.setVisible(true);
- while(GUIWait == true)
- {
- sleep(500);
- if(!GUIWait) continue;
- }
- if(taskToDo == 1)
- {
- if(locUsing == 0 || locUsing == 1)
- {
- locuse = "Varrock west";
- }
- if(locUsing == 2)
- {
- locuse = "Yanille";
- }
- if(locUsing == 3)
- {
- locuse = "Falador East";
- }
- }
- else if(taskToDo == 2)
- {
- if(softenloc == 1)
- {
- locuse = "Falador East";
- }
- if(softenloc == 2)
- {
- locuse = "Edgeville";
- }
- }
- if(taskToDo == 1)
- {
- if(!skipWait)
- {
- log("Welcome to DScripts... Starting in: 13");
- sleep(1000);
- log("Welcome to DScripts... Starting in: 12");
- sleep(1000);
- log("If running in Varrock, we recommend lvl 15+ CB Use DChickens to get there fast!... Starting in: 11");
- sleep(1000);
- log("If running in Varrock, we recommend lvl 15+ CB Use DChickens to get there fast!... Starting in: 10");
- sleep(1000);
- log("You are currently using: "+this.getScriptName()+"... Starting in: 9");
- sleep(1000);
- log("You are currently using: "+this.getScriptName()+"... Starting in: 8");
- sleep(1000);
- log("You are running the script at: "+locuse+"... Starting in: 7");
- sleep(1000);
- log("You are running the script at: "+locuse+"... Starting in: 6");
- sleep(1000);
- log("Either Equip your pickaxe, or have it in your inventory... Starting in: 5");
- sleep(1000);
- log("Either Equip your pickaxe, or have it in your inventory... Starting in: 4");
- sleep(1000);
- log("Either Equip your pickaxe, or have it in your inventory... Starting in: 3");
- sleep(1000);
- log("Either Equip your pickaxe, or have it in your inventory... Starting in: 2");
- sleep(1000);
- log("Either Equip your pickaxe, or have it in your inventory... Starting in: 1");
- sleep(1000);
- log("Enjoy DScripting's DClay!");
- }
- curr_count = Inventory.getCount("Clay");
- count_incr = true;
- for(int i=0; i< pickaxes.length; i++)
- {
- if(Inventory.find(pickaxes[i]).length > 0)
- {
- System.out.println("We found an inventory pickaxe!");
- Mypickaxe = pickaxes[i];
- break;
- }
- }
- for(int j=0; j< pickaxes.length; j++)
- {
- if(Equipment.isEquipped(pickaxes[j]))
- {
- System.out.println("We found an equipped pickaxe!");
- Mypickaxe = pickaxes[j];
- pickeq = true;
- break;
- }
- }
- }
- else if(taskToDo == 2)
- {
- if(!skipWait)
- {
- log("Welcome to DScripts");
- sleep(2500);
- log("You are currently using: "+this.getScriptName()+"Wetter");
- sleep(2500);
- log("HAVE CLAY & BUCKETS IN TOP OF THE BANK!");
- sleep(5000);
- }
- }
- while(true)
- {
- DAntiban.activateRun();
- if(taskToDo == 1)
- {
- if(end_after_time)
- {
- if((hours == end_hour && minutes >= end_minute && seconds >= end_second) || (hours > end_hour))
- {
- System.out.println("Ending script...");
- log("Ending script...");
- while(Login.getLoginState() == Login.STATE.INGAME)
- {
- Login.logout();
- sleep(500,5000);
- if(Login.getLoginState() != Login.STATE.INGAME) break;
- }
- log("Logged out & Ended script...");
- System.out.println("Logged out & Ended script...");
- this.stopScript();
- }
- }
- checkIncr();
- checkGas();
- if(scriptState != State.OPEN_BANK)
- {
- DAntiban.timedActions();
- }
- if(tactiCal == 4) switchStates();
- if(checkStumpy())
- {
- repairStumpy();
- }
- else if(Interfaces.get(229, 0) != null)
- {
- if(Interfaces.get(229, 0).getText().startsWith("You need a"))
- {
- if(Interfaces.get(229,0).getText().contains("Your inventory is too full"))
- {
- System.out.println("inventory is full");
- }
- else
- {
- System.out.println("Pickaxe broke - please repair at bob.");
- this.stopScript();
- }
- }
- }
- else
- if(loop() > 0)
- {
- log("Main Loop found an error.");
- }
- } else
- if(taskToDo == 2)
- {
- if(end_after_time)
- {
- if((hours == end_hour && minutes >= end_minute && seconds >= end_second) || (hours >= end_hour && minutes > end_minute))
- {
- System.out.println("Ending script...");
- log("Ending script...");
- while(Login.getLoginState() == Login.STATE.INGAME)
- {
- Login.logout();
- sleep(500,5000);
- if(Login.getLoginState() != Login.STATE.INGAME) break;
- }
- log("Logged out & Ended script...");
- System.out.println("Logged out & Ended script...");
- this.stopScript();
- }
- }
- DAntiban.timedActions();
- if(wettingLoop() > 0)
- {
- log("Main Loop found an error.");
- }
- }
- }
- }
- private boolean checkHop()
- {
- if(DAntiban.getResourcesLost() > hop_when)
- {
- log("We are losing to many resources in this world, we are hopping!");
- DAntiban.smartSleep(1000);
- log("Resetting resources lost");
- DAntiban.setResourcesLost(0);
- DAntiban.smartSleep(300);
- hop_when = General.random(15, 30);
- log("We will hop again when we lost "+hop_when+" resources!");
- WorldHopper.changeWorld(WorldHopper.getRandomWorld(isMember, false));
- sleep(6000,10000);
- return true;
- }
- return false;
- }
- private void checkIncr()
- {
- if(count_incr = true)
- {
- int last_count = curr_count;
- curr_count = Inventory.getCount("Clay");
- if(last_count < curr_count)
- {
- DAntiban.incrementResourcesWon();
- count_incr = false;
- }
- }
- }
- private int wettingLoop()
- {
- wState = getWstate();
- switch(wState)
- {
- case W_START_WITHDRAW:
- log("Start withdraw items!");
- if(softenloc == 1)
- {
- DAntiban.openPreferedBank();
- }
- else
- {
- DAntiban.openPreferedBank();
- }
- if(Banking.isBankScreenOpen())
- {
- if(Inventory.find(434).length < 14) Banking.withdraw(14, 434);
- if(Inventory.find(1925).length < 14) Banking.withdraw(14, 1925);
- }
- break;
- case W_TO_WELL:
- if(softenloc == 1) walk(W_PATH_TO_WELL);
- if(softenloc == 2)
- {
- if(Player.isMoving()) break;
- DAntiban.goToAnticipated(new RSTile(3087,3502,0));
- DAntiban.smartSleep(1500);
- }
- break;
- case W_FILL:
- log("Filling buckets...");
- RSItem[] emptyBucket = Inventory.find("Bucket");
- if(softenloc == 1)
- {
- RSObject[] well = Objects.getAt(new RSTile(3038,3353,0));
- if(well.length > 0 && emptyBucket.length > 0)
- {
- emptyBucket[0].click("Use");
- DAntiban.smartSleep(700,900);
- DynamicClicking.clickRSObject(well[0], "Use");
- DAntiban.smartSleep(1750,2250);
- int bamt = emptyBucket.length;
- while(emptyBucket.length < 15)
- {
- bamt = emptyBucket.length;
- DAntiban.timedActions();
- DAntiban.generateTrackers(2000);
- DAntiban.sleepReactionTime();
- emptyBucket = Inventory.find("Bucket");
- if(bamt == emptyBucket.length)
- {
- DAntiban.smartSleep(500);
- break;
- }
- }
- }
- }
- else
- {
- if(Camera.getCameraAngle() < 50) Camera.setCameraAngle(General.random(50, 100));
- if(Camera.getCameraRotation() < 120 || Camera.getCameraRotation() > 200) Camera.setCameraRotation(General.random(120,200));
- RSObject[] well = Objects.find(50, 884);
- if(well.length > 0 && emptyBucket.length > 0)
- {
- if(!well[0].getPosition().isOnScreen()) { DAntiban.goToAnticipated(new RSTile(well[0].getPosition().getX(),well[0].getPosition().getY() - 3, 0)); DAntiban.smartSleep(1250); break; }
- emptyBucket[0].click("Use");
- DAntiban.smartSleep(800,1000);
- DynamicClicking.clickRSObject(well[0], "Use");
- DAntiban.smartSleep(2250);
- int bamt = emptyBucket.length;
- while(emptyBucket.length < 15)
- {
- bamt = emptyBucket.length;
- DAntiban.smartSleep(1200);
- emptyBucket = Inventory.find(1925);
- if(bamt == emptyBucket.length)
- {
- DAntiban.smartSleep(500);
- break;
- }
- }
- }
- }
- break;
- case W_USE:
- log("Using clay on bucket...");
- RSItem[] clay = Inventory.find(434);
- RSItem[] waterBucket = Inventory.find(1929);
- if(clay.length > 0 && waterBucket.length > 0)
- {
- int method = General.random(1, 2);
- if(method == 1)
- {
- clay[0].click("Use");
- DAntiban.smartSleep(700,900);
- waterBucket[0].click("Use");
- DAntiban.smartSleep(1800,2200);
- } else {
- waterBucket[0].click("Use");
- DAntiban.smartSleep(800,1000);
- clay[0].click("Use");
- DAntiban.smartSleep(1800,2200);
- }
- }
- break;
- case W_MAKE_ALL:
- log("Making soft clay...");
- RSItem[] ssoftClay = Inventory.find("Soft clay");
- if(Interfaces.get(309, 6) != null)
- {
- Interfaces.get(309, 6).click("Make All");
- DAntiban.smartSleep(2000);
- }
- int cursClay = ssoftClay.length;
- while(ssoftClay.length < 14)
- {
- cursClay = ssoftClay.length;
- DAntiban.timedActions();
- DAntiban.generateTrackers(2000);
- DAntiban.sleepReactionTime();
- ssoftClay = Inventory.find("Soft clay");
- if(cursClay == ssoftClay.length)
- {
- DAntiban.smartSleep(400);
- break;
- }
- }
- break;
- case W_TO_BANK:
- log("Walking to bank");
- if(softenloc == 1) walk(W_PATH_TO_BANK);
- if(softenloc == 2)
- {
- if(Player.isMoving()) break;
- DAntiban.goToAnticipated(new RSTile(3095,3495,0));
- }
- break;
- case W_OPEN_BANK:
- log("Opening bank...");
- GameTab.open(TABS.INVENTORY);
- DAntiban.openPreferedBank();
- DAntiban.generateTrackers(1000);
- DAntiban.sleepReactionTime();
- break;
- case W_DEPOSIT:
- log("Depositing...");
- RSItem[] softClay = Inventory.find("Soft clay");
- if(softClay.length > 0)
- {
- Banking.depositAllExcept("Bucket of water", "Bucket");
- }
- if(!first_time_set_clay)
- {
- first_time_set_clay = true;
- if(Banking.find("Soft clay") != null && Banking.find("Soft clay").length > 0)
- {
- start_clay = Banking.find("Soft clay")[0].getStack();
- }
- else
- {
- start_clay = 0;
- }
- }
- DAntiban.generateTrackers(500);
- DAntiban.sleepReactionTime();
- break;
- case W_TAKE_CLAY:
- log("Withdrawing clay...");
- if(Banking.find("Soft clay").length > 0)
- {
- softClayMade = (Banking.find("Soft clay")[0].getStack() - start_clay);
- }
- RSItem[] invclay = Inventory.find("Clay");
- if(invclay.length < 1) Banking.withdraw(14, "Clay");
- DAntiban.generateTrackers(500);
- DAntiban.sleepReactionTime();
- break;
- case W_FAILSAFE1:
- log("Fail-safe opening bank");
- if(Interfaces.get(241, 3) != null) Interfaces.get(241, 3).click("Continue");
- DAntiban.smartSleep(1250);
- break;
- case W_FAILSAFE2:
- log("Fail-safe opening bank");
- if(Interfaces.get(230, 1) != null) {
- if(Interfaces.get(230, 1).getText().startsWith("I'd like to ac"))
- Interfaces.get(230, 1).click("Continue");
- }
- DAntiban.smartSleep(1200,1400);
- break;
- }
- return 0;
- }
- private boolean checkStumpy()
- {
- RSItem[] stumpy = Inventory.find(466);
- if(stumpy.length > 0)
- {
- return true;
- }
- return false;
- }
- private void repairStumpy()
- {
- RSItem[] stumpy = Inventory.find(466);
- RSItem[] runePheadInv = Inventory.find(490);
- RSItem[] addyPheadInv = Inventory.find(488);
- RSItem[] mithPheadInv = Inventory.find(486);
- RSItem[] steelPheadInv = Inventory.find(484);
- RSItem[] ironPheadInv = Inventory.find(482);
- RSItem[] bronzePheadInv = Inventory.find(480);
- if(stumpy.length > 0)
- {
- RSGroundItem[] runePhead = GroundItems.findNearest(490);
- if(runePhead.length > 0)
- {
- if(!runePhead[0].getPosition().isOnScreen()) DAntiban.goToAnticipated(runePhead[0].getPosition());
- if(runePhead[0].getPosition().isOnScreen()) runePhead[0].click("Take");
- }
- RSGroundItem[] addyPhead = GroundItems.findNearest(488);
- if(addyPhead.length > 0)
- {
- if(!addyPhead[0].getPosition().isOnScreen()) DAntiban.goToAnticipated(addyPhead[0].getPosition());
- if(addyPhead[0].getPosition().isOnScreen()) addyPhead[0].click("Take");
- }
- RSGroundItem[] mithPhead = GroundItems.findNearest(486);
- if(mithPhead.length > 0)
- {
- if(!mithPhead[0].getPosition().isOnScreen()) DAntiban.goToAnticipated(mithPhead[0].getPosition());
- if(mithPhead[0].getPosition().isOnScreen()) mithPhead[0].click("Take");
- }
- RSGroundItem[] steelPhead = GroundItems.findNearest(484);
- if(steelPhead.length > 0)
- {
- if(!steelPhead[0].getPosition().isOnScreen()) DAntiban.goToAnticipated(steelPhead[0].getPosition());
- if(steelPhead[0].getPosition().isOnScreen()) steelPhead[0].click("Take");
- }
- RSGroundItem[] ironPhead = GroundItems.findNearest(482);
- if(ironPhead.length > 0)
- {
- if(!ironPhead[0].getPosition().isOnScreen()) DAntiban.goToAnticipated(ironPhead[0].getPosition());
- if(ironPhead[0].getPosition().isOnScreen()) ironPhead[0].click("Take");
- }
- RSGroundItem[] bronzePhead = GroundItems.findNearest(480);
- if(bronzePhead.length > 0)
- {
- if(!bronzePhead[0].getPosition().isOnScreen()) DAntiban.goToAnticipated(bronzePhead[0].getPosition());
- if(bronzePhead[0].getPosition().isOnScreen()) bronzePhead[0].click("Take");
- }
- }
- if(runePheadInv.length>0)
- {
- runePheadInv[0].click("Use");
- DAntiban.smartSleep(1600,1900);
- stumpy[0].click("Use");
- }
- if(addyPheadInv.length>0)
- {
- addyPheadInv[0].click("Use");
- DAntiban.smartSleep(1600,1900);
- stumpy[0].click("Use");
- }
- if(mithPheadInv.length>0)
- {
- mithPheadInv[0].click("Use");
- DAntiban.smartSleep(1600,1900);
- stumpy[0].click("Use");
- }
- if(steelPheadInv.length>0)
- {
- steelPheadInv[0].click("Use");
- DAntiban.smartSleep(1600,1900);
- stumpy[0].click("Use");
- }
- if(ironPheadInv.length>0)
- {
- ironPheadInv[0].click("Use");
- DAntiban.smartSleep(1600,1900);
- stumpy[0].click("Use");
- }
- if(bronzePheadInv.length>0)
- {
- bronzePheadInv[0].click("Use");
- DAntiban.smartSleep(1600,1900);
- stumpy[0].click("Use");
- }
- }
- private void checkGas()
- {
- RSObject[] gasRock = Objects.find(10, 15491);
- RSObject[] gasRock2 = Objects.find(10, 15493);
- RSObject[] gasRock3 = Objects.find(10, 15492);
- RSObject[] gasRock4 = Objects.find(10, 15492);//falador ore 1
- RSObject[] gasRock5 = Objects.find(10, 15492);//falador ore 2
- if(gasRock.length > 0)
- {
- if(gasRock[0].getPosition().getX() == 3180 && gasRock[0].getPosition().getY() == 3372)
- dangerousRock = 2;
- if(!stopinteraction) { stopinteraction = true; DynamicClicking.clickRSTile(Player.getPosition(), "Walk here"); }
- }
- else if(gasRock2.length > 0)
- {
- if(gasRock2[0].getPosition().getX() == 3179 && gasRock2[0].getPosition().getY() == 3371)
- dangerousRock = 1;
- if(!stopinteraction) { stopinteraction = true; DynamicClicking.clickRSTile(Player.getPosition(), "Walk here"); }
- }
- else if(gasRock3.length > 0)
- {
- if(gasRock3[0].getPosition().getX() == 3179 && gasRock3[0].getPosition().getY() == 3371)
- dangerousRock = 3;
- if(!stopinteraction) { stopinteraction = true; DynamicClicking.clickRSTile(Player.getPosition(), "Walk here"); }
- }
- else if(gasRock4.length > 0)
- {
- if(gasRock4[0].getPosition().getX() == 3054 && gasRock4[0].getPosition().getY() == 9819)
- dangerousRock = 3;
- if(!stopinteraction) { stopinteraction = true; DynamicClicking.clickRSTile(Player.getPosition(), "Walk here"); }
- }
- else if(gasRock5.length > 0)
- {
- if(gasRock5[0].getPosition().getX() == 3053 && gasRock5[0].getPosition().getY() == 9818)
- dangerousRock = 3;
- if(!stopinteraction) { stopinteraction = true; DynamicClicking.clickRSTile(Player.getPosition(), "Walk here"); }
- }
- else
- {
- dangerousRock = 0;
- stopinteraction = false;
- }
- }
- int myTimer = 0;
- int myTimer2 = 0;
- int waitTimer = 15;
- private void switchStates()
- {
- myTimer = (int) (((System.currentTimeMillis()) - (startTime_switch))/1000);
- myTimer2 = (int) ((System.currentTimeMillis() - (startTime_switch2))/1000);
- if(myTimer2 > 5) { waitTimer = General.random(5, 30); startTime_switch2 = System.currentTimeMillis();}
- if(myTimer > waitTimer)
- {
- randomState = General.random(1, 2);
- startTime_switch = System.currentTimeMillis();
- }
- }
- private int loop()
- {
- if(!Combat.isAutoRetaliateOn())
- {
- Combat.setAutoRetaliate(true);
- DAntiban.smartSleep(1500);
- }
- if(equippick)
- {
- RSItem[] pick = Inventory.find(Mypickaxe);
- if(pick.length > 0)
- {
- if(pick[0] != null)
- {
- pick[0].click("Wield");
- DAntiban.sleep(General.random(2, 14));
- }
- }
- }
- scriptState = getState();
- switch(scriptState)
- {
- case TRAMP:
- log("Mugger is attacking us..");
- RSNPC[] mugger = NPCs.findNearest("Mugger");
- if(mugger.length > 0)
- {
- if(mugger[0] != null)
- {
- if(!mugger[0].isInCombat())
- mugger[0].click("Attack");
- }
- }
- break;
- case DWARF_COMBAT:
- log("For some reason a Dwarf is or a Scorpion is attacking us, killing it!");
- RSNPC[] Targetz = NPCs.getAll();
- RSNPC monster_to_slay = null;
- for(int z=0; z< Targetz.length; z++)
- {
- if(Targetz[z] != null && Targetz[z].isInteractingWithMe() == true && Player.getRSPlayer().getPosition().distanceTo(Targetz[z].getPosition()) < 3)
- {
- monster_to_slay = Targetz[z];
- }
- if(monster_to_slay != null && !monster_to_slay.isInCombat())
- {
- monster_to_slay.click("Attack");
- DAntiban.setLastUnderAttackTime(System.currentTimeMillis());
- DAntiban.generateTrackers(1500);
- DAntiban.sleepReactionTime();
- DAntiban.timedActions();
- }
- }
- break;
- case GO_MINE:
- log("Running back to the mine!");
- RSTile back = new RSTile((Player.getPosition().getX() + 5), (Player.getPosition().getY() + 5), 0);
- DAntiban.goToAnticipated(back);
- break;
- case FLEE:
- log("Running from combat!");
- RSTile run = new RSTile((Player.getPosition().getX() - 5), (Player.getPosition().getY() - 5), 0);
- DAntiban.goToAnticipated(run);
- break;
- case MINE:
- pathLocation = 0;
- log("Mining clay...");
- RSObject[] mine1 = Objects.getAt(new RSTile(3180,3372,0)); //Varrock ore 1
- RSObject[] mine2 = Objects.getAt(new RSTile(3179,3371,0)); //Varrock ore 2
- RSObject[] mine3 = Objects.getAt(new RSTile(3183,3377,0)); // Varrock ore 3
- RSObject[] mine4 = Objects.findNearest(8,2109); // Yanille ore 2
- RSObject[] mine5 = Objects.getAt(new RSTile(3054,9819,0)); // Falador ore 1
- RSObject[] mine6 = Objects.getAt(new RSTile(3053,9818,0)); // Falador ore 2
- if(mine1.length > 0 && (tactiCal == 1 || tactiCal == 3 || randomState == 1) && dangerousRock != 1)
- {
- if(mine1[0].getID() != 7469 && mine1[0].getID() != 7468)
- {
- ore_nr = 0;
- DynamicClicking.clickRSObject(mine1[0], "Mine");
- generateTrackers();
- DAntiban.sleepReactionTime();
- count_incr = true;
- can_mine = false;
- }
- }
- else
- if(mine2.length > 0 && (tactiCal == 2 || tactiCal == 3 || randomState == 2) && dangerousRock != 2)
- {
- if(mine2[0].getID() != 7469 && mine2[0].getID() != 7468)
- {
- ore_nr = 1;
- DynamicClicking.clickRSObject(mine2[0], "Mine");
- generateTrackers();
- DAntiban.sleepReactionTime();
- count_incr = true;
- can_mine = false;
- }
- }
- else
- if(mine3.length > 0 && tactiCal == 5 && dangerousRock != 3)
- {
- if(mine3[0].getID() != 7469 && mine3[0].getID() != 7468)
- {
- ore_nr = 2;
- DynamicClicking.clickRSObject(mine3[0], "Mine");
- generateTrackers();
- DAntiban.sleepReactionTime();
- count_incr = true;
- can_mine = false;
- }
- }
- else
- if(mine4.length > 0 && tactiCal == 6 && dangerousRock != 4)
- {
- if(mine4[0].getID() != 7469 && mine4[0].getID() != 7468)
- {
- ore_nr = 3;
- DynamicClicking.clickRSObject(mine4[0], "Mine");
- generateTrackers();
- DAntiban.sleepReactionTime();
- count_incr = true;
- can_mine = false;
- }
- }
- else
- if(mine5.length > 0 && tactiCal == 7 && dangerousRock != 5)
- {
- if(mine5[0].getID() != 7469 && mine5[0].getID() != 7468)
- {
- ore_nr = 4;
- DynamicClicking.clickRSObject(mine5[0], "Mine");
- generateTrackers();
- DAntiban.sleepReactionTime();
- count_incr = true;
- can_mine = false;
- }
- }
- else
- if(mine6.length > 0 && tactiCal == 8 && dangerousRock != 6)
- {
- if(mine6[0].getID() != 7469 && mine6[0].getID() != 7468)
- {
- ore_nr = 5;
- DynamicClicking.clickRSObject(mine6[0], "Mine");
- generateTrackers();
- DAntiban.sleepReactionTime();
- count_incr = true;
- can_mine = false;
- }
- }
- break;
- case WALK_TO_BANK:
- if(locUsing == 0) walk(PATH_TO_BANK);
- if(locUsing == 1) walk(PATH_TO_BANK2);
- if(locUsing == 2) walk(YAN_PATH_TO_BANK);
- if(locUsing == 3) walk(PATH_TO_FALLY_BANK);
- if(DAntiban.getResourcesLost() > 19)
- {
- System.out.println("Calming down... We lower resources lost a bit, so we won't hop to soon");
- DAntiban.setResourcesLost(DAntiban.getResourcesLost() - (General.random(1, 14)));
- }
- break;
- case WALK_TO_STAIRS:
- if(locUsing == 3) walk(PATH_TO_STAIRS);
- break;
- case WALK_TO_HOUSE:
- if(locUsing == 3) walk(PATH_TO_HOUSE);
- break;
- case GET_OUT_OF_HOUSE:
- if(Doors.handleDoorAt(new RSTile(3061,3374,0), true))
- {
- DAntiban.goToAnticipated(new RSTile(3060,3369,0));
- }
- if(Doors.getDoorAt(new RSTile(3061,3375,0)) != null && !Player.getRSPlayer().isMoving())
- DAntiban.goToAnticipated(new RSTile(3060,3369,0));
- break;
- case GET_IN_BANK:
- if(locUsing == 3)
- {
- DAntiban.goToAnticipated(new RSTile(3013,3356,0));
- pathLocation = 0;
- }
- break;
- case GET_IN_HOUSE:
- if(Doors.getDoorAt(new RSTile(3061,3374,0)) != null)
- {
- RSTile doorPos = new RSTile(3061,3374,0);
- while(!doorPos.isOnScreen())
- {
- if(!Player.getRSPlayer().isMoving())
- DAntiban.goToAnticipated(new RSTile(3061,3373,0));
- DAntiban.smartSleep(800,1200);
- if(doorPos.isOnScreen() || Doors.getDoorAt(new RSTile(3061,3374,0)) == null) break;
- }
- }
- if(Doors.handleDoorAt(new RSTile(3061,3374,0), true))
- {
- DAntiban.generateTrackers(100);
- DAntiban.sleepReactionTime();
- if(Doors.getDoorAt(new RSTile(3061,3375,0)) != null && !Player.getRSPlayer().isMoving()) DAntiban.goToAnticipated(new RSTile(3061,3377,0));
- }
- if(Doors.getDoorAt(new RSTile(3061,3375,0)) != null && !Player.getRSPlayer().isMoving())
- DAntiban.goToAnticipated(new RSTile(3061,3377,0));
- break;
- case CLIMB_DOWN_STAIRS:
- RSObject[] a = Objects.find(5, "Staircase");
- if(a !=null && a.length > 0)
- {
- DynamicClicking.clickRSObject(a[0], "Climb-down");
- pathLocation = 0;
- DAntiban.generateTrackers(250);
- DAntiban.sleepReactionTime();
- }
- break;
- case CLIMB_STAIRS:
- RSObject[] b = Objects.find(5, "Staircase");
- if(b !=null && b.length > 0)
- {
- DynamicClicking.clickRSObject(b[0], "Climb-up");
- pathLocation = 0;
- DAntiban.generateTrackers(250);
- DAntiban.sleepReactionTime();
- }
- break;
- case OPEN_BANK:
- log("Opening bank...");
- pathLocation = 0;
- if(locUsing < 2)
- {
- if(Player.isMoving()) break;
- DAntiban.openPreferedBank();
- DAntiban.smartSleep(900,1200);
- }
- else
- {
- DAntiban.openPreferedBank();
- DAntiban.smartSleep(700,1300);
- }
- break;
- case DEPOSIT:
- log("Depositing clay...");
- pathLocation = 0;
- RSItem[] clay = Inventory.find("Clay");
- if(clay.length > 0)
- {
- Banking.depositAllExcept(Mypickaxe);
- }
- DAntiban.smartSleep(1400,1800);
- if(Inventory.getAll().length > 1)
- {
- log("Depositing other stuff...");
- Banking.depositAllExcept(Mypickaxe);
- }
- break;
- case WALK_TO_MINE:
- if(locUsing == 0) walk(PATH_TO_MINE);
- if(locUsing == 1) walk(PATH_TO_MINE2);
- if(locUsing == 2) walk(YAN_PATH_TO_MINE);
- if(locUsing == 3) walk(FAL_PATH_TO_MINE);
- break;
- case GET_ON_POSITION:
- pathLocation = 0;
- log("Trying to get on the correct location.");
- if(Player.getRSPlayer().isMoving()) break;
- if(pos[locUsing].isOnScreen())
- Walking.clickTileMS(pos[locUsing], "Walk here");
- else
- Walking.walkTo(pos[locUsing]);
- while(Player.getRSPlayer().isMoving())
- {
- DAntiban.smartSleep(500,1500);
- if(!Player.getRSPlayer().isMoving()) break;
- }
- DAntiban.generateTrackers(500);
- DAntiban.sleepReactionTime();
- break;
- case STARTUP_WALKING_SPAWN:
- log("Walking to spawn location");
- while(is_in_respawn)
- {
- walk(PATH_TO_SPAWN);
- if(isInSpawn(Player.getRSPlayer().getPosition())) { pathLocation = 0; is_in_respawn = false; break; }
- }
- break;
- case START_UP_WALKING:
- log("Walking to next location");
- while(is_in_spawn)
- {
- if(locUsing == 0 || locUsing == 1)
- {
- walk(PATH_TO_VARROCK_MINE);
- if(isAtVarrockMine(Player.getRSPlayer().getPosition()))
- {
- pathLocation = 0;
- is_in_spawn = false;
- break;
- }
- }
- if(locUsing == 3)
- {
- walk(PATH_TO_FALADOR_BANK);
- if(isInFallyBank(Player.getRSPlayer().getPosition()))
- {
- pathLocation = 0;
- is_in_spawn = false;
- break;
- }
- }
- }
- break;
- case NOTHING:
- //We are probably doing our mining emotion right now! :)
- if(Player.getRSPlayer().getAnimation() > 0 && starvedMine() && can_mine == false)
- {
- DAntiban.incrementResourcesLost();
- can_mine = true;
- }
- sleep(100,400);
- break;
- }
- return 0;
- }
- private boolean starvedMine()
- {
- if(Objects.getAt(ore_locations[ore_nr]) != null && (Objects.getAt(ore_locations[ore_nr])[0].getID() == 7469 || Objects.getAt(ore_locations[ore_nr])[0].getID() == 7468) )
- {
- System.out.println(ore_nr+ " ore nr < pos: "+ore_locations[ore_nr]);
- return true;
- }
- return false;
- }
- private void walk(RSTile[] path)
- {
- DAntiban.activateRun();
- if(pathLocation == (path.length-1))
- {
- pathLocation = 0;
- return;
- }
- boolean moving = Player.getRSPlayer().isMoving();
- if((Player.getRSPlayer().getPosition().distanceTo(path[pathLocation]) > 24)) return;
- if(pathLocation > (path.length -1)) return;
- if(moving && Player.getPosition().distanceTo(path[pathLocation]) > 5) return;
- if(Player.getPosition().distanceTo(path[pathLocation]) <= 6)
- {
- pathLocation++;
- }
- log("Walking location: "+pathLocation+"/"+(path.length-1));
- while(Player.getRSPlayer().getPosition().distanceTo(path[pathLocation]) > 6)
- {
- DAntiban.goToAnticipated(path[pathLocation]);
- DAntiban.smartSleep(700,1300);
- if(Player.getRSPlayer().getPosition().distanceTo(path[pathLocation]) <= 6)
- break;
- if(Player.getRSPlayer().getPosition().distanceTo(path[pathLocation]) > 30) break;
- }
- }
- private void generateTrackers()
- {
- int mine_lvl = Skills.getActualLevel(SKILLS.MINING);
- if(mine_lvl < 31)
- {
- int minus = 31 - mine_lvl;
- int trackers = 100*minus;
- if(trackers < 201) trackers = 250;
- DAntiban.generateTrackers(trackers);
- DAntiban.timedActions();
- }
- else
- {
- DAntiban.generateTrackers(250);
- DAntiban.timedActions();
- }
- }
- int newsToShow = 0;
- private void getnewsdata()
- {
- int newsTimer = (int) (System.currentTimeMillis() - startNewsTime) / 1000;
- if(newsTimer > 8)
- {
- startNewsTime = System.currentTimeMillis();
- if(newsToShow == (latestNews.size() -1)) newsToShow = 0;
- else if(newsToShow < (latestNews.size())) newsToShow++;
- }
- }
- private void Calculate()
- {
- Current_XP = Skills.getXP(SKILLS.MINING);
- xpGot = DAntiban.getResourcesWon() * 5;
- clayMined = DAntiban.getResourcesWon();
- timeRan = (int) (System.currentTimeMillis() - startTime);
- multiplier = timeRan / 3600000D;
- hours = timeRan / 3600000;
- timeRan = timeRan - (hours*3600000);
- minutes = timeRan / 60000;
- timeRan = timeRan - (minutes*60000);
- seconds = timeRan / 1000;
- clayPH = (int) (clayMined/multiplier);
- softclayPH = (int) (softClayMade/multiplier);
- timeRan = timeRan - (seconds*1000);
- }
- private Image getImage(String url)
- {
- try
- {
- return ImageIO.read(new URL(url));
- }
- catch(IOException e)
- {
- return null;
- }
- }
- private final Image dclaypaintimg = getImage("http://d-scripting.com/DEssentials/paint/dclaypaint.png");
- private final RenderingHints aa = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
- private final Color darkred = new Color(193,48,38);
- private int paintOffset = 320;
- @Override
- public void onPaint(Graphics g)
- {
- getnewsdata();
- Calculate();
- Graphics2D g2 = (Graphics2D)g;
- g2.setRenderingHints(aa);
- g2.drawImage(dclaypaintimg, 0, paintOffset, null);
- g.setColor(Color.CYAN);
- g.setFont(font3);
- if(newsToShow < (latestNews.size())) g.drawString("NEWS: "+ latestNews.get(newsToShow), 40,40);
- g.setColor(darkred);
- g.setFont(font2);
- g.drawString("time ran: "+ hours + ":" + minutes + ":" + seconds, 5,paintOffset+60);
- if(taskToDo == 1) g.drawString("XP gained: "+ xpGot, 5,paintOffset+75);
- if(taskToDo == 1) g.drawString("Clay Mined: "+ clayMined+" Clay p/h: "+ clayPH , 5,paintOffset+90); if(taskToDo == 2) g.drawString("Soft clay banked: "+ softClayMade+" Soft clay P/H: "+softclayPH, 5,paintOffset+90);
- if(taskToDo == 1) g.drawString("Script State: "+scriptState, 5,paintOffset+105);
- if(taskToDo == 2) g.drawString("Script State: "+wState, 5,paintOffset+105);
- g.drawString("Debug : "+debug, 5,paintOffset+120);
- if(end_after_time) g.drawString("Ending script when we ran "+(end_hour)+":"+(end_minute)+":"+(end_second)+" (HH:MM:SS)", 5,paintOffset+135);
- if(!end_after_time) g.drawString("Not using End-timer", 5,paintOffset+135);
- g.drawString("Version: 1.0", 5,paintOffset+160);
- }
- public void shutDown()
- {
- this.stopScript();
- }
- private void log(String s)
- {
- debug = s;
- }
- public class GUI extends JFrame {
- public GUI() {
- initComponents();
- }
- private void thedtribotActionPerformed(ActionEvent e) {
- openSite("http://tribot.org/forums/profile/8498-thed/");
- }
- private void dscriptingcomActionPerformed(ActionEvent e) {
- openSite("http://d-scripting.com");
- }
- private void moredscriptsActionPerformed(ActionEvent e) {
- openSite("http://d-scripting.com/more");
- }
- private void tacticToUseActionPerformed(ActionEvent e) {
- String weChose = tacticToUse.getSelectedItem().toString();
- if(weChose.startsWith("1.")) message.setText("Message: Recommendation = 15cb+, reason: Mugger");
- if(weChose.startsWith("2.")) message.setText("Message: Recommendation = 15cb+, reason: Mugger");
- if(weChose.startsWith("3.")) message.setText("Message: Recommendation = 15cb+, reason: Mugger");
- if(weChose.startsWith("4.")) message.setText("Message: Recommendation = 15cb+, reason: Mugger");
- if(weChose.startsWith("5.")) message.setText("Message: Recommendation = 15cb+, reason: Mugger");
- if(weChose.startsWith("6.")) message.setText("Message: Account is member, start in Yanille Bank");
- if(weChose.startsWith("7.")) message.setText("Message: Recommendation = 28cb+ & equip pickaxe");
- if(weChose.startsWith("8.")) message.setText("Message: Recommendation = 28cb+ & equip pickaxe");
- }
- private void StartScriptActionPerformed(ActionEvent e) {
- String iChose = tacticToUse.getSelectedItem().toString();
- String speed = mouseSpeed.getSelectedItem().toString();
- String myTask = taskSelected.getSelectedItem().toString();
- String soloc = softenlocation.getSelectedItem().toString();
- String whenToQuit = endscriptTimer.getSelectedItem().toString();
- if(iChose.startsWith("1.")) tactiCal = 1;
- if(iChose.startsWith("2.")) tactiCal = 2;
- if(iChose.startsWith("3.")) tactiCal = 3;
- if(iChose.startsWith("4.")) tactiCal = 4;
- if(iChose.startsWith("5.")) { tactiCal = 5; locUsing = 1;}
- if(iChose.startsWith("6.")) { tactiCal = 6; locUsing = 2;}
- if(iChose.startsWith("7.")) { tactiCal = 7; locUsing = 3;}
- if(iChose.startsWith("8.")) { tactiCal = 8; locUsing = 3;}
- if(whenToQuit.startsWith("0."))
- {
- end_after_time = false;
- }
- if(whenToQuit.startsWith("1."))
- {
- end_after_time = true;
- end_hour = 1;
- end_minute = General.random(1, 59);
- }
- if(whenToQuit.startsWith("2."))
- {
- end_after_time = true;
- end_hour = 2;
- end_minute = General.random(1, 59);
- }
- if(whenToQuit.startsWith("3."))
- {
- end_after_time = true;
- end_hour = 3;
- end_minute = General.random(1, 59);
- }
- if(whenToQuit.startsWith("4."))
- {
- end_after_time = true;
- end_hour = 4;
- end_minute = General.random(1, 59);
- }
- if(whenToQuit.startsWith("5."))
- {
- end_after_time = true;
- end_hour = 5;
- end_minute = General.random(1, 59);
- }
- if(whenToQuit.startsWith("6."))
- {
- end_after_time = true;
- end_hour = 6;
- end_minute = General.random(1, 59);
- }
- if(whenToQuit.startsWith("7."))
- {
- end_after_time = true;
- end_hour = 7;
- end_minute = General.random(1, 59);
- }
- if(whenToQuit.startsWith("8."))
- {
- end_after_time = true;
- end_hour = 8;
- end_minute = General.random(1, 59);
- }
- if(whenToQuit.startsWith("9."))
- {
- end_after_time = true;
- end_hour = 9;
- end_minute = General.random(1, 59);
- }
- if(whenToQuit.startsWith("10."))
- {
- end_after_time = true;
- end_hour = 10;
- end_minute = General.random(1, 59);
- }
- if(whenToQuit.startsWith("11."))
- {
- end_after_time = true;
- end_hour = 11;
- end_minute = General.random(1, 59);
- }
- if(whenToQuit.startsWith("12."))
- {
- end_after_time = true;
- end_hour = 12;
- end_minute = General.random(1, 59);
- }
- if(speed.startsWith("130")) Mouse.setSpeed(General.random(130, 140));
- if(speed.startsWith("140")) Mouse.setSpeed(General.random(140, 150));
- if(speed.startsWith("150")) Mouse.setSpeed(General.random(150, 160));
- if(speed.startsWith("160")) Mouse.setSpeed(General.random(160, 170));
- if(speed.startsWith("170")) Mouse.setSpeed(General.random(170, 200));
- if(myTask.startsWith("1.")) taskToDo = 1;
- if(myTask.startsWith("2.")) taskToDo = 2;
- can_kill_mugger = canKillMugger.isSelected();
- if(soloc.startsWith("1.")) softenloc = 1;
- if(soloc.startsWith("2.")) softenloc = 2;
- isMember = isaccmemb.isSelected();
- skipWait = skip_intro.isSelected();
- GUIWait = false;
- g.dispose();
- }
- private void initComponents() {
- // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
- // Generated using JFormDesigner Evaluation license - TheD
- menuBar1 = new JMenuBar();
- menu1 = new JMenu();
- thedtribot = new JMenuItem();
- dscriptingcom = new JMenuItem();
- moredscripts = new JMenuItem();
- dialogPane = new JPanel();
- contentPanel = new JPanel();
- message = new JLabel();
- tabbedPane1 = new JTabbedPane();
- panel1 = new JPanel();
- label1 = new JLabel();
- label2 = new JLabel();
- label3 = new JLabel();
- taskSelected = new JComboBox<>();
- mouseSpeed = new JComboBox<>();
- label6 = new JLabel();
- skip_intro = new JCheckBox();
- isaccmemb = new JCheckBox();
- label11 = new JLabel();
- endscriptTimer = new JComboBox<>();
- panel2 = new JPanel();
- canKillMugger = new JCheckBox();
- label5 = new JLabel();
- tacticToUse = new JComboBox<>();
- scrollPane1 = new JScrollPane();
- MiningIntro = new JTextPane();
- panel3 = new JPanel();
- label9 = new JLabel();
- softenlocation = new JComboBox<>();
- SoftningIntro = new JTextPane();
- buttonBar = new JPanel();
- StartScript = new JButton();
- //======== this ========
- setAlwaysOnTop(true);
- setResizable(false);
- setTitle("DScripts by TheD");
- Container contentPane = getContentPane();
- contentPane.setLayout(new BorderLayout());
- //======== menuBar1 ========
- {
- //======== menu1 ========
- {
- menu1.setText("General");
- //---- thedtribot ----
- thedtribot.setText("TheD TRiBot Profile");
- thedtribot.addActionListener(e -> thedtribotActionPerformed(e));
- menu1.add(thedtribot);
- //---- dscriptingcom ----
- dscriptingcom.setText("D-Scripting.com");
- dscriptingcom.addActionListener(e -> dscriptingcomActionPerformed(e));
- menu1.add(dscriptingcom);
- //---- moredscripts ----
- moredscripts.setText("More DScripts");
- moredscripts.addActionListener(e -> moredscriptsActionPerformed(e));
- menu1.add(moredscripts);
- }
- menuBar1.add(menu1);
- }
- setJMenuBar(menuBar1);
- //======== dialogPane ========
- {
- dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));
- // JFormDesigner evaluation mark
- dialogPane.setBorder(new javax.swing.border.CompoundBorder(
- new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0),
- "DScripting limited", javax.swing.border.TitledBorder.CENTER,
- javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12),
- java.awt.Color.red), dialogPane.getBorder())); dialogPane.addPropertyChangeListener(new java.beans.PropertyChangeListener(){public void propertyChange(java.beans.PropertyChangeEvent e){if("border".equals(e.getPropertyName()))throw new RuntimeException();}});
- dialogPane.setLayout(new BorderLayout());
- //======== contentPanel ========
- {
- //---- message ----
- message.setText("Message: ");
- message.setFont(new Font("Tahoma", Font.PLAIN, 14));
- //======== tabbedPane1 ========
- {
- tabbedPane1.setFont(new Font("Tahoma", Font.PLAIN, 14));
- //======== panel1 ========
- {
- //---- label1 ----
- label1.setText("DClay");
- label1.setFont(new Font("Tahoma", Font.PLAIN, 48));
- //---- label2 ----
- label2.setText("Everything clay");
- label2.setFont(new Font("Tahoma", Font.PLAIN, 24));
- //---- label3 ----
- label3.setText("What are we gonna do?");
- label3.setFont(new Font("Tahoma", Font.PLAIN, 12));
- //---- taskSelected ----
- taskSelected.setFont(new Font("Tahoma", Font.PLAIN, 12));
- taskSelected.setModel(new DefaultComboBoxModel<>(new String[] {
- "1. Mine clay",
- "2. Soften clay"
- }));
- //---- mouseSpeed ----
- mouseSpeed.setFont(new Font("Tahoma", Font.PLAIN, 12));
- mouseSpeed.setModel(new DefaultComboBoxModel<>(new String[] {
- "130 - 140 (Slow)",
- "140 - 150 (Medium)",
- "150 - 160 (Recommended)",
- "160 - 170 (Fast)",
- "170 - 200 (Very fast)"
- }));
- mouseSpeed.setSelectedIndex(2);
- //---- label6 ----
- label6.setText("Mouse speed:");
- label6.setFont(new Font("Tahoma", Font.PLAIN, 12));
- //---- skip_intro ----
- skip_intro.setText("Skip the 13 second instructions (Only recommended for advanced users)");
- skip_intro.setFont(new Font("Tahoma", Font.PLAIN, 12));
- //---- isaccmemb ----
- isaccmemb.setText("Account is member");
- isaccmemb.setFont(new Font("Tahoma", Font.PLAIN, 12));
- //---- label11 ----
- label11.setText("End script after:");
- label11.setFont(new Font("Tahoma", Font.PLAIN, 12));
- //---- endscriptTimer ----
- endscriptTimer.setFont(new Font("Tahoma", Font.PLAIN, 12));
- endscriptTimer.setModel(new DefaultComboBoxModel<>(new String[] {
- "0. Never",
- "1. +- 1 hour",
- "2. +- 2 hours",
- "3. +- 3 hours",
- "4. +- 4 hours",
- "5. +- 5 hours",
- "6. +- 6 hours",
- "7. +- 7 hours",
- "8. +-8 hours",
- "9. +- 9 hours",
- "10. +- 10 hours",
- "11. +- 11 hours",
- "12. +- 12 hours"
- }));
- GroupLayout panel1Layout = new GroupLayout(panel1);
- panel1.setLayout(panel1Layout);
- panel1Layout.setHorizontalGroup(
- panel1Layout.createParallelGroup()
- .addGroup(panel1Layout.createSequentialGroup()
- .addGroup(panel1Layout.createParallelGroup()
- .addGroup(panel1Layout.createSequentialGroup()
- .addComponent(label1)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(label2))
- .addGroup(panel1Layout.createSequentialGroup()
- .addGroup(panel1Layout.createParallelGroup()
- .addComponent(label3)
- .addComponent(label6)
- .addComponent(label11))
- .addGap(18, 18, 18)
- .addGroup(panel1Layout.createParallelGroup()
- .addComponent(endscriptTimer, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(mouseSpeed, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(taskSelected, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
- .addComponent(skip_intro)
- .addComponent(isaccmemb))
- .addGap(0, 95, Short.MAX_VALUE))
- );
- panel1Layout.setVerticalGroup(
- panel1Layout.createParallelGroup()
- .addGroup(panel1Layout.createSequentialGroup()
- .addGroup(panel1Layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(label2)
- .addComponent(label1))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(panel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(label3)
- .addComponent(taskSelected, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(panel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(label6)
- .addComponent(mouseSpeed, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(panel1Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(label11)
- .addComponent(endscriptTimer, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(skip_intro)
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(isaccmemb)
- .addContainerGap(177, Short.MAX_VALUE))
- );
- }
- tabbedPane1.addTab("General", panel1);
- //======== panel2 ========
- {
- //---- canKillMugger ----
- canKillMugger.setText("My account can kill a mugger (lvl6) if unchecked, will run from mugger");
- canKillMugger.setFont(new Font("Tahoma", Font.PLAIN, 12));
- //---- label5 ----
- label5.setText("Tactic to use:");
- label5.setFont(new Font("Tahoma", Font.PLAIN, 12));
- //---- tacticToUse ----
- tacticToUse.setModel(new DefaultComboBoxModel<>(new String[] {
- "1. Varrock ore 1 (Start Varrock west)",
- "2. Varrock ore 2 (Start Varrock west)",
- "3. Varrock ore 1 & 2 (Start Varrock west)",
- "4. Varrock ore 1 & 2 randomized (Start Varrock west)",
- "5. Varrock ore 3 (Start Varrock west)",
- "6. (SOON)",
- "7. Falador ore 1(Start East Falador bank)",
- "8. Falador ore 2(Start East Falador bank)"
- }));
- tacticToUse.setFont(new Font("Tahoma", Font.PLAIN, 12));
- tacticToUse.setSelectedIndex(3);
- tacticToUse.addActionListener(e -> tacticToUseActionPerformed(e));
- //======== scrollPane1 ========
- {
- //---- MiningIntro ----
- MiningIntro.setFont(new Font("Tahoma", Font.PLAIN, 12));
- MiningIntro.setText("Welcome to DClay - Mining.\n\nStart the script at spawn or Lumbridge. The script\ncurrently supports start-up walking for Varrock &\nFalador mining locations. ");
- MiningIntro.setEditable(false);
- scrollPane1.setViewportView(MiningIntro);
- }
- GroupLayout panel2Layout = new GroupLayout(panel2);
- panel2.setLayout(panel2Layout);
- panel2Layout.setHorizontalGroup(
- panel2Layout.createParallelGroup()
- .addGroup(panel2Layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(panel2Layout.createParallelGroup()
- .addComponent(canKillMugger)
- .addGroup(panel2Layout.createSequentialGroup()
- .addComponent(label5)
- .addGap(18, 18, 18)
- .addComponent(tacticToUse, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addComponent(scrollPane1))
- .addContainerGap(95, Short.MAX_VALUE))
- );
- panel2Layout.setVerticalGroup(
- panel2Layout.createParallelGroup()
- .addGroup(panel2Layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(canKillMugger)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(panel2Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(label5)
- .addComponent(tacticToUse, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addGap(18, 18, 18)
- .addComponent(scrollPane1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addContainerGap(218, Short.MAX_VALUE))
- );
- }
- tabbedPane1.addTab("Mining", panel2);
- //======== panel3 ========
- {
- //---- label9 ----
- label9.setText("Soften location:");
- label9.setFont(new Font("Tahoma", Font.PLAIN, 12));
- //---- softenlocation ----
- softenlocation.setFont(new Font("Tahoma", Font.PLAIN, 12));
- softenlocation.setModel(new DefaultComboBoxModel<>(new String[] {
- "1. Falador - East bank",
- "2. Edgeville"
- }));
- //---- SoftningIntro ----
- SoftningIntro.setFont(new Font("Tahoma", Font.PLAIN, 12));
- SoftningIntro.setText("Welcome to DClay - Softning.\n\nStart the script in the selected bank with atleast 14 buckets in the bank and 14 clay. Softning does not\nsupport start-up walking at this point.");
- SoftningIntro.setEditable(false);
- GroupLayout panel3Layout = new GroupLayout(panel3);
- panel3.setLayout(panel3Layout);
- panel3Layout.setHorizontalGroup(
- panel3Layout.createParallelGroup()
- .addGroup(panel3Layout.createSequentialGroup()
- .addGroup(panel3Layout.createParallelGroup()
- .addGroup(panel3Layout.createSequentialGroup()
- .addComponent(label9)
- .addGap(102, 102, 102)
- .addComponent(softenlocation, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addComponent(SoftningIntro, GroupLayout.PREFERRED_SIZE, 413, GroupLayout.PREFERRED_SIZE))
- .addGap(0, 107, Short.MAX_VALUE))
- );
- panel3Layout.setVerticalGroup(
- panel3Layout.createParallelGroup()
- .addGroup(panel3Layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(panel3Layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(label9)
- .addComponent(softenlocation, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(SoftningIntro, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addContainerGap(253, Short.MAX_VALUE))
- );
- }
- tabbedPane1.addTab("Clay softning", panel3);
- }
- GroupLayout contentPanelLayout = new GroupLayout(contentPanel);
- contentPanel.setLayout(contentPanelLayout);
- contentPanelLayout.setHorizontalGroup(
- contentPanelLayout.createParallelGroup()
- .addGroup(contentPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(message, GroupLayout.PREFERRED_SIZE, 423, GroupLayout.PREFERRED_SIZE)
- .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addComponent(tabbedPane1)
- );
- contentPanelLayout.setVerticalGroup(
- contentPanelLayout.createParallelGroup()
- .addGroup(contentPanelLayout.createSequentialGroup()
- .addComponent(tabbedPane1)
- .addGap(18, 18, 18)
- .addComponent(message, GroupLayout.PREFERRED_SIZE, 23, GroupLayout.PREFERRED_SIZE))
- );
- }
- dialogPane.add(contentPanel, BorderLayout.CENTER);
- //======== buttonBar ========
- {
- buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0));
- buttonBar.setLayout(new GridBagLayout());
- ((GridBagLayout)buttonBar.getLayout()).columnWidths = new int[] {0, 80};
- ((GridBagLayout)buttonBar.getLayout()).columnWeights = new double[] {1.0, 0.0};
- //---- StartScript ----
- StartScript.setText("Start Script");
- StartScript.setFont(new Font("Tahoma", Font.PLAIN, 14));
- StartScript.addActionListener(e -> StartScriptActionPerformed(e));
- buttonBar.add(StartScript, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
- GridBagConstraints.CENTER, GridBagConstraints.BOTH,
- new Insets(0, 0, 0, 0), 0, 0));
- }
- dialogPane.add(buttonBar, BorderLayout.SOUTH);
- }
- contentPane.add(dialogPane, BorderLayout.CENTER);
- pack();
- setLocationRelativeTo(getOwner());
- // JFormDesigner - End of component initialization //GEN-END:initComponents
- }
- // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
- // Generated using JFormDesigner Evaluation license - TheD
- private JMenuBar menuBar1;
- private JMenu menu1;
- private JMenuItem thedtribot;
- private JMenuItem dscriptingcom;
- private JMenuItem moredscripts;
- private JPanel dialogPane;
- private JPanel contentPanel;
- private JLabel message;
- private JTabbedPane tabbedPane1;
- private JPanel panel1;
- private JLabel label1;
- private JLabel label2;
- private JLabel label3;
- private JComboBox<String> taskSelected;
- private JComboBox<String> mouseSpeed;
- private JLabel label6;
- private JCheckBox skip_intro;
- private JCheckBox isaccmemb;
- private JLabel label11;
- private JComboBox<String> endscriptTimer;
- private JPanel panel2;
- private JCheckBox canKillMugger;
- private JLabel label5;
- private JComboBox<String> tacticToUse;
- private JScrollPane scrollPane1;
- private JTextPane MiningIntro;
- private JPanel panel3;
- private JLabel label9;
- private JComboBox<String> softenlocation;
- private JTextPane SoftningIntro;
- private JPanel buttonBar;
- private JButton StartScript;
- // JFormDesigner - End of variables declaration //GEN-END:variables
- }
- void openSite(String url)
- {
- URL a = null;
- try {
- a = new URL(url);
- } catch (MalformedURLException e1) {
- System.out.println("ERROR OPENING URL");
- e1.printStackTrace();
- }
- openWebpage(a);
- }
- public void openWebpage(URI uri) {
- Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
- if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
- try {
- desktop.browse(uri);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
- public void openWebpage(URL url) {
- try {
- openWebpage(url.toURI());
- } catch (URISyntaxException e) {
- e.printStackTrace();
- }
- }
- @Override
- public void clanMessageReceived(String arg0, String arg1) {
- // TODO Auto-generated method stub
- }
- @Override
- public void duelRequestReceived(String arg0, String arg1) {
- // TODO Auto-generated method stub
- }
- @Override
- public void personalMessageReceived(String arg0, String arg1) {
- // TODO Auto-generated method stub
- }
- @Override
- public void playerMessageReceived(String arg0, String arg1) {
- // TODO Auto-generated method stub
- }
- @Override
- public void serverMessageReceived(String s)
- {
- if(s.startsWith("Oh dear")) {
- pathLocation = 0;
- if(pickeq)
- {
- equippick = true;
- }
- System.out.println("We recieved a server message, we died... :(");
- }
- }
- @Override
- public void tradeRequestReceived(String arg0) {
- // TODO Auto-generated method stub
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement