- import javax.swing.*;
- import javax.swing.event.*;
- import java.awt.*;
- import java.awt.event.*;
- import java.io.*;
- import java.net.*;
- import java.util.*;
- import java.util.List;
- import javax.swing.WindowConstants;
- import org.rsbot.bot.Bot;
- import org.rsbot.bot.input.Mouse;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.listeners.ServerMessageListener;
- import org.rsbot.script.Calculations;
- import org.rsbot.script.Constants;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSInterface;
- import org.rsbot.script.wrappers.RSItemTile;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSItem;
- import org.rsbot.script.Bank;
- @ScriptManifest(authors = { "Lefou N' Gaston" }, category = "Combat", name = "AutoAKT", version = 1.5, description =
- "<html>" +
- "<body bgcolor = 000000>" +
- "<font color = 00FF00>"+
- "<center><h1>Auto Al-Kharid Trainer</h1></center>" +
- "<center>Developed By: Lefou N' Gaston</center>" +
- "<br>" +
- "<center>--------------------------</center>" +
- "<h2 color = 00FF00 align = left>Setup</h2>" +
- "<form name='form'>" +
- "<font color = 00FF00>"+
- "What attack style are you using?" +
- "<br>" +
- "<font color = 00FF00>"+
- "<select name='style'>" +
- "<OPTION value='Attack'>Attack</OPTION>" +
- "<OPTION value='Strength'>Strength</OPTION>" +
- "<OPTION value='Defence'>Defence</OPTION>" +
- "</select>" +
- "<br>" +
- "Food type: <br>" +
- "<font color = 00FF00>"+
- "<select name='foodTypes'>" +
- "<OPTION value='Trout'>Trout</OPTION>" +
- "<OPTION value='Salmon'>Salmon</OPTION>" +
- "<OPTION value='Tuna'>Tuna</OPTION>" +
- "<OPTION value='Lobster'>Lobster</OPTION>" +
- "<OPTION value='Don't Eat'>Don't Eat</OPTION>" +
- "</select>" +
- "<br>"+
- "*Important* The Anti-Ban level must be at least 10. The lower the number, the more often it occurs." +
- "<br>" +
- "Level of Anti-Ban: <input type='text' name='antiLvl' value='20'><br>" +
- "Loot Items:<br>" +
- "<font color = 00FF00>"+
- "<select name='lootItems'>" +
- "<OPTION value='Yes'>Yes</OPTION>" +
- "<OPTION value='No'>No</OPTION>" +
- "<OPTION value='herbs'>Only Herbs</OPTION>" +
- "</select>" +
- "<br>" +
- "Bury Bones: <br>" +
- "<font color = 00FF00>"+
- "<select name='buryBones'>" +
- "<OPTION value='No'>No</OPTION>" +
- "<OPTION value='Yes'>Yes</OPTION>" +
- "</select>" +
- "</form>" +
- "</font>"+
- "</body>" +
- "</html>")
- public class AutoAKT extends Script implements PaintListener, ServerMessageListener {
- boolean setAltitude = false;
- final int bankID[] = {35647, 497};
- final int foodID[] = { 1895, 1893, 1891, 4293, 2142, 291, 2140, 3228, 9980,
- 7223, 6297, 6293, 6295, 6299, 7521, 9988, 7228, 2878, 7568, 2343,
- 1861, 13433, 315, 325, 319, 3144, 347, 355, 333, 339, 351, 329,
- 3381, 361, 10136, 5003, 379, 365, 373, 7946, 385, 397, 391, 3369,
- 3371, 3373, 2309, 2325, 2333, 2327, 2331, 2323, 2335, 7178, 7180,
- 7188, 7190, 7198, 7200, 7208, 7210, 7218, 7220, 2003, 2011, 2289,
- 2291, 2293, 2295, 2297, 2299, 2301, 2303, 1891, 1893, 1895, 1897,
- 1899, 1901, 7072, 7062, 7078, 7064, 7084, 7082, 7066, 7068, 1942,
- 6701, 6703, 7054, 6705, 7056, 7060, 2130, 1985, 1993, 1989, 1978,
- 5763, 5765, 1913, 5747, 1905, 5739, 1909, 5743, 1907, 1911, 5745,
- 2955, 5749, 5751, 5753, 5755, 5757, 5759, 5761, 2084, 2034, 2048,
- 2036, 2217, 2213, 2205, 2209, 2054, 2040, 2080, 2277, 2225, 2255,
- 2221, 2253, 2219, 2281, 2227, 2223, 2191, 2233, 2092, 2032, 2074,
- 2030, 2281, 2235, 2064, 2028, 2187, 2185, 2229, 6883, 1971, 4608,
- 1883, 1885, 1942
- };
- final int bankArea[] = {3269, 3173, 3271, 3164};
- final RSTile[] pathToWarriors = {new RSTile(3277, 3174), new RSTile(3284, 3182), new RSTile(3284, 3173)};
- final RSTile[] pathToBank = {new RSTile(3292, 3179), new RSTile(3277, 3175), new RSTile(3269, 3168)};
- final RSTile bankTile = new RSTile(3269, 3168);
- final RSTile bankTile1 = new RSTile(3269, 3166);
- final RSTile firstTile1 = new RSTile(3276, 3174);
- final RSTile warriorTile = new RSTile(3290, 3169);
- final RSTile warriorTile1 = new RSTile(3284, 3172);
- final RSTile warriorTile2 = new RSTile(3290, 3173);
- final RSTile[] toBank = {new RSTile(3285,3172),new RSTile(3291,3175),new RSTile(3287,3180),new RSTile(3281,3180),new RSTile(3279,3174),new RSTile(3275,3168),new RSTile(3269,3167),new RSTile(3269,3167)};
- final RSTile[] toMob = reversePath(toBank);
- int tileX = 0;
- int tileY = 0;
- int xpGained = 0;
- int rand = 0;
- int k = 0;
- int x = 0;
- int lastAnti = 0;
- int checkAnim = 0;
- int rotCam = 0;
- int randAnti = 0;
- int randTab = 0;
- float xpsec = 0;
- float xpmin = 0;
- float xphour = 0;
- int y = 0;
- int z = 0;
- int kc = 0;
- int useAntiBan = 5;
- int lvlsGained = 0;
- int hpLvlsGained = 0;
- int startLvl;
- int hpStartLvl;
- int isInAntiBan = 0;
- int antiLvl;
- int maxHP = skills.getSkillMax(STAT_HITPOINTS);
- int currentHP = skills.getCurrentSkillLevel(Constants.STAT_HITPOINTS);
- int a = 0;
- int i = 1;
- int foodChosenID = 379;
- int warriorID = 18;
- int warriorDead = 836;
- int foodNumber = 26;
- int l = 0;
- public String cbStyle = "Strength";
- int startexp = 0;
- public long startTime = System.currentTimeMillis();
- private String status = "Idle";
- private String foodChosen = "Idk";
- int currentPosY = 0;
- int oldPosY = 0;
- int currentPosX = 0;
- int oldPosX = 0;
- private final Rectangle ATTACK = new Rectangle(600, 273, 10, 15);
- private final Rectangle STRENGTH = new Rectangle(685, 275, 10, 15);
- private final Rectangle DEFENCE = new Rectangle(685, 326, 10, 15);
- private int[] herbIDs = {211, 215, 217, 199, 205, 209, 213, 2485, 201, 207, 3051, 203, 3049, 219};
- boolean loot = false;
- boolean banking = true;
- boolean needsToBank = false;
- boolean buryBones = false;
- boolean onlyHerbs = true;
- boolean eating = true;
- private final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
- public boolean onStart(Map<String, String> args) {
- startTime = System.currentTimeMillis();
- log("AutoAKT: We're about to deliver...");
- if (args.get("lootItems").equals("Yes")) {
- loot = true;
- log("Loot enabled");
- }
- else if (args.get("lootItems").equals("No")){
- loot = false;
- log("Loot disabled");
- }
- else if (args.get("lootItems").equals("herbs")){
- loot = false;
- onlyHerbs = true;
- log("Loot disabled");
- }
- if (args.get("buryBones").equals("Yes")) {
- buryBones = true;
- log("Bury bones enabled");
- }
- if (args.get("buryBones").equals("No")) {
- buryBones = false;
- log("Bury bones disabled");
- }
- if (args.get("style").equals("Attack")) {
- cbStyle = "Attack";
- }
- else if (args.get("style").equals("Strength")) {
- cbStyle = "Strength";
- }
- else if (args.get("style").equals("Defence")) {
- cbStyle = "Defence";
- }
- else {
- cbStyle = "Strength";
- }
- if (!args.get("foodTypes").equals("")) {
- if (args.get("foodTypes").equals("Trout")) {
- foodChosenID = 333;
- eating = true;
- }
- else if (args.get("foodTypes").equals("Salmon")) {
- foodChosenID = 329;
- eating = true;
- }
- else if (args.get("foodTypes").equals("Tuna")) {
- foodChosenID = 361;
- eating = true;
- }
- else if (args.get("foodTypes").equals("Lobster")) {
- foodChosenID = 379;
- eating = true;
- }
- else if (args.get("foodTypes").equals("Don't Eat")) {
- eating = false;
- }
- }
- else {
- eating = false;
- }
- antiLvl = Integer.parseInt(args.get("antiLvl"));
- return true;
- }
- public void useBank() {
- if (eating = true) {
- if (lowFood() == true) {
- needsToBank = true;
- if (needsToBank == true) {
- if (!getMyPlayer().isMoving()) {
- RSObject bankBooth = findObject(bankID);
- status = "Searching for Bank";
- if (bankBooth != null) {
- turnToObject(bankBooth, 40);
- status = "Using Bank";
- if (atObject(bankBooth, "Use-quickly")) {
- while (!bank.isOpen()) {
- wait(random(50, 150));
- }
- wait(random(400, 650));
- if (getInventoryCount() > 0) {
- bank.depositAll();
- }
- if (lowFood() == false) { //If has food, closes bank
- bank.close();
- needsToBank = false;
- wait(random(600, 900));
- }
- else { //If needs to withdraw
- wait(random(300,500));
- if (bank.getCount(foodChosenID) == 0) {
- status = "Out of food, logging off.";
- logout();
- stopScript();
- }
- else {
- status = "Withdrawing food";
- bank.withdraw(foodChosenID, 27);
- }
- wait(random(1200,1500));
- if (lowFood() == false) {
- wait(random(300,700));
- bank.close();
- needsToBank = false;
- }
- else {
- wait(random(300,500));
- if (bank.getCount(foodChosenID) == 0) {
- status = "Out of food, logging off.";
- logout();
- stopScript();
- }
- else {
- status = "Withdrawing food";
- bank.withdraw(foodChosenID, 27);
- }
- wait(random(1200,1500));
- }
- if (lowFood() == false) {
- wait(random(300,700));
- bank.close();
- needsToBank = false;
- }
- }
- } else {
- setCameraRotation(getCameraAngle() + random(-90, 90));
- status = "Searching for Bank";
- wait(random(500, 700));
- }
- }
- else {
- wait(random(500, 700));
- }
- }
- else {
- wait(random(300,400));
- }
- }
- else { //If doesn't need to bank, walks to warriors
- if (needsToBank == false) {
- status = "Walking to Warriors";
- walkToWarriors();
- }
- }
- }
- }
- else if (eating == false) {
- walkToWarriors();
- }
- }
- public boolean lowFood() {
- if (getInventoryCount(foodChosenID) < 3) {
- needsToBank = true;
- status = "Low food";
- return true;
- }
- return false;
- }
- public void walkToWarriors() {
- tileX = random(3275, 3279);
- tileY = random(3169, 3177);
- RSTile firstTile = new RSTile(tileX, tileY);
- walkTileMM(firstTile);
- status = "Walking to first tile.";
- while (distanceTo(getDestination()) > random(1, 5)) {
- wait(random(100, 150));
- }
- tileX = random(3284, 3289);
- tileY = random(3170, 3174);
- RSTile secondTile = new RSTile(tileX, tileY);
- walkTileMM(secondTile);
- status = "Walking to second tile.";
- while (distanceTo(getDestination()) > random(1, 5)) {
- wait(random(100, 150));
- }
- if (isAtWarriors() == true) {
- fightWarriors();
- }
- else {
- if (distanceTo(getDestination()) < random(1, 5)) {
- status = "Almost there, gimmie a min.";
- wait(random(300, 500));
- }
- else {
- }
- }
- }
- public void currentPosition() {
- currentPosX = getMyPlayer().getLocation().getX();
- currentPosY = getMyPlayer().getLocation().getY();
- if (currentPosX == oldPosX && currentPosY == oldPosY) {
- setCameraRotation(getCameraAngle() + random(-90, 180));
- }
- else {
- wait(random(50, 100));
- }
- oldPosX = currentPosX;
- oldPosY = currentPosY;
- }
- public void fightWarriors() {
- try {
- RSNPC warrior = getNearestFreeNPCByID(warriorID);
- RSNPC warrior1 = getNearestNPCByID(warriorID);
- needsToEat();
- currentPosition();
- if (lowFood() == true) {
- walkToBank();
- }
- if (getMyPlayer().isInCombat() == false && getMyPlayer().isMoving() == false && needsToEat() == false) {
- if (warrior == null && warrior1 != null) {
- if (atNPC(warrior1,"Attack")) {
- status = "Fighting Warrior";
- wait(random(500,1300));
- moveMouseSlightly();
- wait(random(200,400));
- antiBan();
- if(checkWarriorDead() == true) {
- if (loot == true) {
- log("Should loot");
- loot();
- }
- }
- }
- }
- else if (warrior != null && warrior1 != null) {
- needsToEat();
- if (lowFood() == true) {
- walkToBank();
- }
- if (atNPC(warrior,"Attack")) {
- status = "Fighting Warrior";
- wait(random(500,1300));
- moveMouseSlightly();
- wait(random(200,400));
- antiBan();
- if(checkWarriorDead() == true) {
- if (loot == true) {
- log("Should loot");
- loot();
- }
- else if (onlyHerbs == true){
- wait(random(1750, 2300));
- lootHerbs();
- }
- }
- }
- }
- else if (warrior1 == null && warrior != null) {
- needsToEat();
- if (lowFood() == true) {
- walkToBank();
- }
- if (atNPC(warrior,"Attack")) {
- status = "Fighting Warrior";
- wait(random(500,700));
- moveMouseSlightly();
- wait(random(200,400));
- antiBan();
- if(checkWarriorDead() == true) {
- if (loot == true) {
- log("Should loot");
- loot();
- }
- }
- }
- }
- else if (warrior1 == null && warrior == null) {
- needsToEat();
- if (lowFood() == true) {
- walkToBank();
- }
- wait(random(200,400));
- }
- else {
- }
- while (isBusy() == true) {
- status = "I'm busy at the moment.";
- wait(random(200,400));
- needsToEat();
- if(checkWarriorDead() == true) {
- if (loot == true ) {
- log("Should loot");
- while (isInAntiBan == 1) {
- wait(random(300, 500));
- }
- wait(random(200, 400));
- loot();
- }
- }
- while (getMyPlayer().getInteracting().getAnimation() == warriorDead & getMyPlayer().isInCombat()){
- wait(random(150, 200));
- }
- useAntiBan = random(0, 5);
- if (useAntiBan == 2) {
- antiBan();
- }
- if(checkWarriorDead() == true) {
- if (loot == true) {
- log("Should loot");
- loot();
- }
- }
- else {
- wait(random(100, 200));
- }
- if (lowFood() == true) {
- walkToBank();
- moveMouseSlightly();
- wait(random(200,400));
- }
- wait(random(100, 150));
- if(checkWarriorDead() == true) {
- if (loot == true) {
- log("Should loot");
- loot();
- }
- }
- }
- status = "Idle";
- if (rotCam <= 3) {
- setCameraRotation(getCameraAngle() + random(-90, 90));
- wait(random(560, 795));
- moveMouseSlightly();
- rotCam++;
- fightWarriors();
- }
- else if (rotCam >= 4) {
- if (distanceTo(warriorTile) > 5) {
- warriorTile.randomizeTile(2, 2);
- walkTileMM(warriorTile);
- moveMouseSlightly();
- wait(random(500, 700));
- rotCam = 0;
- fightWarriors();
- }
- else {
- warriorTile2.randomizeTile(2, 2);
- walkTileMM(warriorTile2);
- moveMouseSlightly();
- wait(random(500, 700));
- rotCam = 0;
- fightWarriors();
- }
- }
- }
- else {
- needsToEat();
- wait(random(100, 200));
- }
- } catch (NullPointerException e) {
- wait(random(100, 200));
- if (rotCam <= 3) {
- setCameraRotation(getCameraAngle() + random(-90, 90));
- wait(random(560, 795));
- rotCam++;
- fightWarriors();
- }
- else if (rotCam >= 4) {
- if (distanceTo(warriorTile) > 3) {
- status = "Walking to random Tile";
- warriorTile.randomizeTile(2, 2);
- walkTileMM(warriorTile);
- moveMouseSlightly();
- wait(random(500, 700));
- rotCam = 0;
- fightWarriors();
- }
- else {
- status = "Walking to random Tile";
- warriorTile2.randomizeTile(2, 2);
- walkTileMM(warriorTile2);
- moveMouseSlightly();
- wait(random(500, 700));
- rotCam = 0;
- fightWarriors();
- }
- }
- wait(random(100, 200));
- fightWarriors();
- }
- }
- public boolean checkWarriorDead() {
- if (getMyPlayer().getInteracting().getAnimation() == warriorDead && getMyPlayer().isInCombat()) {
- kc = kc + 1;
- wait(random(200,300));
- return true;
- }
- else {
- return false;
- }
- }
- public boolean needsToEat() {
- currentHP = skills.getCurrentSkillLevel(STAT_HITPOINTS);
- if (eating = true) {
- if (currentHP <= ((maxHP / 2) + random(+3, -3))) {
- status = "Eating food";
- wait(random(500, 1100));
- return atInventoryItem(foodChosenID, "Eat");
- }
- }
- return false;
- }
- public void walkToBank() {
- status = "Walking to bank";
- tileX = random(3275, 3279);
- tileY = random(3169, 3177);
- RSTile firstTile = new RSTile(tileX, tileY);
- if (distanceTo(firstTile) < 15) {
- walkTileMM(firstTile);
- while (distanceTo(getDestination()) > random(1, 5)) {
- wait(random(100, 150));
- }
- tileX = random(3269, 3271);
- tileY = random(3163, 3171);
- RSTile secondTile = new RSTile(tileX, tileY);
- walkTileMM(secondTile);
- while (distanceTo(getDestination()) > random(1, 5)) {
- wait(random(100, 150));
- }
- }
- else {
- tileX = random(3287, 3297);
- tileY = random(3174, 3178);
- RSTile thirdTile = new RSTile(tileX, tileY);
- walkTileMM(thirdTile);
- while (distanceTo(getDestination()) > random(1, 5)) {
- wait(random(100, 150));
- }
- tileX = random(3278, 3294);
- tileY = random(3180, 3182);
- RSTile fourthTile = new RSTile(tileX, tileY);
- walkTileMM(fourthTile);
- while (distanceTo(getDestination()) > random(1, 5)) {
- wait(random(100, 150));
- }
- walkToBank();
- }
- if (isInBank() == true) {
- useBank();
- }
- else {
- walkToBank();
- }
- }
- public boolean isAtWarriors () {
- if (getMyPlayer().getLocation().getX() <= 3299 && getMyPlayer().getLocation().getX() >= 3280 && getMyPlayer().getLocation().getY() <= 3179 && getMyPlayer().getLocation().getY() >= 3158 && getInventoryCount(foodChosenID) > 5) {
- status = "Arrived at warriors";
- return true;
- }
- return false;
- }
- public boolean isInBank() {
- if (getMyPlayer().getLocation().getX() <= 3274 && getMyPlayer().getLocation().getX() >= 3267 && getMyPlayer().getLocation().getY() <= 3173 && getMyPlayer().getLocation().getY() >= 3161) {
- status = "Currently at bank.";
- return true;
- }
- return false;
- }
- public void lootBones() {
- if (buryBones == true) {
- wait(random(500, 800));
- try {
- RSTile tile = getNearestGroundItemByID(526); //Loot bones
- if (getInventoryCount() < 28) {
- if (distanceTo(tile) <= 2) {
- atTile(tile, "Take Bones");
- wait(random(1000,1200));
- if (buryBones == true) {
- while (getInventoryCount(526) >= 1){
- atInventoryItem(526, "Bury");
- wait(random(700, 900));
- }
- }
- else {
- wait(random(100,150));
- }
- }
- }
- } catch (NullPointerException e) {
- }
- }
- if (buryBones == false) {
- fightWarriors();
- }
- }
- public void lootCoins() {
- wait(random(500, 800));
- try {
- RSTile tile = getNearestGroundItemByID(995); //Loot coins
- if (getInventoryCount() <= 28) {
- if (distanceTo(tile) <= 2) {
- atTile(tile, "Take Coins");
- wait(random(700,900));
- }
- }
- } catch (NullPointerException e) {
- }
- }
- public void lootEarthTali() {
- wait(random(500, 800));
- try {
- RSTile tile = getNearestGroundItemByID(1440); //Loot earth talisman
- if (getInventoryCount() < 28) {
- if (distanceTo(tile) <= 10) {
- atTile(tile, "Take Earth");
- wait(random(700,900));
- }
- }
- else {
- if (getNearestGroundItemByID(1440) != null) {
- atInventoryItem(foodChosenID, "Eat");
- if (distanceTo(tile) <= 10) {
- atTile(tile, "Take Earth");
- wait(random(700,900));
- }
- }
- else {
- wait(random(100,150));
- }
- }
- } catch (NullPointerException e) {
- }
- }
- public void lootHerbs() {
- wait(random(500, 800));
- try {
- RSTile tile = getNearestGroundItemByID(herbIDs); //Loot Herbs
- if (getInventoryCount() < 28) {
- if (distanceTo(tile) <= 15) {
- atTile(tile, "Grimy");
- wait(random(700,900));
- }
- }
- else {
- if (getNearestGroundItemByID(herbIDs) != null) {
- atInventoryItem(foodChosenID, "Eat");
- if (distanceTo(tile) <= 15) {
- atTile(tile, "Grimy");
- wait(random(700,900));
- }
- }
- else {
- wait(random(100,150));
- }
- }
- } catch (NullPointerException e) {
- }
- }
- public void loot() {
- wait(random(1750, 2300));
- lootCoins();
- lootHerbs();
- lootEarthTali();
- if (buryBones == true){
- lootBones();
- }
- }
- public boolean isBusy() {
- RSNPC warrior = getNearestFreeNPCByID(warriorID);
- RSNPC warrior1 = getNearestNPCByID(warriorID);
- while (getMyPlayer().isInCombat() || getMyPlayer().isMoving() || warrior.isInteractingWithLocalPlayer() || warrior1.isInteractingWithLocalPlayer() || getMyPlayer().getInteracting().getAnimation() != warriorDead) {
- return true;
- }
- return false;
- }
- public void antiBan() {
- isInAntiBan = 1;
- k = random(0, antiLvl);
- if (k == lastAnti) {
- k = random(0, antiLvl);
- }
- if (k == 0) {
- setCameraRotation(getCameraAngle() + random(-90, 90));
- wait(random(100, 258));
- }
- else if (k == 1) {
- status = "Running Anti-Ban";
- log("Anti-Ban: Option 1 selected: Moving mouse mouse randomly and rotating camera.");
- moveMouse(381, 250, 300, 210);
- wait(random(360, 682));
- setCameraRotation(getCameraAngle() + random(-180, 0));
- wait(random(256, 400));
- setCameraRotation(getCameraAngle() + random(0, 120));
- wait(random(100, 300));
- moveMouse(381, 250, 340, 220);
- log("Anti-Ban Complete.");
- }
- else if (k == 2) {
- status = "Running Anti-Ban";
- l = random (0, 10);
- if (l == 3) {
- log("Anti-Ban: Option 2A selected: Checking HP Experience.");
- if (getCurrentTab() != TAB_STATS) {
- openTab(TAB_STATS);
- wait(random(350, 856));
- moveMouse(634, 246, 5, 5);
- wait(random(800, 1300));
- openTab(TAB_INVENTORY);
- }
- else {
- log("Anti-Ban: Option 2B selected: Rotating map.");
- setCameraRotation(getCameraAngle() + random(0, 120));
- }
- }
- else {
- wait(random(100, 300));
- }
- log("Anti-Ban Complete.");
- }
- else if (k == 3) {
- status = "Running Anti-Ban";
- l = random (0, 10);
- if (l == 3) {
- log("Anti-Ban: Option 3A selected: Moving skills bar.");
- if (getCurrentTab() != TAB_STATS) {
- openTab(TAB_STATS);
- l = 0;
- }
- else {
- wait(random(100, 250));
- }
- wait(random(500, 759));
- moveMouse(729, 444, 4, 4);
- wait(random(360, 682));
- clickMouse(true);
- wait(random(100, 300));
- moveMouse(729, 444, 4, 4);
- wait(random(150, 350));
- clickMouse(true);
- wait(random(50, 150));
- clickMouse(true);
- wait(random(800, 1400));
- moveMouse(728, 236, 6, 6);
- clickMouse(true);
- moveMouse(728, 236, 3, 3);
- clickMouse(true);
- moveMouse(728, 236, 4, 4);
- clickMouse(true);
- openTab(TAB_INVENTORY);
- log("Anti-Ban Complete.");
- }
- else {
- log("Anti-Ban: Option 3B selected: Rotating Map.");
- setCameraRotation(getCameraAngle() + random(0, 120));
- log("Anti-Ban Complete.");
- }
- }
- else if (k == 4) {
- status = "Running Anti-Ban";
- log("Anti-Ban: Option 4 selected: Moving mouse to random locations.");
- moveMouse(381, 250, 340, 220);
- wait(random(360, 682));
- moveMouse(381, 250, 340, 220);
- wait(random(200, 300));
- moveMouse(381, 250, 340, 220);
- wait(random(400, 680));
- log("Anti-Ban Complete.");
- }
- else if (k == 5) {
- status = "Running Anti-Ban";
- log("Anti-Ban: Option 5 selected: Choosing a random tab to open.");
- randTab = random(0, 13);
- if (randTab == 0) {
- if (getCurrentTab() != TAB_ATTACK) {
- openTab(TAB_ATTACK);
- }
- moveMouse(random(508, 733), random(248, 462));
- wait(random(500, 1200));
- openTab(TAB_INVENTORY);
- }
- if (randTab == 1) {
- if (getCurrentTab() != TAB_STATS) {
- openTab(TAB_STATS);
- }
- moveMouse(random(508, 733), random(248, 462));
- wait(random(500, 1200));
- moveMouse(random(508, 733), random(248, 462));
- wait(random(300, 700));
- moveMouse(random(508, 733), random(248, 462));
- wait(random(100, 400));
- openTab(TAB_INVENTORY);
- }
- if (randTab == 2) {
- if (getCurrentTab() != TAB_QUESTS) {
- openTab(TAB_QUESTS);
- }
- moveMouse(random(508, 733), random(248, 462));
- wait(random(500, 1200));
- openTab(TAB_INVENTORY);
- }
- if (randTab == 3) {
- if (getCurrentTab() != TAB_ACHIEVEMENTDIARIES) {
- openTab(TAB_ACHIEVEMENTDIARIES);
- }
- moveMouse(random(508, 733), random(248, 462));
- wait(random(500, 1200));
- moveMouse(random(508, 733), random(248, 462));
- wait(random(300, 700));
- openTab(TAB_INVENTORY);
- }
- if (randTab == 4) {
- if (getCurrentTab() != TAB_EQUIPMENT) {
- openTab(TAB_EQUIPMENT);
- }
- moveMouse(random(508, 733), random(248, 462));
- wait(random(500, 1200));
- openTab(Constants.TAB_INVENTORY);
- }
- if (randTab == 5) {
- if (getCurrentTab() != TAB_PRAYER) {
- openTab(Constants.TAB_PRAYER);
- }
- moveMouse(random(508, 733), random(248, 462));
- wait(random(500, 1200));
- moveMouse(random(508, 733), random(248, 462));
- wait(random(300, 700));
- moveMouse(random(508, 733), random(248, 462));
- wait(random(200, 400));
- openTab(Constants.TAB_INVENTORY);
- }
- if (randTab == 6) {
- if (getCurrentTab() != TAB_MAGIC) {
- openTab(TAB_MAGIC);
- }
- moveMouse(random(508, 733), random(248, 462));
- wait(random(500, 1200));
- openTab(Constants.TAB_INVENTORY);
- }
- if (randTab == 7) {
- if (getCurrentTab() != TAB_FRIENDS) {
- openTab(Constants.TAB_FRIENDS);
- }
- moveMouse(random(508, 733), random(248, 462));
- wait(random(500, 1200));
- moveMouse(random(508, 733), random(248, 462));
- wait(random(500, 600));
- openTab(TAB_INVENTORY);
- }
- if (randTab == 8) {
- if (getCurrentTab() != TAB_IGNORE) {
- openTab(TAB_IGNORE);
- }
- moveMouse(random(508, 733), random(248, 462));
- wait(random(500, 1200));
- openTab(TAB_INVENTORY);
- }
- if (randTab == 9) {
- if (getCurrentTab() != TAB_CLAN) {
- openTab(TAB_CLAN);
- }
- moveMouse(random(508, 733), random(248, 462));
- wait(random(500, 1200));
- openTab(TAB_INVENTORY);
- }
- if (randTab == 10) {
- if (getCurrentTab() != TAB_OPTIONS) {
- openTab(TAB_OPTIONS);
- }
- moveMouse(random(508, 733), random(248, 462));
- wait(random(500, 1200));
- moveMouse(random(508, 733), random(248, 462));
- wait(random(300, 500));
- moveMouse(random(508, 733), random(248, 462));
- wait(random(100, 300));
- openTab(TAB_INVENTORY);
- }
- if (randTab == 11) {
- if (getCurrentTab() != TAB_MUSIC) {
- openTab(TAB_MUSIC);
- }
- moveMouse(random(508, 733), random(248, 462));
- wait(random(500, 1200));
- openTab(TAB_INVENTORY);
- }
- if (randTab == 12) {
- if (getCurrentTab() != TAB_NOTES) {
- openTab(TAB_NOTES);
- }
- moveMouse(random(508, 733), random(248, 462));
- wait(random(500, 1200));
- openTab(TAB_INVENTORY);
- }
- log("Anti-Ban Complete.");
- isBusy();
- }
- else if (k == 6) {
- status = "Running Anti-Ban";
- log("Anti-Ban: Option 6 selected: Moving mouse mouse randomly and rotating camera.");
- moveMouse(381, 250, 340, 220);
- wait(random(360, 682));
- setCameraRotation(getCameraAngle() + random(-180, 0));
- wait(random(256, 400));
- setCameraRotation(getCameraAngle() + random(0, 120));
- wait(random(100, 300));
- moveMouse(381, 250, 340, 220);
- log("Anti-Ban Complete.");
- }
- else if (k == 7) {
- status = "Running Anti-Ban";
- log("Anti-Ban: Option 7 selected: Checking surrounding players levels.");
- org.rsbot.script.wrappers.RSPlayer nearPlayer = getNearestPlayerByLevel(10,136);
- if (nearPlayer.getCombatLevel() == getMyPlayer().getCombatLevel()) {
- log("Self selected only, skipping...");
- }
- else {
- if (nearPlayer != null)
- {
- clickCharacter(nearPlayer, "Cancel");
- setCameraRotation(getCameraAngle() + random(0, 120));
- }
- else {
- setCameraRotation(getCameraAngle() + random(0, 120));
- moveMouse(381, 250, 340, 220);
- wait(random(360, 682));
- }
- }
- log("Anti-Ban Complete.");
- }
- else if (k == 8) {
- status = "Running Anti-Ban";
- log("Anti-Ban: Option 8 selected: Moving mouse mouse randomly and rotating camera.");
- moveMouse(381, 250, 340, 220);
- wait(random(360, 682));
- setCameraRotation(getCameraAngle() + random(-180, 0));
- wait(random(256, 400));
- moveMouse(381, 250, 340, 220);
- wait(random(256, 400));
- setCameraRotation(getCameraAngle() + random(0, 120));
- wait(random(100, 300));
- moveMouse(381, 250, 340, 220);
- log("Anti-Ban Complete.");
- }
- else if (k == 9) {
- status = "Running Anti-Ban";
- log("Anti-Ban: Option 9 selected: Doing nothing.");
- log("Anti-Ban Complete.");
- }
- else {
- wait(random(100, 200));
- }
- lastAnti = k;
- k = 0;
- isInAntiBan = 0;
- }
- public int loop() {
- maxHP = skills.getSkillMax(STAT_HITPOINTS);
- rand = 0;
- if (!setAltitude) {
- setCameraAltitude(true);
- wait(random(250, 500));
- setCameraRotation(getCameraAngle() + random(-90, 180));
- wait(random(100, 300));
- setAltitude = true;
- }
- //------------------------------------------------\\
- if (z == 0) {
- if (cbStyle == "Attack") {
- startLvl = skills.getSkillMax(STAT_ATTACK);
- if (getCurrentTab() != TAB_ATTACK) {
- openTab(TAB_ATTACK);
- wait(random(400,800));
- clickMouse(ATTACK.x, ATTACK.y, ATTACK.width, ATTACK.height, true);
- wait(random(400,800));
- openTab(TAB_INVENTORY);
- wait(random(200,300));
- }
- }
- else if (cbStyle == "Strength") {
- startLvl = skills.getSkillMax(STAT_STRENGTH);
- if (getCurrentTab() != TAB_ATTACK) {
- openTab(TAB_ATTACK);
- wait(random(400,800));
- clickMouse(STRENGTH.x, STRENGTH.y, STRENGTH.width, STRENGTH.height, true);
- clickMouse(true);
- wait(random(400,800));
- openTab(TAB_INVENTORY);
- wait(random(200,300));
- }
- }
- else if (cbStyle == "Defence") {
- startLvl = skills.getSkillMax(STAT_DEFENSE);
- if (getCurrentTab() != TAB_ATTACK) {
- openTab(TAB_ATTACK);
- wait(random(400,800));
- clickMouse(DEFENCE.x, DEFENCE.y, DEFENCE.width, DEFENCE.height, true);
- wait(random(400,800));
- openTab(TAB_INVENTORY);
- wait(random(200,300));
- }
- }
- else {
- if (getCurrentTab() != TAB_ATTACK) {
- openTab(TAB_ATTACK);
- wait(random(400,800));
- clickMouse(STRENGTH.x, STRENGTH.y, STRENGTH.width, STRENGTH.height, true);
- wait(random(400,800));
- openTab(TAB_INVENTORY);
- wait(random(200,300));
- }
- }
- hpStartLvl = skills.getSkillMax(STAT_HITPOINTS);
- z++;
- }
- //------------------------------------------------\\
- if (isInBank() == true) {
- if (lowFood() == true) { //If has low/no food
- status = "Needs to bank";
- needsToBank = true;
- useBank(); //banks
- }
- else {
- walkToWarriors(); //If has sufficient food, walks to warriors
- }
- }
- else { //If not in bank
- if (lowFood() == true) { //If has low/no food
- walkToBank();
- needsToBank = true;
- useBank();
- }
- else {
- if (!isRunning() && getEnergy() > 35) {
- setRun(true);
- }
- moveMouseSlightly();
- fightWarriors();
- }
- }
- moveMouseSlightly();
- return 100;
- }
- public void serverMessageRecieved(final ServerMessageEvent arg0) {
- final String serverString = arg0.getMessage();
- }
- public void onRepaint(Graphics g) {
- if (isLoggedIn()) {
- if (startexp == 0) {
- if (cbStyle == "Attack") {
- startexp = skills.getCurrentSkillExp(STAT_ATTACK);
- xpGained = skills.getCurrentSkillExp(STAT_ATTACK) - startexp;
- }
- else if (cbStyle == "Strength") {
- startexp = skills.getCurrentSkillExp(STAT_STRENGTH);
- xpGained = skills.getCurrentSkillExp(STAT_STRENGTH) - startexp;
- }
- else if (cbStyle == "Defence") {
- startexp = skills.getCurrentSkillExp(STAT_DEFENSE);
- xpGained = skills.getCurrentSkillExp(STAT_DEFENSE) - startexp;
- }
- }
- if (cbStyle == "Attack") {
- xpGained = skills.getCurrentSkillExp(STAT_ATTACK) - startexp;
- }
- else if (cbStyle == "Strength") {
- xpGained = skills.getCurrentSkillExp(STAT_STRENGTH) - startexp;
- }
- else if (cbStyle == "Defence") {
- xpGained = skills.getCurrentSkillExp(STAT_DEFENSE) - startexp;
- }
- int paintInt = 352;
- long millis = System.currentTimeMillis() - startTime;
- long hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- long minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- long seconds = millis / 1000;
- long minutes2 = minutes + (hours * 60);
- g.setColor(new Color(0, 0, 0, 200));
- g.fillRoundRect(2, 339, 516, 120, 5, 5);
- g.setColor(Color.green);
- g.fillRoundRect(258, 339, 1, 120, 0, 0);
- g.drawString("Created by: Lefou n' Gaston - Version 1.5", 9, paintInt);
- g.drawString("Time running:" + hours + ":" + minutes + ":" + seconds + "." , 9, paintInt + 20);
- g.drawString("Status: " + status, 9, paintInt + 40);
- g.drawString("XP Gained: " + xpGained, 9, paintInt + 60);
- g.drawString("Approx: " + (int) xphour + " Gained An Hour.", 9, paintInt + 80);
- g.drawString("Kill Count: " + kc, 9, paintInt + 100);
- g.drawString("Percent Till Level:", 338, paintInt);
- g.drawString(cbStyle + " levels gained: " + lvlsGained, 284, 418);
- g.drawString("Hitpoint levels gained: " + hpLvlsGained, 284, 438);
- g.setColor(Color.BLACK);
- g.fill3DRect(285, 359, 200, 18, true);
- g.fill3DRect(285, 384, 200, 18, true);
- g.setColor(Color.WHITE);
- if (cbStyle == "Attack") {
- g.fill3DRect(285, 359, (skills.getPercentToNextLevel(Constants.STAT_ATTACK) * 2), 18,true);
- g.setColor(Color.RED);
- g.drawString(skills.getPercentToNextLevel(Constants.STAT_ATTACK) + "% to " + (skills.getCurrentSkillLevel(Constants.STAT_ATTACK) + 1 + " Attack"), 330, 373);
- lvlsGained = skills.getSkillMax(STAT_ATTACK) - startLvl;
- }
- else if (cbStyle == "Strength") {
- g.fill3DRect(285, 359, (skills.getPercentToNextLevel(Constants.STAT_STRENGTH) * 2), 18, true);
- g.setColor(Color.RED);
- g.drawString(skills.getPercentToNextLevel(Constants.STAT_STRENGTH) + "% to " + (skills.getCurrentSkillLevel(Constants.STAT_STRENGTH) + 1 + " Strength"), 330, 373);
- lvlsGained = skills.getSkillMax(STAT_STRENGTH) - startLvl;
- }
- else if (cbStyle == "Defence") {
- g.fill3DRect(285, 359, (skills.getPercentToNextLevel(Constants.STAT_DEFENSE) * 2), 18, true);
- g.setColor(Color.RED);
- g.drawString(skills.getPercentToNextLevel(Constants.STAT_DEFENSE) + "% to " + (skills.getCurrentSkillLevel(Constants.STAT_DEFENSE) + 1 + " Defense"), 330, 373);
- lvlsGained = skills.getSkillMax(STAT_DEFENSE) - startLvl;
- }
- hpLvlsGained = skills.getSkillMax(STAT_HITPOINTS) - hpStartLvl;
- g.setColor(Color.WHITE);
- g.fill3DRect(285, 384, (skills.getPercentToNextLevel(Constants.STAT_HITPOINTS) * 2), 18, true);
- g.setColor(Color.RED);
- g.drawString(skills.getPercentToNextLevel(Constants.STAT_HITPOINTS) + "% to " + (skills.getCurrentSkillLevel(Constants.STAT_HITPOINTS) + 1 + " Hitpoints"), 330, 398);
- float xpsec = 0;
- if ((minutes > 0 || hours > 0 || seconds > 0) && xpGained > 0) {
- xpsec = ((float) xpGained)
- / (float) (seconds + (minutes * 60) + (hours * 60 * 60));
- }
- xpmin = xpsec * 60;
- xphour = xpmin * 60;
- }
- }
- public void onFinish() {
- log("Thanks for using AutoAKT. All we ask in return is that you post your");
- log("progress report on the forums. Thank you.");
- }
- }
