- import java.awt.BasicStroke;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Image;
- import java.awt.Point;
- import java.awt.Rectangle;
- import java.awt.RenderingHints;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- import java.io.IOException;
- import java.lang.reflect.InvocationTargetException;
- import java.net.URL;
- import java.util.ArrayList;
- import java.util.LinkedList;
- import javax.imageio.ImageIO;
- import javax.swing.SwingUtilities;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- import javax.swing.event.ChangeEvent;
- import javax.swing.event.ChangeListener;
- import com.rarebot.event.events.MessageEvent;
- import com.rarebot.event.listeners.MessageListener;
- import com.rarebot.event.listeners.PaintListener;
- import com.rarebot.script.Script;
- import com.rarebot.script.ScriptManifest;
- import com.rarebot.script.methods.Equipment;
- import com.rarebot.script.methods.Magic;
- import com.rarebot.script.methods.Skills;
- import com.rarebot.script.methods.Game.Tab;
- import com.rarebot.script.util.Filter;
- import com.rarebot.script.wrappers.RSArea;
- import com.rarebot.script.wrappers.RSComponent;
- import com.rarebot.script.wrappers.RSItem;
- import com.rarebot.script.wrappers.RSModel;
- import com.rarebot.script.wrappers.RSNPC;
- import com.rarebot.script.wrappers.RSObject;
- import com.rarebot.script.wrappers.RSPath;
- import com.rarebot.script.wrappers.RSTile;
- import com.rarebot.script.wrappers.RSTilePath;
- @ScriptManifest(authors = { "Magic" }, keywords = "RuneSpan Magician", name = "RuneSpan Magician", version = 1.2, description = "Makes Runes")
- public class RuneSpanMagician extends Script implements PaintListener, MouseListener, MessageListener {
- public RuneSpanMagicianGUI GUI;
- ArrayList<Integer> NodeList = new ArrayList<Integer>();
- private String status = "";
- public int Points = 0;
- public int InitPoints = 0;
- public int GainedPoints = 0;
- public int PointsHour = 0;
- public boolean DoEssling = false;
- public boolean DoHound = false;
- public boolean DoEssWraith = false;
- public boolean DoNode = false;
- public static class RuneSpan {
- public static int Essling = 0;
- public static int Hound = 0;
- public static int EssWraith = 0;
- public static int Node = 0;
- public static int[]NodeMulti = {};
- }
- private RSNPC InfoEssling() {
- return npcs.getNearest(new Filter<RSNPC>(){
- public boolean accept(RSNPC npc) {
- return npc != null && npc.getID() == RuneSpan.Essling && npc.getAnimation() != 16541 && calc.distanceTo(npc.getLocation()) <= 10;
- }
- });
- }
- private RSNPC InfoHound() {
- return npcs.getNearest(new Filter<RSNPC>(){
- public boolean accept(RSNPC npc) {
- return npc != null && npc.getID() == RuneSpan.Hound && npc.getAnimation() != 16661 && calc.distanceTo(npc.getLocation()) <= 10;
- }
- });
- }
- private RSNPC InfoEssWraith() {
- return npcs.getNearest(new Filter<RSNPC>(){
- public boolean accept(RSNPC npc) {
- return npc != null && npc.getID() == RuneSpan.EssWraith && npc.getAnimation() != 16641 && calc.distanceTo(npc.getLocation()) <= 10;
- }
- });
- }
- private RSObject InfoNode() {
- return objects.getNearest(new Filter<RSObject>(){
- public boolean accept(RSObject o) {
- for (Integer i : RuneSpan.NodeMulti)
- if(o != null && o.getID() == i && calc.distanceTo(o.getLocation()) <= 10)
- return true;
- return false;
- }
- });
- }
- private RSNPC InfoEsslingCurrent() {
- return npcs.getNearest(new Filter<RSNPC>(){
- public boolean accept(RSNPC npc) {
- return npc != null && npc.getID() == RuneSpan.Essling && players.getMyPlayer().getAnimation() == 16596 && calc.distanceTo(npc.getLocation()) <= 10;
- }
- });
- }
- private RSNPC InfoHoundCurrent() {
- return npcs.getNearest(new Filter<RSNPC>(){
- public boolean accept(RSNPC npc) {
- return npc != null && npc.getID() == RuneSpan.Hound && players.getMyPlayer().getAnimation() == 16596 && calc.distanceTo(npc.getLocation()) <= 10;
- }
- });
- }
- private RSNPC InfoEssWraithCurrent() {
- return npcs.getNearest(new Filter<RSNPC>(){
- public boolean accept(RSNPC npc) {
- return npc != null && npc.getID() == RuneSpan.EssWraith && players.getMyPlayer().getAnimation() == 16596 && calc.distanceTo(npc.getLocation()) <= 10;
- }
- });
- }
- private Image getImage(String url) {
- try {
- return ImageIO.read(new URL(url));
- } catch(IOException e) {
- return null;
- }
- }
- Rectangle close = new Rectangle(492, 343, 18, 20);
- Point p;
- boolean hide = false;
- public int[] SKILLS_ARRAY = new int[25];
- private final LinkedList<MousePathPoint> mousePath = new LinkedList<MousePathPoint>();
- public long startTime = System.currentTimeMillis();
- private final Color color1 = new Color(51, 51, 51, 197);
- private final Color color2 = new Color(0, 0, 0);
- private final Color color3 = new Color(51, 51, 51);
- private final Color color4 = new Color(51, 204, 0);
- private final Color color5 = new Color(255, 0, 0, 197);
- private final Color color6 = new Color(51, 51, 51, 197);
- private final Color color7 = new Color(255, 255, 255);
- private final Color color8 = new Color(0, 0, 0);
- private final BasicStroke stroke1 = new BasicStroke(2);
- private final BasicStroke stroke2 = new BasicStroke(1);
- private final Font font1 = new Font("Lithos Pro", 0, 15);
- private final Font font2 = new Font("Lithos Pro", 0, 11);
- private final Font font10 = new Font("Heiti SC", 1, 14);
- Image img1;
- Image img2;
- public boolean onStart() {
- log("Welcome to RuneSpan Magician");
- log("... Loading: Paint ...");
- img1 = getImage("http://i46.tinypic.com/2aahtet.png");
- img2 = getImage("http://i41.tinypic.com/o85r4h.png");
- log("... Paint: Loaded ...");
- try {
- SwingUtilities.invokeAndWait(new Runnable()
- {
- public void run()
- {
- GUI = new RuneSpanMagicianGUI();
- GUI.setVisible(true);
- }
- });
- }
- catch (InterruptedException e){}
- catch (InvocationTargetException e){}
- while(GUI.isVisible())
- {
- status = "Settings";
- sleep(50);
- }
- if (DoNode == true) {
- if (RuneSpan.Node == 70455) {
- NodeList.add(70455);
- }
- if (RuneSpan.Node == 70456) {
- NodeList.add(70455);
- NodeList.add(70456);
- }
- if (RuneSpan.Node == 70457) {
- NodeList.add(70455);
- NodeList.add(70456);
- NodeList.add(70457);
- }
- if (RuneSpan.Node == 70458) {
- NodeList.add(70455);
- NodeList.add(70456);
- NodeList.add(70457);
- NodeList.add(70458);
- }
- if (RuneSpan.Node == 70459) {
- NodeList.add(70455);
- NodeList.add(70456);
- NodeList.add(70457);
- NodeList.add(70458);
- NodeList.add(70459);
- }
- if (RuneSpan.Node == 70460) {
- NodeList.add(70455);
- NodeList.add(70456);
- NodeList.add(70457);
- NodeList.add(70458);
- NodeList.add(70459);
- NodeList.add(70460);
- }
- if (RuneSpan.Node == 70461) {
- NodeList.add(70456);
- NodeList.add(70457);
- NodeList.add(70458);
- NodeList.add(70459);
- NodeList.add(70460);
- NodeList.add(70461);
- }
- if (RuneSpan.Node == 70462) {
- NodeList.add(70457);
- NodeList.add(70458);
- NodeList.add(70459);
- NodeList.add(70460);
- NodeList.add(70461);
- NodeList.add(70462);
- }
- if (RuneSpan.Node == 70463) {
- NodeList.add(70458);
- NodeList.add(70459);
- NodeList.add(70460);
- NodeList.add(70461);
- NodeList.add(70462);
- NodeList.add(70463);
- }
- if (RuneSpan.Node == 70464) {
- NodeList.add(70459);
- NodeList.add(70460);
- NodeList.add(70461);
- NodeList.add(70462);
- NodeList.add(70463);
- NodeList.add(70464);
- }
- if (RuneSpan.Node == 70465) {
- NodeList.add(70460);
- NodeList.add(70461);
- NodeList.add(70462);
- NodeList.add(70463);
- NodeList.add(70464);
- NodeList.add(70465);
- }
- if (RuneSpan.Node == 70466) {
- NodeList.add(70461);
- NodeList.add(70462);
- NodeList.add(70463);
- NodeList.add(70464);
- NodeList.add(70465);
- NodeList.add(70466);
- }
- if (RuneSpan.Node == 70467) {
- NodeList.add(70462);
- NodeList.add(70463);
- NodeList.add(70464);
- NodeList.add(70465);
- NodeList.add(70466);
- NodeList.add(70467);
- }
- if (RuneSpan.Node == 70468) {
- NodeList.add(70463);
- NodeList.add(70464);
- NodeList.add(70465);
- NodeList.add(70466);
- NodeList.add(70467);
- NodeList.add(70468);
- }
- if (RuneSpan.Node == 70469) {
- NodeList.add(70464);
- NodeList.add(70465);
- NodeList.add(70466);
- NodeList.add(70467);
- NodeList.add(70468);
- NodeList.add(70469);
- }
- if (RuneSpan.Node == 70470) {
- NodeList.add(70465);
- NodeList.add(70466);
- NodeList.add(70467);
- NodeList.add(70468);
- NodeList.add(70469);
- NodeList.add(70470);
- }
- if (RuneSpan.Node == 70471) {
- NodeList.add(70466);
- NodeList.add(70467);
- NodeList.add(70468);
- NodeList.add(70469);
- NodeList.add(70470);
- NodeList.add(70471);
- }
- }
- int[] ia = new int[NodeList.size()];
- for (int i=0; i<ia.length; i++) {
- ia[i] = NodeList.get(i);
- }
- RuneSpan.NodeMulti = ia;
- while (!game.isLoggedIn()) {
- status = "Waiting...";
- sleep(50);
- }
- try {
- InitPoints = Integer.parseInt(interfaces.getComponent(1274, 2).getText());
- }
- catch (NullPointerException exception) {
- }
- getSkillData();
- return true;
- }
- public void onFinish() {
- log("Thanks for using RuneSpan Magician");
- }
- @Override
- public int loop() {
- final RSNPC Essling = InfoEssling();
- final RSNPC Hound = InfoHound();
- final RSNPC EssWraith = InfoEssWraith();
- final RSObject Node = InfoNode();
- try {
- try {
- Points = Integer.parseInt(interfaces.getComponent(1274, 2).getText());
- }
- catch (NullPointerException exception) {
- }
- if (players.getMyPlayer().getAnimation() != -1) {
- for (int i = 0; i < 1000 && players.getMyPlayer().getAnimation() != -1 && game.isLoggedIn() && Node == null; i++) {
- status = "Waiting..";
- try {
- Points = Integer.parseInt(interfaces.getComponent(1274, 2).getText());
- }
- catch (NullPointerException exception) {
- }
- sleep(50);
- }
- return 0;
- }
- else if (Node != null && players.getMyPlayer().getAnimation() == -1 && DoNode == true) {
- if (Node.isOnScreen()) {
- status = "Interacting With " + Node.getName();
- if (interact("Siphon " + Node.getName(), Node)) {
- sleep(900, 1200);
- return 0;
- }
- }
- else if (!Node.isOnScreen()) {
- status = "Walking To " + Node.getName();
- for (int i = 0; i < 13 && !players.getMyPlayer().isMoving(); i++) {
- walking.walkTileMM(Node.getLocation());
- sleep(100);
- }
- for (int i = 0; i < 13 && !Node.isOnScreen(); i++) {
- sleep(50);
- }
- }
- }
- else if (Essling != null && players.getMyPlayer().getAnimation() == -1 && DoEssling == true) {
- if (Essling.isOnScreen()) {
- status = "Interacting With " + Essling.getName();
- if (interact("Siphon " + Essling.getName(), Essling)) {
- sleep(900, 1200);
- return 0;
- }
- }
- else if (!Essling.isOnScreen()) {
- status = "Walking To " + Essling.getName();
- for (int i = 0; i < 13 && !players.getMyPlayer().isMoving(); i++) {
- walking.walkTileMM(Essling.getLocation());
- sleep(100);
- }
- for (int i = 0; i < 13 && !Essling.isOnScreen(); i++) {
- sleep(50);
- }
- }
- }
- else if (EssWraith != null && players.getMyPlayer().getAnimation() == -1 && DoEssWraith == true) {
- if (EssWraith.isOnScreen()) {
- status = "Interacting With " + EssWraith.getName();
- if (interact("Siphon " + EssWraith.getName(), EssWraith)) {
- sleep(900, 1200);
- return 0;
- }
- }
- else if (!EssWraith.isOnScreen()) {
- status = "Walking To " + EssWraith.getName();
- for (int i = 0; i < 13 && !players.getMyPlayer().isMoving(); i++) {
- walking.walkTileMM(EssWraith.getLocation());
- sleep(100);
- }
- for (int i = 0; i < 13 && !EssWraith.isOnScreen(); i++) {
- sleep(50);
- }
- }
- }
- else if (Hound != null && players.getMyPlayer().getAnimation() == -1 && DoHound == true) {
- if (Hound.isOnScreen()) {
- status = "Interacting With " + Hound.getName();
- if (interact("Siphon " + Hound.getName(), Hound)) {
- sleep(900, 1200);
- return 0;
- }
- }
- else if (!Hound.isOnScreen()) {
- status = "Walking To " + Hound.getName();
- for (int i = 0; i < 13 && !players.getMyPlayer().isMoving(); i++) {
- walking.walkTileMM(Hound.getLocation());
- sleep(100);
- }
- for (int i = 0; i < 13 && !Hound.isOnScreen(); i++) {
- sleep(50);
- }
- }
- }
- }
- catch (NullPointerException exception) {
- }
- return random(500, 800);
- }
- public boolean interact(String action, RSNPC x) {
- mouse.move(x.getModel().getPoint());
- if (menu.contains(x.getName()) && !menu.contains(action))
- return false;
- else if (menu.isOpen() && !menu.contains(action))
- mouse.moveRandomly(1000);
- return menu.contains(action) && menu.doAction(action);
- }
- public boolean interact(String action, RSObject x) {
- mouse.move(x.getModel().getPoint());
- if (menu.contains(x.getName()) && !menu.contains(action))
- return false;
- else if (menu.isOpen() && !menu.contains(action))
- mouse.moveRandomly(1000);
- return menu.contains(action) && menu.doAction(action);
- }
- public void highlightTile(final Graphics g, final RSTile t, final Color outline, final Color fill, final String name) {
- final Point pn = calc.tileToScreen(new RSTile(t.getX(), t.getY()), 0, 0, 0);
- final Point px = calc.tileToScreen(new RSTile(t.getX() + 1, t.getY()), 0, 0, 0);
- final Point py = calc.tileToScreen(new RSTile(t.getX(), t.getY() + 1), 0, 0, 0);
- final Point pxy = calc.tileToScreen(new RSTile(t.getX() + 1, t.getY() + 1), 0, 0, 0);
- if (py.x == -1 || pxy.x == -1 || px.x == -1 || pn.x == -1) {
- return;
- }
- g.setColor(outline);
- g.drawPolygon(new int[]{py.x, pxy.x, px.x, pn.x}, new int[]{py.y, pxy.y, px.y, pn.y}, 4);
- g.setColor(fill);
- g.fillPolygon(new int[]{py.x, pxy.x, px.x, pn.x}, new int[]{py.y, pxy.y, px.y, pn.y}, 4);
- g.setColor(new Color(0, 0, 0));
- g.drawString(name, px.x - 5, py.y);
- g.setColor(new Color(255, 255, 255));
- g.drawString(name, px.x - 5 - 1, py.y - 1);
- }
- public void highlightMap(final Graphics g, final RSTile t, final Color outline, final Color fill) {
- g.setColor(fill);
- g.fillRoundRect(calc.tileToMinimap(t).x - 3, calc.tileToMinimap(t).y - 3, 5, 5, 5, 5);
- g.setColor(outline);
- g.drawRoundRect(calc.tileToMinimap(t).x - 3, calc.tileToMinimap(t).y - 3, 5, 5, 5, 5);
- }
- @SuppressWarnings("serial")
- private class MousePathPoint extends Point {
- private long finishTime;
- @SuppressWarnings("unused")
- private double lastingTime;
- public MousePathPoint(int x, int y, int lastingTime) {
- super(x, y);
- this.lastingTime = lastingTime;
- finishTime = System.currentTimeMillis() + lastingTime - 1500;
- }
- public boolean isUp() {
- return System.currentTimeMillis() > finishTime;
- }
- }
- private void drawMouse(Graphics g) {
- ((Graphics2D) g).setRenderingHints(new RenderingHints(
- RenderingHints.KEY_ANTIALIASING,
- RenderingHints.VALUE_ANTIALIAS_ON));
- Point p = mouse.getLocation();
- Graphics2D spinG = (Graphics2D) g.create();
- Graphics2D spinGRev = (Graphics2D) g.create();
- spinG.setColor(MOUSE_BORDER_COLOR);
- spinGRev.setColor(MOUSE_COLOR);
- spinG.rotate(System.currentTimeMillis() % 2000d / 2000d * (360d) * 2
- * Math.PI / 180.0, p.x, p.y);
- spinGRev.rotate(System.currentTimeMillis() % 2000d / 2000d * (-360d)
- * 2 * Math.PI / 180.0, p.x, p.y);
- final int outerSize = 20;
- final int innerSize = 12;
- spinG.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_ROUND,
- BasicStroke.JOIN_ROUND));
- spinGRev.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_ROUND,
- BasicStroke.JOIN_ROUND));
- spinG.drawArc(p.x - (outerSize / 2), p.y - (outerSize / 2), outerSize,
- outerSize, 100, 75);
- spinG.drawArc(p.x - (outerSize / 2), p.y - (outerSize / 2), outerSize,
- outerSize, -100, 75);
- spinGRev.drawArc(p.x - (innerSize / 2), p.y - (innerSize / 2),
- innerSize, innerSize, 100, 75);
- spinGRev.drawArc(p.x - (innerSize / 2), p.y - (innerSize / 2),
- innerSize, innerSize, -100, 75);
- }
- private static final Color MOUSE_COLOR = Color.CYAN,
- MOUSE_BORDER_COLOR = new Color(255, 255, 255);
- public void getSkillData() {
- for (int counter = 0; counter <= 24; counter++) {
- SKILLS_ARRAY[counter] = skills.getCurrentExp(counter);
- }
- }
- @Override
- public void mouseClicked(MouseEvent e) {
- p = e.getPoint();
- if(close.contains(p) && !hide){
- hide = true;
- }
- else if(close.contains(p) && hide){
- hide = false;
- }
- }
- @Override
- public void mouseEntered(MouseEvent arg0) {
- }
- @Override
- public void mouseExited(MouseEvent arg0) {
- }
- @Override
- public void mousePressed(MouseEvent e) {
- }
- @Override
- public void mouseReleased(MouseEvent arg0) {
- }
- @Override
- public void messageReceived(MessageEvent m) {
- }
- public enum EsslingToUse {
- Airessling("Air essling", 15403),
- Mindessling("Mind essling", 15404),
- Wateressling("Water essling", 15405),
- Earthessling("Earth essling", 15406),
- Fireessling("Fire essling", 15407);
- public String name;
- public int itemId;
- EsslingToUse(String name, int itemId) {
- this.name = name;
- this.itemId = itemId;
- }
- public String getName() {
- return name;
- }
- public int getId() {
- return itemId;
- }
- }
- public enum HoundToUse {
- Bodyesshound("Body esshound", 15408),
- Cosmicesshound("Cosmic esshound", 15409),
- Chaosesshound("Chaos esshound", 15410),
- Astralesshound("Astral esshound", 15411),
- Natureesshound("Nature esshound", 15412),
- Lawesshound("Law esshound", 15413);
- public String name;
- public int itemId;
- HoundToUse(String name, int itemId) {
- this.name = name;
- this.itemId = itemId;
- }
- public String getName() {
- return name;
- }
- public int getId() {
- return itemId;
- }
- }
- public enum EssWraithToUse {
- Deathesswraith("Death esswraith", 15414),
- Soulesswraith("Soul esswraith", 15416),
- Bloodesswraith("Blood esswraith", 15415);
- public String name;
- public int itemId;
- EssWraithToUse(String name, int itemId) {
- this.name = name;
- this.itemId = itemId;
- }
- public String getName() {
- return name;
- }
- public int getId() {
- return itemId;
- }
- }
- public enum NodeToUse {
- Cyclone("Cyclone", 70455),
- Mindstorm("Mind storm", 70456),
- Waterpool("Water pool", 70457),
- Rockfragment("Rock fragment", 70458),
- Vine("Vine", 70459),
- Fireball("Fireball", 70460),
- Fleshygrowth("Fleshy growth", 70461),
- Firestorm("Fire storm", 70462),
- Chaoticcloud("Chaotic cloud", 70463),
- Nebula("Nebula", 70464),
- Shifter("Shifter", 70465),
- Jumper("Jumper", 70466),
- Skulls("Skulls", 70467),
- Bloodpool("Blood pool", 70468),
- Bloodyskulls("Bloody skulls", 70469),
- Livingsoul("Living soul", 70470),
- Undeadsoul("Undead soul", 70471);
- public String name;
- public int itemId;
- NodeToUse(String name, int itemId) {
- this.name = name;
- this.itemId = itemId;
- }
- public String getName() {
- return name;
- }
- public int getId() {
- return itemId;
- }
- }
- @SuppressWarnings("serial")
- public class RuneSpanMagicianGUI extends JFrame {
- public RuneSpanMagicianGUI() {
- initComponents();
- }
- public void EsslingCheck(){
- if (checkBox1.isSelected()) {
- label1.setEnabled(true);
- comboBox1.setEnabled(true);
- } else {
- label1.setEnabled(false);
- comboBox1.setEnabled(false);
- }
- }
- public void HoundCheck(){
- if (checkBox2.isSelected()) {
- label2.setEnabled(true);
- comboBox2.setEnabled(true);
- } else {
- label2.setEnabled(false);
- comboBox2.setEnabled(false);
- }
- }
- public void EsswraithCheck(){
- if (checkBox3.isSelected()) {
- label3.setEnabled(true);
- comboBox3.setEnabled(true);
- } else {
- label3.setEnabled(false);
- comboBox3.setEnabled(false);
- }
- }
- public void NodeCheck(){
- if (checkBox4.isSelected()) {
- label4.setEnabled(true);
- comboBox4.setEnabled(true);
- } else {
- label4.setEnabled(false);
- comboBox4.setEnabled(false);
- }
- }
- private void EsslingCheckStateChanged(ChangeEvent e) {
- EsslingCheck();
- }
- private void HoundCheckStateChanged(ChangeEvent e) {
- HoundCheck();
- }
- private void EsswraithCheckStateChanged(ChangeEvent e) {
- EsswraithCheck();
- }
- private void NodeCheckStateChanged(ChangeEvent e) {
- NodeCheck();
- }
- private void button1ActionPerformed(ActionEvent e) {
- if (checkBox1.isSelected()) {
- DoEssling = true;
- }
- if (checkBox2.isSelected()) {
- DoHound = true;
- }
- if (checkBox3.isSelected()) {
- DoEssWraith = true;
- }
- if (checkBox4.isSelected()) {
- DoNode = true;
- }
- for (EsslingToUse Objects : EsslingToUse.values()){
- if(comboBox1.getSelectedItem().toString().equals(Objects.getName())){
- RuneSpan.Essling = Objects.getId();
- dispose();
- }
- }
- for (HoundToUse Objects : HoundToUse.values()){
- if(comboBox2.getSelectedItem().toString().equals(Objects.getName())){
- RuneSpan.Hound = Objects.getId();
- dispose();
- }
- }
- for (EssWraithToUse Objects : EssWraithToUse.values()){
- if(comboBox3.getSelectedItem().toString().equals(Objects.getName())){
- RuneSpan.EssWraith = Objects.getId();
- dispose();
- }
- }
- for (NodeToUse Objects : NodeToUse.values()){
- if(comboBox4.getSelectedItem().toString().equals(Objects.getName())){
- RuneSpan.Node = Objects.getId();
- dispose();
- }
- }
- }
- private void initComponents() {
- // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
- // Generated using JFormDesigner Evaluation license - Jarno De Lacy
- button1 = new JButton();
- label2 = new JLabel();
- comboBox2 = new JComboBox();
- checkBox2 = new JCheckBox();
- checkBox1 = new JCheckBox();
- label1 = new JLabel();
- comboBox1 = new JComboBox();
- checkBox3 = new JCheckBox();
- label3 = new JLabel();
- comboBox3 = new JComboBox();
- checkBox4 = new JCheckBox();
- label4 = new JLabel();
- comboBox4 = new JComboBox();
- panel1 = new JPanel();
- //======== this ========
- setTitle("RuneSpan Magician");
- Container contentPane = getContentPane();
- //---- button1 ----
- button1.setText("Start");
- button1.setFont(new Font("Lithos Pro", Font.BOLD, 16));
- button1.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- button1ActionPerformed(e);
- }
- });
- //---- label2 ----
- label2.setText("Hound:");
- label2.setFont(new Font("Lithos Pro", Font.BOLD, 13));
- label2.setEnabled(false);
- //---- comboBox2 ----
- comboBox2.setModel(new DefaultComboBoxModel(new String[] {
- "Body esshound",
- "Cosmic esshound",
- "Chaos esshound",
- "Astral esshound",
- "Nature esshound",
- "Law esshound"
- }));
- comboBox2.setEnabled(false);
- //---- label1 ----
- label1.setText("essling");
- label1.setFont(new Font("Lithos Pro", Font.BOLD, 13));
- label1.setEnabled(false);
- //---- comboBox1 ----
- comboBox1.setModel(new DefaultComboBoxModel(new String[] {
- "Air essling",
- "Mind essling",
- "Water essling",
- "Earth essling",
- "Fire essling"
- }));
- comboBox1.setEnabled(false);
- //---- label3 ----
- label3.setText("esswraith:");
- label3.setFont(new Font("Lithos Pro", Font.BOLD, 13));
- label3.setEnabled(false);
- //---- comboBox3 ----
- comboBox3.setModel(new DefaultComboBoxModel(new String[] {
- "Death esswraith",
- "Blood esswraith",
- "Soul esswraith"
- }));
- comboBox3.setEnabled(false);
- //---- label4 ----
- label4.setText("Node:");
- label4.setFont(new Font("Lithos Pro", Font.BOLD, 13));
- label4.setEnabled(false);
- //---- comboBox4 ----
- comboBox4.setModel(new DefaultComboBoxModel(new String[] {
- "Cyclone",
- "Mind storm",
- "Water pool",
- "Rock fragment",
- "Vine",
- "Fireball",
- "Fleshy growth",
- "Fire storm",
- "Chaotic cloud",
- "Nebula",
- "Shifter",
- "Jumper",
- "Skulls",
- "Blood pool",
- "Bloody skulls",
- "Living soul",
- "Undead soul"
- }));
- comboBox4.setEnabled(false);
- checkBox1.addChangeListener(new ChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- EsslingCheckStateChanged(e);
- }
- });
- checkBox2.addChangeListener(new ChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- HoundCheckStateChanged(e);
- }
- });
- checkBox3.addChangeListener(new ChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- EsswraithCheckStateChanged(e);
- }
- });
- checkBox4.addChangeListener(new ChangeListener() {
- @Override
- public void stateChanged(ChangeEvent e) {
- NodeCheckStateChanged(e);
- }
- });
- GroupLayout contentPaneLayout = new GroupLayout(contentPane);
- contentPane.setLayout(contentPaneLayout);
- contentPaneLayout.setHorizontalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGroup(contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addComponent(checkBox2)
- .addGap(18, 18, 18)
- .addComponent(label2))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addComponent(checkBox1)
- .addGap(18, 18, 18)
- .addComponent(label1))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addComponent(checkBox3)
- .addGap(18, 18, 18)
- .addComponent(label3))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addComponent(checkBox4)
- .addGap(18, 18, 18)
- .addComponent(label4)))
- .addGap(18, 18, 18)
- .addGroup(contentPaneLayout.createParallelGroup()
- .addComponent(comboBox4, GroupLayout.PREFERRED_SIZE, 157, GroupLayout.PREFERRED_SIZE)
- .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
- .addComponent(comboBox2, 0, 157, Short.MAX_VALUE)
- .addComponent(comboBox3, 0, 157, Short.MAX_VALUE)
- .addComponent(comboBox1, 0, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
- .addComponent(button1, GroupLayout.DEFAULT_SIZE, 306, Short.MAX_VALUE))
- .addContainerGap())
- );
- contentPaneLayout.setVerticalGroup(
- contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(14, 14, 14)
- .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.TRAILING)
- .addComponent(checkBox1)
- .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(label1)
- .addComponent(comboBox1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
- .addGap(18, 18, 18)
- .addGroup(contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(comboBox2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addComponent(label2))
- .addComponent(checkBox2))
- .addGap(18, 18, 18)
- .addGroup(contentPaneLayout.createParallelGroup()
- .addComponent(checkBox3)
- .addGroup(contentPaneLayout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(label3)
- .addComponent(comboBox3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
- .addGroup(contentPaneLayout.createParallelGroup()
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(14, 14, 14)
- .addComponent(checkBox4))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addGap(18, 18, 18)
- .addComponent(label4))
- .addGroup(contentPaneLayout.createSequentialGroup()
- .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(comboBox4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)))
- .addGap(18, 18, 18)
- .addComponent(button1)
- .addGap(39, 39, 39))
- );
- pack();
- setLocationRelativeTo(getOwner());
- //======== panel1 ========
- {
- GroupLayout panel1Layout = new GroupLayout(panel1);
- panel1.setLayout(panel1Layout);
- panel1Layout.setHorizontalGroup(
- panel1Layout.createParallelGroup()
- .addGap(0, 310, Short.MAX_VALUE)
- );
- panel1Layout.setVerticalGroup(
- panel1Layout.createParallelGroup()
- .addGap(0, 220, Short.MAX_VALUE)
- );
- }
- // JFormDesigner - End of component initialization //GEN-END:initComponents
- }
- // JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
- // Generated using JFormDesigner Evaluation license - Jarno De Lacy
- private JButton button1;
- private JLabel label2;
- private JComboBox comboBox2;
- private JCheckBox checkBox2;
- private JCheckBox checkBox1;
- private JLabel label1;
- private JComboBox comboBox1;
- private JCheckBox checkBox3;
- private JLabel label3;
- private JComboBox comboBox3;
- private JCheckBox checkBox4;
- private JLabel label4;
- private JComboBox comboBox4;
- private JPanel panel1;
- // JFormDesigner - End of variables declaration //GEN-END:variables
- }
- @Override
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- int counter = 0;
- int visible = 0;
- for (int i : SKILLS_ARRAY) {
- if (skills.getCurrentExp(counter) > i) {
- int XP_CHANGE = (skills.getCurrentExp(counter) - i);
- int percent = skills.getPercentToNextLevel(counter);
- int length = (percent * 505) / 100;
- int r = skills.getRealLevel(counter);
- if (skills.getRealLevel(counter) >= 99) {
- r = 99;
- length = (100 * 505) / 100;
- }
- g.setColor(color4);
- g.fillRect(7, (320 + visible * 18), length, 16);
- g.setColor(color5);
- g.fillRect(7, (320 + visible * 18), length, 16);
- g.setColor(color6);
- g.setStroke(stroke1);
- g.drawRect(7, (320 + visible * 18), 505, 16);
- g.setFont(font2);
- g.setColor(color7);
- g.drawString("[" + Skills.getSkillName(counter).replaceFirst(Skills.getSkillName(counter).substring(0, 1), Skills.getSkillName(counter).substring(0, 1).toUpperCase()) + "] [ " + r + " ] | " + "XP: " + XP_CHANGE / 1000 + "k | " + "XP/Hour: " + (int) (XP_CHANGE * 3600000D / 1000 / (System.currentTimeMillis() - startTime)) + "k " + "|", 11, (332 + visible * 18));
- visible++;
- }
- counter++;
- }
- if (!hide) {
- PointsHour = (int) ((3600000.0 / (double) (System.currentTimeMillis() - startTime)) * GainedPoints);
- 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;
- GainedPoints = Points - InitPoints;
- g.setColor(color1);
- g.fillRect(7, 345, 505, 128);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(7, 345, 505, 128);
- g.setColor(color3);
- g.fillRect(9, 461, 500, 8);
- g.setColor(color2);
- g.setStroke(stroke2);
- g.drawRect(9, 461, 500, 8);
- g.setFont(font1);
- g.setColor(color7);
- g.drawImage(img1, 1, 312, null);
- g.setColor(color8);
- g.setFont(font10);
- g.drawString(status, 50, 395);
- g.drawString(hours + " : " + minutes + " : " + seconds, 50, 425);
- g.drawString("Points: " + Points + " +" + GainedPoints +" (P/h: " + PointsHour + ")", 50, 455);
- }
- if(hide){
- g.drawImage(img2, 494, 344, null);
- }
- while (!mousePath.isEmpty() && mousePath.peek().isUp())
- mousePath.remove();
- Point clientCursor = mouse.getLocation();
- MousePathPoint mpp = new MousePathPoint(clientCursor.x,clientCursor.y, 3000);
- if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp))
- mousePath.add(mpp);
- MousePathPoint lastPoint = null;
- for (MousePathPoint a : mousePath) {
- if (lastPoint != null) {
- int Ran = random(1, 70);
- if (Ran >= 1 && Ran <= 10) {
- g.setColor(Color.RED);
- }
- else if (Ran > 10 && Ran <= 20) {
- g.setColor(Color.ORANGE);
- }
- else if (Ran > 20 && Ran <= 30) {
- g.setColor(Color.YELLOW);
- }
- else if (Ran > 30 && Ran <= 40) {
- g.setColor(Color.GREEN);
- }
- else if (Ran > 50 && Ran <= 60) {
- g.setColor(Color.BLUE);
- }
- else if (Ran > 60 && Ran <= 70) {
- g.setColor(Color.MAGENTA);
- }
- g.drawLine(a.x, a.y, lastPoint.x, lastPoint.y);
- }
- lastPoint = a;
- }
- g.setColor(color1);
- drawMouse(g);
- final RSNPC Essling = InfoEsslingCurrent();
- final RSNPC Hound = InfoHoundCurrent();
- final RSNPC EssWraith = InfoEssWraithCurrent();
- if (Essling != null && DoEssling == true) {
- RSTile RevTile = Essling.getLocation();
- highlightTile(g, RevTile, Color.green, new Color(0, 0, 0, 125), Essling.getName());
- highlightMap(g, RevTile, Color.green, new Color(0, 0, 0, 125));
- }
- if (Hound != null && DoHound == true) {
- RSTile RevTile = Hound.getLocation();
- highlightTile(g, RevTile, Color.green, new Color(0, 0, 0, 125), Hound.getName());
- highlightMap(g, RevTile, Color.green, new Color(0, 0, 0, 125));
- }
- if (EssWraith != null && DoEssWraith == true) {
- RSTile RevTile = EssWraith.getLocation();
- highlightTile(g, RevTile, Color.green, new Color(0, 0, 0, 125), EssWraith.getName());
- highlightMap(g, RevTile, Color.green, new Color(0, 0, 0, 125));
- }
- }