Don't like ads? PRO users don't see any ads ;-)
Guest

Old's Runespan

By: Oldrs4ever on May 1st, 2012  |  syntax: None  |  size: 5.47 KB  |  hits: 393  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. import java.awt.Color;
  2. import java.awt.Font;
  3. import java.awt.Graphics;
  4. import java.awt.Graphics2D;
  5.  
  6. import com.rarebot.event.events.MessageEvent;
  7. import com.rarebot.event.listeners.MessageListener;
  8. import com.rarebot.event.listeners.PaintListener;
  9. import com.rarebot.script.Script;
  10. import com.rarebot.script.ScriptManifest;
  11. import com.rarebot.script.methods.Skills;
  12. import com.rarebot.script.wrappers.RSNPC;
  13. import com.rarebot.script.wrappers.RSObject;
  14. import com.rarebot.script.wrappers.RSPlayer;
  15.  
  16.  
  17. @ScriptManifest(name = "OldsRuneSpan", version = 0.2, description = "Does RuneSpan for Runecrafting xp", authors = "Oldrs4ever")
  18. public class OldsRuneSpan extends Script implements PaintListener , MessageListener
  19. {
  20.         int xpTNL;
  21.         int rcLevel;
  22.         int levelGained;
  23.         public long startTime = 0;  
  24.         public long millis = 0;  
  25.         public long hours = 0;  
  26.         public long minutes = 0;  
  27.         public long seconds = 0;  
  28.         public long last = 0;
  29.         public int expGained = 0;
  30.         public int expHour = 0;
  31.         int startExp;
  32.          
  33.          /*
  34.          Nodes:
  35.          
  36.          Cyclone = 70455; Level 1
  37.          Mind Storm = 70456; Level 1
  38.          Water Pool = 70457; Level 5
  39.          Rock Fragment = 70458; Level 9
  40.          Fireball = 70459; Level 14
  41.          Vine = 70460; Level 17
  42.          Fleshy Growth = 70461; Level 20
  43.          Fire Storm = 70462; Level 27
  44.          Chaotic Cloud = 70463; Level 35
  45.          Nebula = 70464; Level 40
  46.          Shifter = 70465; Level 44
  47.      Jumper = 70466; Level 54
  48.          Skulls = 70467; Level 66
  49.      Blood Pool = 70468; Level 77
  50.      Bloody Skulls = 70469; Level 83
  51.          Living Soul = 70470; Level 90
  52.          Undead Soul = 70471; Level 95
  53.          */
  54.        
  55.          /*
  56.          Creatures:
  57.          
  58.          Air Essling = 15403; Level 1
  59.          Mind Essling = 15404; Level 1
  60.          Water Essling = 15405; Level 5
  61.          Earth Essling = 15406; Level 9
  62.          Fire Essling = 15407; Level 14
  63.          Body EssHound = 15408; Level 20
  64.          Cosmic EssHound = 15409; Level 27
  65.          Chaos EssHound = 15410; Level 35
  66.          Astral EssHound = 15411; Level 40
  67.          Nature EssHound = 15412; Level 44
  68.          Law EssHound = 15413; Level 54
  69.          Death EssWraith = 15414; Level 66
  70.          Blood EssWraith = 15415; Level 77
  71.          Soul EssWraith = 15416; Level 90
  72.          */
  73.        
  74.          /*
  75.          Runes
  76.          
  77.          Air Rune = 24215;
  78.          Mind Rune = 24217;
  79.          Water Rune = 24214;
  80.          Earth Rune = 24216;
  81.          Fire Rune = 24213;
  82.          Body Rune = 24218;
  83.          Cosmic Rune = 24223;
  84.          Chaos Rune = 24221;
  85.          Astral Rune = 24224;
  86.          Nature Rune = 24220;
  87.          Law Rune = 24222;
  88.          Death Rune = 24219;
  89.          Blood Rune = 24225;
  90.          Soul Rune = X;
  91.          Mage = 15434
  92.           */
  93.        
  94.        
  95.         public final int[] nodeArray = {70469, 70468, 70467, 70466, 70465, 70464};
  96.         public final int[] creatureArray = {15415};
  97.         public final int payRune = 1;
  98.        
  99.        
  100.         boolean click = true;
  101.  
  102.  
  103.  
  104.         @Override
  105.         public int loop()
  106.         {
  107.                 try{
  108.                         RSObject nodes = objects.getNearest(nodeArray);
  109.                         RSPlayer player = players.getMyPlayer();
  110.                         RSNPC creatures = npcs.getNearest(creatureArray);
  111.  
  112.                         if(player.getAnimation() == -1)
  113.                         {
  114.                                 if(!(inventory.contains(24227)))
  115.                                 {
  116.                                         RSNPC essence = npcs.getNearest(15402);
  117.                                         essence.interact("Collect");
  118.                                         sleep(2500);   
  119.                                 }
  120.                                 else
  121.                                 {
  122.                                 if(nodes != null && nodes.isOnScreen())
  123.                                 {
  124.                                         nodes.interact("Siphon");
  125.                                         sleep(random(1500,2000));
  126.                                        
  127.                                 }
  128.                                         else if(creatures.isOnScreen())
  129.                                         {
  130.                                                 creatures.interact("Siphon");
  131.                                                 sleep(random(1500,2000));      
  132.                                         }
  133.                                        
  134.                                 }
  135.                         }
  136.  
  137.                 }catch(Exception ex)
  138.                 {
  139.                 }
  140.                 return 0;
  141.         }
  142.        
  143.         public boolean onStart()
  144.         {
  145.                 log(new Color(125,38,205), "Welcome to OldsRuneSpan by Oldrs4ever!");
  146.         startTime = System.currentTimeMillis();
  147.         mouse.setSpeed(random(4, 6));
  148.         startExp = skills.getCurrentExp(Skills.RUNECRAFTING);
  149.         rcLevel = skills.getCurrentLevel(Skills.RUNECRAFTING);
  150.         return true;
  151.     }
  152.  
  153.  
  154.  
  155.         @Override
  156.         public void messageReceived(MessageEvent arg0) {
  157.                 if(arg0.getMessage().contains("The node you were siphon"))
  158.                 {
  159.                         click = true;
  160.                         log(click);
  161.                 }
  162.  
  163.         }
  164.  
  165.     //START: Code generated using Enfilade's Easel
  166.     private final Color color1 = new Color(0, 0, 0, 216);
  167.     private final Color color2 = new Color(255, 246, 0, 214);
  168.     private final Color color3 = new Color(255, 230, 0, 214);
  169.  
  170.     private final Font font1 = new Font("Verdana", 0, 14);
  171.     private final Font font2 = new Font("Verdana", 0, 9);
  172.  
  173.     public void onRepaint(Graphics g1) {
  174.         Graphics2D g = (Graphics2D)g1;
  175.        
  176.         xpTNL = skills.getExpToNextLevel(Skills.RUNECRAFTING);
  177.         millis = System.currentTimeMillis() - startTime;
  178.         hours = millis / (1000 * 60 * 60);
  179.         millis -= hours * (1000 * 60 * 60);
  180.         minutes = millis / (1000 * 60);
  181.         millis -= minutes * (1000 * 60);
  182.         seconds = millis / 1000;
  183.         expGained = skills.getCurrentExp(Skills.RUNECRAFTING) - startExp;
  184.         expHour = (int) ((expGained) * 3600000D / (System.currentTimeMillis() - startTime));
  185.         rcLevel = skills.getCurrentLevel(Skills.RUNECRAFTING);
  186.        
  187.         g.setColor(color1);
  188.         g.fillRoundRect(359, 212, 159, 126, 16, 16);
  189.         g.setFont(font1);
  190.         g.setColor(color2);
  191.         g.drawString("OldsRuneSpan", 362, 231);
  192.         g.setFont(font2);
  193.         g.setColor(color3);
  194.         g.drawString("XP Gained:" + expGained, 360, 264);
  195.         g.drawString("Time Running:" + hours +":"+ minutes + ":" + seconds, 360, 244);
  196.         g.drawString("XP Per Hour:" + expHour, 360, 284);
  197.         g.drawString("Runecrafting Level:" + rcLevel, 360, 303);
  198.         g.drawString("XP to Next Level:" + xpTNL, 360, 323);
  199.     }
  200.     //END: Code generated using Enfilade's Easel
  201. }