- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- 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.Skills;
- import com.rarebot.script.wrappers.RSNPC;
- import com.rarebot.script.wrappers.RSObject;
- import com.rarebot.script.wrappers.RSPlayer;
- @ScriptManifest(name = "OldsRuneSpan", version = 0.2, description = "Does RuneSpan for Runecrafting xp", authors = "Oldrs4ever")
- public class OldsRuneSpan extends Script implements PaintListener , MessageListener
- {
- int xpTNL;
- int rcLevel;
- int levelGained;
- public long startTime = 0;
- public long millis = 0;
- public long hours = 0;
- public long minutes = 0;
- public long seconds = 0;
- public long last = 0;
- public int expGained = 0;
- public int expHour = 0;
- int startExp;
- /*
- Nodes:
- Cyclone = 70455; Level 1
- Mind Storm = 70456; Level 1
- Water Pool = 70457; Level 5
- Rock Fragment = 70458; Level 9
- Fireball = 70459; Level 14
- Vine = 70460; Level 17
- Fleshy Growth = 70461; Level 20
- Fire Storm = 70462; Level 27
- Chaotic Cloud = 70463; Level 35
- Nebula = 70464; Level 40
- Shifter = 70465; Level 44
- Jumper = 70466; Level 54
- Skulls = 70467; Level 66
- Blood Pool = 70468; Level 77
- Bloody Skulls = 70469; Level 83
- Living Soul = 70470; Level 90
- Undead Soul = 70471; Level 95
- */
- /*
- Creatures:
- Air Essling = 15403; Level 1
- Mind Essling = 15404; Level 1
- Water Essling = 15405; Level 5
- Earth Essling = 15406; Level 9
- Fire Essling = 15407; Level 14
- Body EssHound = 15408; Level 20
- Cosmic EssHound = 15409; Level 27
- Chaos EssHound = 15410; Level 35
- Astral EssHound = 15411; Level 40
- Nature EssHound = 15412; Level 44
- Law EssHound = 15413; Level 54
- Death EssWraith = 15414; Level 66
- Blood EssWraith = 15415; Level 77
- Soul EssWraith = 15416; Level 90
- */
- /*
- Runes
- Air Rune = 24215;
- Mind Rune = 24217;
- Water Rune = 24214;
- Earth Rune = 24216;
- Fire Rune = 24213;
- Body Rune = 24218;
- Cosmic Rune = 24223;
- Chaos Rune = 24221;
- Astral Rune = 24224;
- Nature Rune = 24220;
- Law Rune = 24222;
- Death Rune = 24219;
- Blood Rune = 24225;
- Soul Rune = X;
- Mage = 15434
- */
- public final int[] nodeArray = {70469, 70468, 70467, 70466, 70465, 70464};
- public final int[] creatureArray = {15415};
- public final int payRune = 1;
- boolean click = true;
- @Override
- public int loop()
- {
- try{
- RSObject nodes = objects.getNearest(nodeArray);
- RSPlayer player = players.getMyPlayer();
- RSNPC creatures = npcs.getNearest(creatureArray);
- if(player.getAnimation() == -1)
- {
- if(!(inventory.contains(24227)))
- {
- RSNPC essence = npcs.getNearest(15402);
- essence.interact("Collect");
- sleep(2500);
- }
- else
- {
- if(nodes != null && nodes.isOnScreen())
- {
- nodes.interact("Siphon");
- sleep(random(1500,2000));
- }
- else if(creatures.isOnScreen())
- {
- creatures.interact("Siphon");
- sleep(random(1500,2000));
- }
- }
- }
- }catch(Exception ex)
- {
- }
- return 0;
- }
- public boolean onStart()
- {
- log(new Color(125,38,205), "Welcome to OldsRuneSpan by Oldrs4ever!");
- startTime = System.currentTimeMillis();
- mouse.setSpeed(random(4, 6));
- startExp = skills.getCurrentExp(Skills.RUNECRAFTING);
- rcLevel = skills.getCurrentLevel(Skills.RUNECRAFTING);
- return true;
- }
- @Override
- public void messageReceived(MessageEvent arg0) {
- if(arg0.getMessage().contains("The node you were siphon"))
- {
- click = true;
- log(click);
- }
- }
- //START: Code generated using Enfilade's Easel
- private final Color color1 = new Color(0, 0, 0, 216);
- private final Color color2 = new Color(255, 246, 0, 214);
- private final Color color3 = new Color(255, 230, 0, 214);
- private final Font font1 = new Font("Verdana", 0, 14);
- private final Font font2 = new Font("Verdana", 0, 9);
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- xpTNL = skills.getExpToNextLevel(Skills.RUNECRAFTING);
- millis = System.currentTimeMillis() - startTime;
- hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- seconds = millis / 1000;
- expGained = skills.getCurrentExp(Skills.RUNECRAFTING) - startExp;
- expHour = (int) ((expGained) * 3600000D / (System.currentTimeMillis() - startTime));
- rcLevel = skills.getCurrentLevel(Skills.RUNECRAFTING);
- g.setColor(color1);
- g.fillRoundRect(359, 212, 159, 126, 16, 16);
- g.setFont(font1);
- g.setColor(color2);
- g.drawString("OldsRuneSpan", 362, 231);
- g.setFont(font2);
- g.setColor(color3);
- g.drawString("XP Gained:" + expGained, 360, 264);
- g.drawString("Time Running:" + hours +":"+ minutes + ":" + seconds, 360, 244);
- g.drawString("XP Per Hour:" + expHour, 360, 284);
- g.drawString("Runecrafting Level:" + rcLevel, 360, 303);
- g.drawString("XP to Next Level:" + xpTNL, 360, 323);
- }
- //END: Code generated using Enfilade's Easel
- }