Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.event.*;
- import java.awt.*;
- import java.io.*;
- import java.util.*;
- import java.util.List;
- import com.kbot2.scriptable.Script;
- import com.kbot2.scriptable.methods.Calculations;
- import com.kbot2.scriptable.methods.data.GameScreen;
- import com.kbot2.scriptable.methods.data.NPCs;
- import com.kbot2.scriptable.methods.data.Skills;
- import com.kbot2.scriptable.methods.wrappers.GroundItem;
- import com.kbot2.scriptable.methods.wrappers.Interface;
- import com.kbot2.scriptable.methods.wrappers.NPC;
- import com.kbot2.scriptable.methods.wrappers.Tile;
- import com.kbot2.handlers.eventSystem.eventListeners.PaintListener;
- public class zKiller extends Script implements ActionListener, PaintListener {
- /*****************************************************************************
- * \ SCRIPT DECLARATION \
- *****************************************************************************/
- public boolean active() {
- return true;
- }
- public String getAuthor() {
- return "Z.Darkness";
- }
- public String getName() {
- return "zKiller";
- }
- public double getVersion() {
- return 1.0;
- }
- public String getDescription() {
- return "All settings can be set in the GUI!!";
- }
- public boolean onStart() {
- settings.filename = SETTINGS_FILE_NAME;
- if (settings.settingsExist(SETTINGS_FILE_NAME)) {
- showSettingsInterface();
- try {
- settings.setSettings();
- npcIDs.setText(settings.intArrayToString(settings.npcIDs));
- specialCheck.setSelected(settings.useSpecialCheck);
- npcsInCageCheck.setSelected(settings.npcIsInCage);
- pickUpCheck.setSelected(settings.pickUpItems);
- if (settings.pickUpItems) {
- itemIDs
- .setText(settings
- .intArrayToString(settings.itemIDs));
- itemNamesText.setText(settings
- .stringArrayToString(settings.itemNames));
- pickUpSpeedCombo.setSelectedItem(settings.pickUpSpeed);
- }
- equipArrowsCheck.setSelected(settings.equipArrowsCheck);
- if (settings.equipArrowsCheck) {
- equipArrowText.setText("" + settings.equipArrowID);
- }
- bonesCheck.setSelected(settings.buryBonesCheck);
- if (settings.buryBonesCheck) {
- burySpeedCombo.setSelectedItem(settings.buryBonesSpeed);
- }
- usePotionsCheck.setSelected(settings.usePotionCheck);
- if (settings.usePotionCheck) {
- potionList.setListData(settings.potionList);
- }
- useItemAlchCheck.setSelected(settings.itemAlchCheck);
- if (settings.itemAlchCheck) {
- alchItemIDsText.setText(settings
- .intArrayToString(settings.alchItemIDs));
- }
- eatFoodCheck.setSelected(settings.eatFood);
- stopScriptWhenNoFoodCheck
- .setSelected(settings.stopScriptWhenNoFood);
- peachesCheck.setSelected(settings.bonesToPeachesCheck);
- reportCombo.setSelectedItem(settings.reportSetting);
- nextNPCCheck.setSelected(settings.moveMouseToNextNPC);
- specialCheck.setSelected(settings.useSpecialCheck);
- antibanCheck.setSelected(settings.antiBanCheck);
- } catch (Exception e) {
- System.out.print("error getting settings: " + e);
- }
- } else {
- showSettingsInterface();
- }
- while (!START_SCRIPT) {
- sleep(10);
- }
- log("*******************************************");
- log("zKiller V" + getVersion() + " started!");
- log("*******************************************");
- START_SCRIPT = false;
- return true;
- }
- /*****************************************************************************
- * \ STATE-MACHINE \
- *****************************************************************************/
- int pickUpFail = 0;
- int pickUpBoneFail = 0;
- @Override
- public int loop() {
- /**
- * Run check -turns run on when not running and energy is above a random
- * amount
- */
- if (runCheck()) {
- walking.setRunning(true);
- return random(450, 950);
- }
- Action action = getAction();
- if (action != null) {
- switch (action) {
- case ATTACK:
- if (currentNPC != null) {
- if (!clickNPC(currentNPC)) {
- return random(800, 1600);
- } else {
- return random(1000, 2500);
- }
- } else {
- return random(310, 510);
- }
- case WALK:
- if (currentWalkTile != null) {
- walking.walkToMM(currentWalkTile);
- return random(431, 910);
- Tile[] path = generatePath(currentWalkTile);
- if (path.length > 1) {
- Tile tile = nextTile(path, 10);
- if (tile != null) {
- walking.walkToMM(tile);
- return random(410, 800);
- }
- } else if (path.length == 1) {
- walking.walkToMM(currentWalkTile);
- return random(410, 910);
- } else {
- walking.walkToMM(currentWalkTile);
- return random(610, 1200);
- }
- } else {
- return random(410, 510);
- }
- case PICKUP:
- if (currentItemTile != null) {
- if (!pickUpItem(currentItemTile, settings.itemNames)) {
- pickUpFail++;
- if (pickUpFail >= 10) {
- camera.setAngleTo(currentItemTile.getLocation());
- pickUpFail = 0;
- return random(310, 910);
- }
- return random(140, 510);
- } else {
- pickUpFail = 0;
- return random(410, 870);
- }
- } else {
- return random(200, 500);
- }
- case PICKUPBONE:
- if (currentItemTile != null) {
- if (!pickUpItem(currentItemTile, BONE_NAMES)) {
- pickUpBoneFail++;
- if (pickUpBoneFail >= 10) {
- camera.setAngleTo(currentItemTile.getLocation());
- return random(310, 510);
- }
- return random(140, 510);
- } else {
- pickUpBoneFail = 0;
- return random(410, 870);
- }
- } else {
- return random(200, 500);
- }
- case USE_INVENTORY:
- if (currentInventoryIDs.length > 0) {
- if (!inventory.atItem(currentInventoryString,
- currentInventoryIDs)) {
- return random(180, 410);
- } else {
- return random(924, 2111);
- }
- } else {
- return random(200, 500);
- }
- case USE_SPECIAL:
- if (gameScreen.getCurrentTab() != GameScreen.TAB_ATTACK) {
- gameScreen.openTab(GameScreen.TAB_ATTACK);
- sleep(300, 900);
- }
- clickMouse(new Point(random(578, 705), random(414, 426)), true);
- return random(200, 1300);
- case USE_MAGIC:
- Interface iface = interfaces.getInterface(INTERFACE_MAGIC,
- currentMagicSpell);
- if (gameScreen.getCurrentTab() != GameScreen.TAB_MAGIC) {
- gameScreen.openTab(GameScreen.TAB_MAGIC);
- sleep(300, 1400);
- }
- try {
- if (iface != null) {
- iface.doClick();
- }
- return random(1200, 2400);
- } catch (Exception e) {
- System.out.print("error using spell: " + e);
- return random(100, 200);
- }
- case WAIT:
- return random(waitRandom[0], waitRandom[1]);
- case KILLSCRIPT:
- log("Killing script...");
- stopAllScripts();
- return -1;
- case ANTIBAN:
- // TODO MAKE CUSTOM ANTI~BAN
- }
- }
- return random(340, 800);
- }
- /*****************************************************************************
- * \ FUNCTIONS \
- *****************************************************************************/
- private Action getAction() {
- /**
- * Variable reset
- */
- resetVariables();
- /**
- * Dynamic variable setting to skill -magic alchmy spell low/high
- */
- setVariablesToSkill();
- /**
- * Alch spell selected -Checks to see if a spell has been selected
- * -Clicks alch item
- */
- if (settings.itemAlchCheck) {
- if (Bot.getClient().isSpellSelected()) {
- currentInventoryString = "Cast";
- currentInventoryIDs = settings.alchItemIDs;
- return Action.USE_INVENTORY;
- }
- }
- /**
- * Eating procedure: -turns bones into peaches if peach count is
- * random(0,1) -if health is below the require eating level, will eat
- * -will stop script if so requested by 'stopScriptWhenNoFood'
- */
- if (settings.eatFood) {
- if (healthCheck()) {
- if (settings.bonesToPeachesCheck) {
- if (inventory.getCount(true, (FOODID)) == random(0, 1)) {
- if (inventory.getCount(true, (BONESPEACHTABID)) == 0) {
- log("Run out of Bones to Peaches Tabs, shutting down!");
- return Action.KILLSCRIPT;
- } else {
- if (inventory.getCount(true, (BONESID)) > 0) {
- currentInventoryString = "Break";
- currentInventoryIDs = new int[] { BONESPEACHTABID };
- return Action.USE_INVENTORY;
- } else {
- log("We are low on health and no bones, shutting down!");
- return Action.KILLSCRIPT;
- }
- }
- }
- }
- if (inventory.getCount(true, (FOODID)) == 0
- && settings.stopScriptWhenNoFood
- && interfaces.getInterfaceGroup(149) != null) {
- log("Can't find any food inside inventory, shutting down!");
- return Action.KILLSCRIPT;
- } else {
- currentInventoryString = "Eat";
- currentInventoryIDs = FOODID;
- return Action.USE_INVENTORY;
- }
- }
- }
- /**
- * Arrow equip check -if inventory arrow count is between(100 - 200) it
- * will equip them
- */
- if (settings.equipArrowsCheck) {
- if (inventory.getCount(true, (settings.equipArrowID)) >= random(
- 100, 200)) {
- currentInventoryString = "Wield";
- currentInventoryIDs = new int[] { settings.equipArrowID };
- return Action.USE_INVENTORY;
- }
- }
- /**
- * Potions check -Checks to see if the selected potion effect has run
- * out, uses selected potion if affected skill level is random 2 - 3
- * levels above real level
- */
- if (settings.usePotionCheck && currentPotionSet != null) {
- for (int a = 0; a < currentPotionSet.potions.size(); a++) {
- int affectedStat = currentPotionSet
- .getAffectedStat(currentPotionSet.potionNames[a]);
- if (skills.getCurrentSkillLevel(affectedStat)
- - skills.getRealSkillLevel(affectedStat) <= random(2, 3)) {
- int[] currentPotionIds = currentPotionSet
- .getPotionIDs(currentPotionSet.potionNames[a]);
- if (inventory.getCount(true, currentPotionIds) > 0) {
- currentInventoryString = "Drink";
- currentInventoryIDs = currentPotionIds;
- return Action.USE_INVENTORY;
- }
- }
- }
- }
- /**
- * NPC Interactions Check -will pause if both the character and npc are
- * interacting with each other -moves mouse to next npc is enabled -does
- * antiban
- */
- NPC[] interNPCs = getInteractingNPCs();
- if (getMyPlayer().getInteracting() != null && interNPCs.length > 0) {
- if (interNPCs[0].getHPPercent() != 0) {
- if (settings.antiBanCheck) {
- if (System.currentTimeMillis() >= nextABTime) {
- return Action.ANTIBAN;
- }
- }
- if (settings.moveMouseToNextNPC && getMyPlayer().isInCombat()) {
- if (random(0, 5) == 3) {
- NPC nextNPC = getNearestNPC(settings.npcIDs,
- settings.npcIsInCage, false);
- if (nextNPC != null) {
- Point npcScreen = nextNPC.getScreenPos();
- if (Calculations.onScreen(npcScreen)) {
- Point randomP = new Point(
- random(npcScreen.x - 5, npcScreen.x + 5),
- random(npcScreen.y - 5, npcScreen.y + 5));
- moveMouse(randomP);
- waitRandom = new int[] { 300, 900 };
- }
- }
- }
- }
- return Action.WAIT;
- }
- }
- /**
- * Player is moving check -wait untill player reaches around 3 tiles
- * away from the destination
- */
- if (getMyPlayer().isMoving()) {
- if (settings.antiBanCheck) {
- if (System.currentTimeMillis() >= nextABTime) {
- return Action.ANTIBAN;
- }
- }
- waitRandom = new int[] { 200, 600 };
- return Action.WAIT;
- }
- /**
- * Item alching check -if alching item id found inside inventory, the
- * spell will be cast -checks for nature runes and fire runes
- */
- if (settings.itemAlchCheck) {
- if (inventory.getCount(true, NATURE_ID) == 0
- || inventory.getCount(true, FIRE_ID) == 0) {
- log("Run out of alchemy runes, disabling auto alch!");
- settings.itemAlchCheck = false;
- waitRandom = new int[] { 300, 900 };
- return Action.WAIT;
- }
- if (inventory.getCount(true, settings.alchItemIDs) > 0) {
- return Action.USE_MAGIC;
- }
- }
- /**
- * Drop junk -just drops empty vials
- */
- if (inventory.getCount(true, JUNKIDS) > 0) {
- currentInventoryString = "Drop";
- currentInventoryIDs = JUNKIDS;
- return Action.USE_INVENTORY;
- }
- /**
- * Bury bones check -if set amount of bones is reached(according to bury
- * bones speed) the bones inside inventory are buried *
- */
- if (settings.buryBonesCheck) {
- if (buryBonesTillNone && inventory.getCount(true, BONESID) == 0) {
- buryBonesTillNone = false;
- }
- if (buryBonesTillNone && inventory.getCount(true, BONESID) > 0) {
- currentInventoryString = "Bury";
- currentInventoryIDs = BONESID;
- return Action.USE_INVENTORY;
- }
- if (settings.buryBonesSpeed.equals("After picking up one")) {
- if (inventory.getCount(true, BONESID) > 0) {
- currentInventoryString = "Bury";
- currentInventoryIDs = BONESID;
- return Action.USE_INVENTORY;
- }
- }
- if (settings.buryBonesSpeed
- .equals("After picking up a random amount")) {
- if (inventory.getCount(true, BONESID) >= random(5, 15)) {
- buryBonesTillNone = true;
- currentInventoryString = "Bury";
- currentInventoryIDs = BONESID;
- return Action.USE_INVENTORY;
- }
- }
- if (settings.buryBonesSpeed.equals("When inventory is full")) {
- if (inventory.isFull() && inventory.getCount(true, BONESID) > 0) {
- buryBonesTillNone = true;
- currentInventoryString = "Bury";
- currentInventoryIDs = BONESID;
- return Action.USE_INVENTORY;
- }
- }
- }
- /**
- * Special attack check -checks to see if there is enough special points
- * to use special attack
- */
- if (settings.useSpecialCheck) {
- if (canUseSpecial()) {
- return Action.USE_SPECIAL;
- }
- }
- /**
- * Pick up items thread -makes sure the thread is not started again
- */
- if (itemPickUpThread != null) {
- if (itemPickUpThread.isAlive()) {
- return Action.WAIT;
- }
- }
- /**
- * Pick up items check -picks up items to the set speed
- */
- if (settings.pickUpItems) {
- String pickUpSpeed = settings.pickUpSpeed;
- GroundItem itemTile = null;
- if (pickUpSpeed.equals("After each kill")) {
- itemTile = groundItems.getClosestItem(10, settings.itemIDs);
- }
- if (pickUpSpeed.equals("Random Occasions")) {
- if (random(0, 100) <= 10) {
- itemTile = groundItems.getClosestItem(10, settings.itemIDs);
- }
- }
- if (pickUpSpeed.equals("When no monsters around")) {
- if (npcCheck) {
- itemTile = groundItems.getClosestItem(10, settings.itemIDs);
- }
- }
- if (itemTile != null) {
- if (canPickUpItem(itemTile.getID(), true)) {
- try {
- Point itemScreen = getCalculations().tileToScreen(
- itemTile.getLocation());
- if (Calculations.onScreen(itemScreen)) {
- currentItemTile = itemTile;
- return Action.PICKUP;
- } else {
- currentWalkTile = (itemTile.getLocation());
- return Action.WALK;
- }
- } catch (Exception e) {
- System.out.print("picking up item error: " + e);
- waitRandom = new int[] { 700, 1500 };
- return Action.WAIT;
- }
- }
- }
- }
- if (settings.bonesToPeachesCheck || settings.buryBonesCheck) {
- GroundItem boneTile = groundItems.getClosestItem(5, BONESID);
- if (boneTile != null) {
- if (canPickUpItem(boneTile.getID(), false)) {
- try {
- Point boneScreen = getCalculations().tileToScreen(
- boneTile.getLocation());
- if (Calculations.onScreen(boneScreen)) {
- currentItemTile = boneTile;
- return Action.PICKUPBONE;
- } else {
- currentWalkTile = boneTile.getLocation();
- return Action.WALK;
- }
- } catch (Exception e) {
- System.out.print("picking up bones error: " + e);
- waitRandom = new int[] { 1000, 1900 };
- return Action.WAIT;
- }
- }
- }
- }
- /**
- * Attacking npc -Searches for nearest npc and attacks it -Shuts down
- * script if no npcs around for random 1min - 3min
- */
- NPC npc = npcs.getClosest(10, settings.npcIDs);
- if (npc != null) {
- npcCheck = false;
- try {
- Point npcScreen = npc.getScreenPos();
- if (Calculations.onScreen(npcScreen)
- || distanceTo(npc.getLocation()) <= 1) {
- currentNPC = npc;
- return Action.ATTACK;
- } else {
- currentWalkTile = npc.getLocation();
- return Action.WALK;
- }
- } catch (Exception e) {
- System.out.print("attacking npc error: " + e);
- waitRandom = new int[] { 1300, 1900 };
- return Action.WAIT;
- }
- } else {
- if (!npcCheck) {
- lastNPCCheck = System.currentTimeMillis();
- npcCheck = true;
- }
- if (npcCheck) {
- if (System.currentTimeMillis() - lastNPCCheck >= random(60000,
- 180000)) {
- log("No npcs around for a while, shutting down script!");
- return Action.KILLSCRIPT;
- }
- }
- }
- return null;
- }
- private void resetVariables() {
- currentNPC = null;
- currentItemTile = null;
- currentInventoryIDs = null;
- currentInventoryString = "";
- currentMagicSpell = 0;
- currentWalkTile = null;
- }
- private void setVariablesToSkill() {
- if (skills.getLevel(Skills.SKILL_MAGIC) >= 55) {
- currentMagicSpell = INTERFACE_HIGH_ALCH;
- } else {
- currentMagicSpell = INTERFACE_LOW_ACLH;
- }
- }
- int runEnergy = random(15, 50);
- private boolean runCheck() {
- try {
- if (walking.getEnergy() >= runEnergy) {
- runEnergy = random(15, 50);
- return true;
- } else {
- return false;
- }
- } catch (Exception e) {
- System.out.print("runCheck() error: " + e);
- return false;
- }
- }
- long healthRandomTime = 0;
- int hpToHealAt = 10;
- private boolean healthCheck() {
- try {
- if (System.currentTimeMillis() - healthRandomTime > 120000) {
- healthRandomTime = System.currentTimeMillis();
- hpToHealAt = (int) random((int) (skills
- .getLevel(Skills.SKILL_HITPOINTS) / 3), (int) (skills
- .getLevel(Skills.SKILL_HITPOINTS) / 1.5));
- }
- return (skills.getLevel(Skills.SKILL_HITPOINTS) <= hpToHealAt);
- } catch (Exception e) {
- System.out.print("healthCheck() error: " + e);
- }
- return false;
- }
- private boolean canPickUpItem(int itemID, boolean priority) {
- if (inventory.getCount() < 27) {
- return true;
- } else if (settings.itemAlchCheck && inventory.getCount() < 27
- || settings.itemAlchCheck && inventory.getCount() == 27
- && priority) {
- return true;
- } else if (!settings.itemAlchCheck && inventory.getCount() < 28) {
- return true;
- } else {
- if (inventory.getCount(true, itemID) > 0) {
- return true;
- }
- }
- return false;
- }
- private boolean clickNPC(NPC npc) {
- try {
- if (!getMyPlayer().isInCombat()) {
- if (npc == null) {
- return false;
- }
- if (npc != null && !npc.isInCombat()
- && npc.getInteracting() == null) {
- npc.doAction("Attack");
- return true;
- }
- if (getMyPlayer().isInCombat()) {
- sleep(500, 1000);
- }
- }
- } catch (Exception e) {
- System.out.print("clickNPC(NPC, String) error: " + e);
- return false;
- }
- return false;
- }
- class RFV2_ItemPickUpThread extends Thread {
- private volatile boolean stop = false;
- GroundItem item;
- String[] itemNames;
- public RFV2_ItemPickUpThread(GroundItem item, String[] itemNames) {
- this.item = item;
- this.itemNames = itemNames;
- }
- @Override
- public void run() {
- while (!stop) {
- try {
- int a;
- int hoverRand = random(6, 12);
- Point itemScreen = getCalculations().tileToScreen(
- item.getLocation());
- for (a = hoverRand; a-- >= 0;) {
- if (stop || item == null) {
- break;
- }
- List<String> menuItems = getMenuItems();
- if (menuItems.size() > 1) {
- int b;
- int itemLength = itemNames.length;
- for (b = 0; b < itemLength; b++) {
- if (listContainsString(menuItems, itemNames[b])) {
- StringBuffer fullItemCommandBuf = new StringBuffer();
- fullItemCommandBuf.append("Take ");
- fullItemCommandBuf.append(itemNames[b]);
- String fullItemCommand = fullItemCommandBuf
- .toString();
- if (menuItems.get(0)
- .equals(fullItemCommand)) {
- stopThread();
- clickMouse(true);
- Thread.sleep(320, 620);
- } else {
- stopThread();
- clickMouse(false);
- Thread.sleep(120, 510);
- atMenu(fullItemCommand);
- }
- }
- }
- }
- Point randomP = new Point(random(itemScreen.x - 5,
- itemScreen.x + 5), random(itemScreen.y - 5,
- itemScreen.y + 5));
- moveMouse(randomP);
- }
- stopThread();
- } catch (Exception e) {
- System.out.print("menuListener error: " + e);
- }
- }
- }
- public void stopThread() {
- stop = true;
- }
- };
- // Optimized version of array contains string
- private boolean listContainsString(List<String> list, String string) {
- try {
- int a;
- for (a = list.size() - 1; a-- >= 0;) {
- if (list.get(a).contains(string)) {
- return true;
- }
- }
- } catch (Exception e) {
- }
- return false;
- }
- public int distanceBetweenPoints(Point p1, Point p2) {
- return (int) Math.sqrt((p2.x - p1.x) * (p2.x - p1.x) + (p2.y - p1.y)
- * (p2.y - p1.y));
- }
- private Tile[] generatePath(Tile tile) {
- return generatePath(tile.getX(), tile.getY());
- }
- // Thanks to aftermath for method
- private Tile[] generatePath(int destinationX, int destinationY) {
- int startX = getMyPlayer().getLocation().getX();
- int startY = getMyPlayer().getLocation().getY();
- double dx, dy;
- ArrayList<Tile> list = new ArrayList<Tile>();
- list.add(new Tile(startX, startY));
- while (Math.hypot(destinationY - startY, destinationX - startX) > 8) {
- dx = destinationX - startX;
- dy = destinationY - startY;
- int gamble = random(10, 14);
- while (Math.hypot(dx, dy) > gamble) {
- dx *= .95;
- dy *= .95;
- }
- startX += (int) dx;
- startY += (int) dy;
- list.add(new Tile(startX, startY));
- }
- list.add(new Tile(destinationX, destinationY));
- return list.toArray(new Tile[list.size()]);
- }
- private boolean pickUpItem(GroundItem item, String[] itemNames) {
- try {
- itemPickUpThread = new RFV2_ItemPickUpThread(item, itemNames);
- itemPickUpThread.start();
- return true;
- } catch (Exception e) {
- System.out.print("pickUPItem(GroundItem, String[]): " + e);
- return false;
- }
- }
- int specialCost = 0;
- int lastSpecialValue = 0;
- long nextSpecialTime = 0;
- private boolean canUseSpecial() {
- int SPECIAL_BAR_VAL = getSetting(300);
- int SPECIAL_IS_ON = getSetting(301);
- switch (SPECIAL_IS_ON) {
- case 0:
- if (specialCost == 0) {
- if (SPECIAL_BAR_VAL < lastSpecialValue) {
- specialCost = lastSpecialValue - SPECIAL_BAR_VAL;
- return false;
- }
- }
- if (SPECIAL_BAR_VAL >= specialCost
- && System.currentTimeMillis() >= nextSpecialTime) {
- nextSpecialTime = System.currentTimeMillis()
- + random(5000, 45000);
- return true;
- }
- case 1:
- lastSpecialValue = SPECIAL_BAR_VAL;
- return false;
- }
- return false;
- }
- /*****************************************************************************
- * \ VARIABLES \
- *****************************************************************************/
- private long startTime = 0;
- private long nextABTime = 0;
- private boolean npcCheck = false;
- private long lastNPCCheck = 0;
- private boolean buryBonesTillNone = false;
- private RFV2_PotionSet currentPotionSet = null;
- private int[] waitRandom = { 200, 800 };
- private NPC currentNPC = null;
- private GroundItem currentItemTile = null;
- private int[] currentInventoryIDs = null;
- private String currentInventoryString = "";
- private Tile currentWalkTile = null;
- private int currentMagicSpell;
- private RFV2_ExperienceHandler experienceHandler = new RFV2_ExperienceHandler();
- private RFV2_ItemPickUpThread itemPickUpThread;
- /*****************************************************************************
- * \ CONSTANTS \
- *****************************************************************************/
- private enum Action {
- ATTACK, WALK, PICKUP, PICKUPBONE, USE_INVENTORY, USE_MAGIC, USE_SPECIAL, WAIT, KILLSCRIPT, ANTIBAN
- };
- private RFV2_Settings settings = new RFV2_Settings();
- private final String SETTINGS_FILE_NAME = "RuskisFighterV2Settings.ini";
- private final int INTERFACE_MAGIC = 192;
- private final int INTERFACE_HIGH_ALCH = 34;
- private final int INTERFACE_LOW_ACLH = 13;
- private 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 };
- private final int NATURE_ID = 561;
- private final int FIRE_ID = 554;
- private final int[] BONESID = { 534, 530, 532, 526, 536 };
- private final int BONESPEACHTABID = 8015;
- private final int[] JUNKIDS = { 229 };
- private final String[] BONE_NAMES = { "Bones", "Big bones", "Wolf bones",
- "Bat bones", "Jogre bones", "Dragon bones", "Monkey bones",
- "Shaikahan bones", "Zogre bones", "Dagannoth bones" };
- /*****************************************************************************
- * \ GRAPHICAL PAINT \
- *****************************************************************************/
- public void onRepaint(Graphics g) {
- int startAttackExp = 0, startStrengthExp = 0, startDefenseExp = 0, startHitpointsExp = 0, startRangeExp = 0, startMagicExp = 0, startPrayerExp = 0;
- if (settings.reportSetting.equals("Paint") && isLoggedIn()) {
- startAttackExp = experienceHandler.getSkillExp(Skills.SKILL_ATTACK);
- startStrengthExp = experienceHandler
- .getSkillExp(Skills.SKILL_STRENGTH);
- startDefenseExp = experienceHandler
- .getSkillExp(Skills.SKILL_DEFENSE);
- startHitpointsExp = experienceHandler
- .getSkillExp(Skills.SKILL_HITPOINTS);
- startRangeExp = experienceHandler.getSkillExp(Skills.SKILL_RANGE);
- startMagicExp = experienceHandler.getSkillExp(Skills.SKILL_MAGIC);
- startPrayerExp = experienceHandler.getSkillExp(Skills.SKILL_PRAYER);
- if (startTime == 0) {
- startTime = System.currentTimeMillis();
- }
- if (startAttackExp == 0) {
- experienceHandler.setExperiencePoints(Skills.SKILL_ATTACK,
- skills.getExperience(Skills.SKILL_ATTACK));
- }
- if (startStrengthExp == 0) {
- experienceHandler.setExperiencePoints(Skills.SKILL_STRENGTH,
- skills.getExperience(Skills.SKILL_STRENGTH));
- }
- if (startDefenseExp == 0) {
- experienceHandler.setExperiencePoints(Skills.SKILL_DEFENSE,
- skills.getExperience(Skills.SKILL_DEFENSE));
- }
- if (startHitpointsExp == 0) {
- experienceHandler.setExperiencePoints(Skills.SKILL_HITPOINTS,
- skills.getExperience(Skills.SKILL_HITPOINTS));
- }
- if (startRangeExp == 0) {
- experienceHandler.setExperiencePoints(Skills.SKILL_RANGE,
- skills.getExperience(Skills.SKILL_RANGE));
- }
- if (startMagicExp == 0) {
- experienceHandler.setExperiencePoints(Skills.SKILL_MAGIC,
- skills.getExperience(Skills.SKILL_MAGIC));
- }
- if (startPrayerExp == 0) {
- experienceHandler.setExperiencePoints(Skills.SKILL_PRAYER,
- skills.getExperience(Skills.SKILL_PRAYER));
- }
- ArrayList<String> reportList = new ArrayList<String>();
- reportList.add(getName() + " V" + getVersion());
- int currentAttackExp = skills.getExperience(Skills.SKILL_ATTACK);
- int currentStrengthExp = skills
- .getExperience(Skills.SKILL_STRENGTH);
- int currentDefenseExp = skills.getExperience(Skills.SKILL_DEFENSE);
- int currentHitpointsExp = skills
- .getExperience(Skills.SKILL_HITPOINTS);
- int currentRangeExp = skills.getExperience(Skills.SKILL_RANGE);
- int currentMagicExp = skills.getExperience(Skills.SKILL_MAGIC);
- int currentPrayerExp = skills.getExperience(Skills.SKILL_PRAYER);
- int attackExpChange = currentAttackExp - startAttackExp;
- if (attackExpChange > 0) {
- reportList.add("Attack Exp: " + attackExpChange);
- }
- int strengthExpChange = currentStrengthExp - startStrengthExp;
- if (strengthExpChange > 0) {
- reportList.add("Strength Exp: " + strengthExpChange);
- }
- int defenseExpChange = currentDefenseExp - startDefenseExp;
- if (defenseExpChange > 0) {
- reportList.add("Defense Exp: " + defenseExpChange);
- }
- int hitpointsExpChange = currentHitpointsExp - startHitpointsExp;
- if (hitpointsExpChange > 0) {
- reportList.add("Hitpoints Exp: " + hitpointsExpChange);
- }
- int rangeExpChange = currentRangeExp - startRangeExp;
- if (rangeExpChange > 0) {
- reportList.add("Range Exp: " + rangeExpChange);
- }
- int magicExpChange = currentMagicExp - startMagicExp;
- if (magicExpChange > 0) {
- reportList.add("Magic Exp: " + magicExpChange);
- }
- int prayerExpChange = currentPrayerExp - startPrayerExp;
- if (prayerExpChange > 0) {
- reportList.add("Prayer Exp: " + prayerExpChange);
- }
- 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;
- reportList.add("Runtime: " + hours + ":" + minutes + ":" + seconds);
- Point str = new Point(350, 25);
- g.setColor(new Color(60, 140, 200, 50));
- g.fill3DRect(340, 10, 165, reportList.size() * 20 + 6, true);
- g.setColor(new Color(60, 155, 159, 50));
- g.fill3DRect(341, 11, 163, reportList.size() * 20 + 4, true);
- g.setColor(Color.WHITE);
- for (int a = 0; a < reportList.size(); a++) {
- g.drawString(reportList.get(a), str.x, str.y);
- str = new Point(str.x, str.y + 20);
- }
- }
- }
- public Tile nextTile(final Tile[] path, final int maxDist) {
- final Tile cur = getMyPlayer().getLocation();
- for (int i = path.length - 1; i >= 0; i--) {
- if ((cur.distanceTo(path[i])) <= maxDist
- && (cur.distanceTo(path[path.length - 1]) > 5)) {
- return path[i];
- }
- }
- return null;
- }
- int x;
- int y;
- public int getX() {
- return x;
- }
- public int getY() {
- return y;
- }
- public Tile randomizeTile(final int maxXDeviation, final int maxYDeviation) {
- int x = getX();
- int y = getY();
- if (maxXDeviation > 0) {
- double d = Math.random() * 2 - 1.0;
- d *= maxXDeviation;
- x += (int) d;
- }
- if (maxYDeviation > 0) {
- double d = Math.random() * 2 - 1.0;
- d *= maxYDeviation;
- y += (int) d;
- }
- return new Tile(x, y);
- }
- /*****************************************************************************
- * \ USER INTERFACE - Generate by Netbeans IDE 6.1 - edited by Ruski \
- *****************************************************************************/
- private void showSettingsInterface() {
- mainFrame = new javax.swing.JFrame("Ruskis Fighter V" + getVersion());
- jPanel1 = new javax.swing.JPanel();
- jLabel111 = new javax.swing.JLabel();
- jTabbedPane1 = new javax.swing.JTabbedPane();
- jPanel2 = new javax.swing.JPanel();
- jLabel222 = new javax.swing.JLabel();
- jLabel333 = new javax.swing.JLabel();
- npcIDs = new javax.swing.JTextField();
- jLabel444 = new javax.swing.JLabel();
- specialCheck = new javax.swing.JCheckBox();
- npcsInCageCheck = new javax.swing.JCheckBox();
- jPanel3 = new javax.swing.JPanel();
- jLabel7 = new javax.swing.JLabel();
- jLabel8 = new javax.swing.JLabel();
- itemIDs = new javax.swing.JTextField();
- jLabel10 = new javax.swing.JLabel();
- itemNamesText = new javax.swing.JTextField();
- pickUpCheck = new javax.swing.JCheckBox();
- jLabel12 = new javax.swing.JLabel();
- pickUpSpeedCombo = new javax.swing.JComboBox();
- jLabel9 = new javax.swing.JLabel();
- jLabel11 = new javax.swing.JLabel();
- jPanel4 = new javax.swing.JPanel();
- eatFoodCheck = new javax.swing.JCheckBox();
- jLabel14 = new javax.swing.JLabel();
- stopScriptWhenNoFoodCheck = new javax.swing.JCheckBox();
- peachesCheck = new javax.swing.JCheckBox();
- jLabel15 = new javax.swing.JLabel();
- jLabel16 = new javax.swing.JLabel();
- jPanel5 = new javax.swing.JPanel();
- bonesCheck = new javax.swing.JCheckBox();
- jLabel17 = new javax.swing.JLabel();
- jLabel18 = new javax.swing.JLabel();
- burySpeedCombo = new javax.swing.JComboBox();
- jLabel19 = new javax.swing.JLabel();
- jPanel6 = new javax.swing.JPanel();
- usePotionsCheck = new javax.swing.JCheckBox();
- jLabel20 = new javax.swing.JLabel();
- jLabel21 = new javax.swing.JLabel();
- potionCombo = new javax.swing.JComboBox();
- addPotionButton = new javax.swing.JButton();
- potionScroll = new javax.swing.JScrollPane();
- potionList = new javax.swing.JList();
- removePotionButton = new javax.swing.JButton();
- jPanel8 = new javax.swing.JPanel();
- useItemAlchCheck = new javax.swing.JCheckBox();
- jLabel23 = new javax.swing.JLabel();
- jLabel24 = new javax.swing.JLabel();
- alchItemIDsText = new javax.swing.JTextField();
- jLabel25 = new javax.swing.JLabel();
- jLabel26 = new javax.swing.JLabel();
- jPanel9 = new javax.swing.JPanel();
- jLabel6 = new javax.swing.JLabel();
- equipArrowsCheck = new javax.swing.JCheckBox();
- jLabel13 = new javax.swing.JLabel();
- equipArrowText = new javax.swing.JTextField();
- jPanel7 = new javax.swing.JPanel();
- jLabel27 = new javax.swing.JLabel();
- antibanCheck = new javax.swing.JCheckBox();
- nextNPCCheck = new javax.swing.JCheckBox();
- jLabel28 = new javax.swing.JLabel();
- jLabel5 = new javax.swing.JLabel();
- reportCombo = new javax.swing.JComboBox();
- startButton = new javax.swing.JButton();
- saveFormSettingsCheck = new javax.swing.JCheckBox();
- mainFrame
- .setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
- jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null,
- "Welcome",
- javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION,
- javax.swing.border.TitledBorder.DEFAULT_POSITION,
- new java.awt.Font("Tahoma", 1, 11))); // NOI18N
- jLabel111
- .setText("<html>Fill out the below form to start auto fighting. You can also click on \"Save Settings\" to save the form input for future use.</html>");
- javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(
- jPanel1);
- jPanel1.setLayout(jPanel1Layout);
- jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING).addGroup(
- jPanel1Layout.createSequentialGroup().addContainerGap()
- .addComponent(jLabel111,
- javax.swing.GroupLayout.PREFERRED_SIZE, 415,
- javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(110, Short.MAX_VALUE)));
- jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING).addGroup(
- jPanel1Layout.createSequentialGroup().addComponent(jLabel111,
- javax.swing.GroupLayout.DEFAULT_SIZE, 28,
- Short.MAX_VALUE).addContainerGap()));
- jLabel222
- .setText("<html>Put in the monster IDs you would like to auto fight. Separate each ID with a comma, as shown in the example below.</html>");
- jLabel333.setText("NPC IDs:");
- jLabel444.setText("(separate each ID with a comma, e.g 123,23,12)");
- specialCheck.setText("Use Special Attack?");
- npcsInCageCheck.setText("NPCs are in cage (range, magic)");
- javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(
- jPanel2);
- jPanel2.setLayout(jPanel2Layout);
- jPanel2Layout
- .setHorizontalGroup(jPanel2Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel2Layout
- .createSequentialGroup()
- .addGap(10, 10, 10)
- .addGroup(
- jPanel2Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel2Layout
- .createSequentialGroup()
- .addComponent(
- jLabel333)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(
- jPanel2Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(
- npcIDs,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- 236,
- javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGroup(
- jPanel2Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.TRAILING,
- false)
- .addGroup(
- javax.swing.GroupLayout.Alignment.LEADING,
- jPanel2Layout
- .createSequentialGroup()
- .addComponent(
- specialCheck)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- Short.MAX_VALUE)
- .addComponent(
- npcsInCageCheck))
- .addComponent(
- jLabel444,
- javax.swing.GroupLayout.Alignment.LEADING))))
- .addComponent(
- jLabel222,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- 429,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap(103, Short.MAX_VALUE)));
- jPanel2Layout
- .setVerticalGroup(jPanel2Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel2Layout
- .createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel222)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addGroup(
- jPanel2Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel333)
- .addComponent(
- npcIDs,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jLabel444)
- .addGap(18, 18, 18)
- .addGroup(
- jPanel2Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(
- specialCheck)
- .addComponent(
- npcsInCageCheck))
- .addContainerGap(93, Short.MAX_VALUE)));
- jTabbedPane1.addTab("Monsters", jPanel2);
- jLabel7
- .setText("<html>Enter the IDs and the names of the items you wish to pick up. Please make sure you put in both the ID and the name for the item and the spelling of the item name is exactly as in the game.</html>");
- jLabel8.setText("Item IDs:");
- jLabel10.setText("Item Names:");
- pickUpCheck.setText("Use Item Pick Up?");
- jLabel12.setText("Pick Up Speed:");
- pickUpSpeedCombo.setModel(new javax.swing.DefaultComboBoxModel(
- new String[] { "After each kill", "Random Occasions",
- "When no monsters around" }));
- jLabel9.setText("(separate IDs with a comma, e.g 123,21,31)");
- jLabel11.setText("(separate names with a comma, e.g Coins,Iron arrow)");
- javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(
- jPanel3);
- jPanel3.setLayout(jPanel3Layout);
- jPanel3Layout
- .setHorizontalGroup(jPanel3Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel3Layout
- .createSequentialGroup()
- .addContainerGap()
- .addGroup(
- jPanel3Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel3Layout
- .createSequentialGroup()
- .addComponent(
- pickUpCheck)
- .addContainerGap())
- .addGroup(
- javax.swing.GroupLayout.Alignment.TRAILING,
- jPanel3Layout
- .createSequentialGroup()
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(
- jPanel3Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.TRAILING)
- .addGroup(
- javax.swing.GroupLayout.Alignment.LEADING,
- jPanel3Layout
- .createSequentialGroup()
- .addGroup(
- jPanel3Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel3Layout
- .createSequentialGroup()
- .addGap(
- 8,
- 8,
- 8)
- .addComponent(
- jLabel10))
- .addGroup(
- jPanel3Layout
- .createSequentialGroup()
- .addGap(
- 10,
- 10,
- 10)
- .addComponent(
- jLabel8)))
- .addGap(
- 18,
- 18,
- 18)
- .addGroup(
- jPanel3Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.TRAILING,
- false)
- .addComponent(
- itemNamesText,
- javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(
- jLabel9,
- javax.swing.GroupLayout.Alignment.LEADING,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- Short.MAX_VALUE)
- .addComponent(
- jLabel11,
- javax.swing.GroupLayout.Alignment.LEADING,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- Short.MAX_VALUE)
- .addComponent(
- itemIDs,
- javax.swing.GroupLayout.Alignment.LEADING,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- 258,
- javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addGroup(
- javax.swing.GroupLayout.Alignment.LEADING,
- jPanel3Layout
- .createSequentialGroup()
- .addComponent(
- jLabel12)
- .addGap(
- 18,
- 18,
- 18)
- .addComponent(
- pickUpSpeedCombo,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addComponent(
- jLabel7,
- javax.swing.GroupLayout.Alignment.LEADING,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- 421,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap()))));
- jPanel3Layout
- .setVerticalGroup(jPanel3Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel3Layout
- .createSequentialGroup()
- .addContainerGap()
- .addComponent(pickUpCheck)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(
- jLabel7,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- 47,
- javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(
- jPanel3Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel8)
- .addComponent(
- itemIDs,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jLabel9)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(
- jPanel3Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel10)
- .addComponent(
- itemNamesText,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jLabel11)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(
- jPanel3Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel12)
- .addComponent(
- pickUpSpeedCombo,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap(27, Short.MAX_VALUE)));
- jTabbedPane1.addTab("Item Pick Up", jPanel3);
- eatFoodCheck.setText("Eat Food?");
- jLabel14
- .setText("<html>Food is automatically found in your inventory and eaten at a random hp. You can select \"Stop script when no food\", so when you run out of food, the script is ended.</html>");
- stopScriptWhenNoFoodCheck.setText("Stop script when no food?");
- peachesCheck.setText("Use bones to peaches?");
- jLabel15
- .setText("<html>Bones to peaches useus \"Bones to Peaches\" tabs. The script will automatically pick up bones and when inventory full or more food is needed, it will turn the bones into peaches.</html>");
- jLabel16.setFont(new java.awt.Font("Tahoma", 1, 11));
- jLabel16.setForeground(new java.awt.Color(204, 0, 0));
- jLabel16
- .setText("<html>WARNING: \"Bury Bones\" function is automally disabled when this feature is used.</html>");
- javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(
- jPanel4);
- jPanel4.setLayout(jPanel4Layout);
- jPanel4Layout
- .setHorizontalGroup(jPanel4Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel4Layout
- .createSequentialGroup()
- .addContainerGap()
- .addGroup(
- jPanel4Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(
- peachesCheck)
- .addComponent(
- jLabel14,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- 522,
- Short.MAX_VALUE)
- .addGroup(
- jPanel4Layout
- .createSequentialGroup()
- .addComponent(
- eatFoodCheck)
- .addGap(
- 18,
- 18,
- 18)
- .addComponent(
- stopScriptWhenNoFoodCheck))
- .addComponent(
- jLabel15,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- 522,
- Short.MAX_VALUE)
- .addComponent(
- jLabel16,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- 423,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap()));
- jPanel4Layout
- .setVerticalGroup(jPanel4Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel4Layout
- .createSequentialGroup()
- .addContainerGap()
- .addGroup(
- jPanel4Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(
- eatFoodCheck)
- .addComponent(
- stopScriptWhenNoFoodCheck))
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(jLabel14)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(peachesCheck)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jLabel15)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jLabel16)
- .addContainerGap(65, Short.MAX_VALUE)));
- jTabbedPane1.addTab("Food/Eating", jPanel4);
- bonesCheck.setText("Collect and Bury Bones?");
- jLabel17
- .setText("<html>Will collect all types of bones and bury them according to \"When to bury\" is specified. Cannot be used with \"Bones to peaches\" functions.</html>");
- jLabel18.setText("When to bury:");
- burySpeedCombo.setModel(new javax.swing.DefaultComboBoxModel(
- new String[] { "After picking up one",
- "After picking up a random amount",
- "When inventory is full" }));
- jLabel19
- .setText("<html>When random is selected, the script will bury bones when the bone count inside the inventory is between 5 - 15 bones.</html> ");
- javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(
- jPanel5);
- jPanel5.setLayout(jPanel5Layout);
- jPanel5Layout
- .setHorizontalGroup(jPanel5Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel5Layout
- .createSequentialGroup()
- .addContainerGap()
- .addGroup(
- jPanel5Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING,
- false)
- .addComponent(
- bonesCheck)
- .addGroup(
- jPanel5Layout
- .createSequentialGroup()
- .addGap(
- 10,
- 10,
- 10)
- .addComponent(
- jLabel18)
- .addGap(
- 18,
- 18,
- 18)
- .addComponent(
- burySpeedCombo,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addComponent(
- jLabel17,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- 428,
- Short.MAX_VALUE)
- .addComponent(jLabel19,
- 0, 0,
- Short.MAX_VALUE))
- .addContainerGap(104, Short.MAX_VALUE)));
- jPanel5Layout
- .setVerticalGroup(jPanel5Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel5Layout
- .createSequentialGroup()
- .addContainerGap()
- .addComponent(bonesCheck)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(jLabel17)
- .addGap(11, 11, 11)
- .addGroup(
- jPanel5Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel18)
- .addComponent(
- burySpeedCombo,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(
- jLabel19,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- 41,
- javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(81, Short.MAX_VALUE)));
- jTabbedPane1.addTab("Bury Bones", jPanel5);
- usePotionsCheck.setText("Use Potions?");
- jLabel20
- .setText("<html>When enabled, the script will automatically drink the desired potion(s) when the affected skill is only 2-3 above the actual skill level. Use the combo list of potions to selected the required potion and press add to add it to the potion list. To remove a potion from the list, select the potion in the list and press remove.</html>");
- jLabel21.setText("Potion Combo:");
- potionCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
- "Regular Attack Potion", "Regular Strength Potion",
- "Super Strength Potion", "Super Defense Potion",
- "Super Attack Potion", "Magic Potion", "Ranging Potion" }));
- addPotionButton.setText("ADD");
- addPotionButton.addActionListener(this);
- potionList
- .setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
- potionScroll.setViewportView(potionList);
- removePotionButton.setText("REMOVE");
- removePotionButton.addActionListener(this);
- javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(
- jPanel6);
- jPanel6.setLayout(jPanel6Layout);
- jPanel6Layout
- .setHorizontalGroup(jPanel6Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel6Layout
- .createSequentialGroup()
- .addContainerGap()
- .addGroup(
- jPanel6Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(
- usePotionsCheck)
- .addGroup(
- jPanel6Layout
- .createSequentialGroup()
- .addGroup(
- jPanel6Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING,
- false)
- .addGroup(
- jPanel6Layout
- .createSequentialGroup()
- .addGap(
- 10,
- 10,
- 10)
- .addComponent(
- jLabel21)
- .addGap(
- 18,
- 18,
- 18)
- .addComponent(
- potionCombo,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addComponent(
- potionScroll,
- 0,
- 0,
- Short.MAX_VALUE))
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(
- jPanel6Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING,
- false)
- .addComponent(
- removePotionButton,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- Short.MAX_VALUE)
- .addComponent(
- addPotionButton,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- 100,
- Short.MAX_VALUE)))
- .addComponent(
- jLabel20,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- 428,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap(104, Short.MAX_VALUE)));
- jPanel6Layout
- .setVerticalGroup(jPanel6Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel6Layout
- .createSequentialGroup()
- .addContainerGap()
- .addComponent(usePotionsCheck)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jLabel20)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(
- jPanel6Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.TRAILING)
- .addGroup(
- jPanel6Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(
- potionCombo,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(
- addPotionButton))
- .addComponent(jLabel21))
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addGroup(
- jPanel6Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(
- potionScroll,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- 85,
- Short.MAX_VALUE)
- .addComponent(
- removePotionButton))
- .addContainerGap()));
- jTabbedPane1.addTab("Potions", jPanel6);
- useItemAlchCheck.setText("Use Item Alching?");
- jLabel23
- .setText("<html>To use this function, make sure that you have some kind of item(s) that you are picking to be alched. Also have the required runes. Below you can enter the item IDs that you wish to be alched, make sure they are also in the \"Item Pick Up\" functions.</html>");
- jLabel24.setText("Alch Item IDs:");
- jLabel25.setText("(separate each ID with a comma, e.g 123,23,12)");
- jLabel26.setFont(new java.awt.Font("Tahoma", 1, 11));
- jLabel26.setForeground(new java.awt.Color(204, 0, 0));
- jLabel26
- .setText("WARNING: Make sure you have enough inventory space for coins.");
- javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(
- jPanel8);
- jPanel8.setLayout(jPanel8Layout);
- jPanel8Layout
- .setHorizontalGroup(jPanel8Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel8Layout
- .createSequentialGroup()
- .addContainerGap()
- .addGroup(
- jPanel8Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel8Layout
- .createSequentialGroup()
- .addGap(
- 22,
- 22,
- 22)
- .addGroup(
- jPanel8Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(
- jLabel26)
- .addGroup(
- jPanel8Layout
- .createSequentialGroup()
- .addComponent(
- jLabel24)
- .addGap(
- 18,
- 18,
- 18)
- .addGroup(
- jPanel8Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING,
- false)
- .addComponent(
- alchItemIDsText)
- .addComponent(
- jLabel25,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- Short.MAX_VALUE)))))
- .addComponent(
- useItemAlchCheck)
- .addGroup(
- jPanel8Layout
- .createSequentialGroup()
- .addGap(
- 12,
- 12,
- 12)
- .addComponent(
- jLabel23,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- 461,
- javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addContainerGap(63, Short.MAX_VALUE)));
- jPanel8Layout
- .setVerticalGroup(jPanel8Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel8Layout
- .createSequentialGroup()
- .addContainerGap()
- .addComponent(useItemAlchCheck)
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(jLabel23)
- .addGap(11, 11, 11)
- .addGroup(
- jPanel8Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(jLabel24)
- .addComponent(
- alchItemIDsText,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- javax.swing.GroupLayout.DEFAULT_SIZE,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(
- javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(jLabel25).addGap(18, 18,
- 18).addComponent(jLabel26)
- .addContainerGap(85, Short.MAX_VALUE)));
- jTabbedPane1.addTab("Item alching", jPanel8);
- jLabel6
- .setText("<html>Here you can specify if you would like to equip arrows or not, it will equip when there are random 100 - 200 arrows in the inventory. Also put in arrow id you would like to equip.</html>");
- equipArrowsCheck.setText("Equip Arrows?");
- jLabel13.setText("Arrow ID:");
- javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(
- jPanel9);
- jPanel9.setLayout(jPanel9Layout);
- jPanel9Layout
- .setHorizontalGroup(jPanel9Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel9Layout
- .createSequentialGroup()
- .addContainerGap()
- .addGroup(
- jPanel9Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(
- equipArrowsCheck)
- .addGroup(
- jPanel9Layout
- .createSequentialGroup()
- .addComponent(
- jLabel13)
- .addGap(
- 18,
- 18,
- 18)
- .addComponent(
- equipArrowText,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- 227,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addComponent(
- jLabel6,
- javax.swing.GroupLayout.PREFERRED_SIZE,
- 457,
- javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap(75, Short.MAX_VALUE)));
- jPanel9Layout
- .setVerticalGroup(jPanel9Layout
- .createParallelGroup(
- javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(
- jPanel9Layout
- .createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel6)
- .addGap(18, 18, 18)
- .addComponent(equipArrowsCheck)
- .addPreferredGap(
- javax.swing.LayoutStyle.Compone
Add Comment
Please, Sign In to add comment