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

rawrcoal.java

By: a guest on Jun 2nd, 2012  |  syntax: None  |  size: 3.30 KB  |  hits: 11  |  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. //imports
  2.  
  3. import java.awt.Color;
  4. import java.awt.Font;
  5. import java.awt.Graphics;
  6. import java.awt.Graphics2D;
  7. import java.awt.Image;
  8. import java.awt.Rectangle;
  9. import java.awt.Point;
  10. import java.awt.BasicStroke;
  11. import java.awt.Stroke;
  12. import java.io.IOException;
  13. import java.net.URL;
  14. import java.awt.image.BufferedImage;
  15. import java.net.MalformedURLException;
  16. import java.awt.*;
  17.  
  18.  
  19.  
  20. import javax.imageio.ImageIO;
  21.  
  22. import org.omg.PortableServer.Current;
  23.  
  24. import java.awt.event.ActionEvent;
  25. import java.awt.event.ActionListener;
  26. import java.awt.event.MouseEvent;
  27. import java.awt.event.MouseListener;
  28. import com.rarebot.event.events.MessageEvent;
  29. import com.rarebot.event.listeners.MessageListener;
  30. import com.rarebot.event.listeners.PaintListener;
  31. import com.rarebot.script.Script;
  32. import com.rarebot.script.ScriptManifest;
  33. import com.rarebot.script.wrappers.RSObject;
  34. import com.rarebot.script.wrappers.RSTile;
  35. import com.rarebot.script.wrappers.RSTilePath;
  36. import com.rarebot.script.wrappers.RSComponent;
  37. import com.rarebot.script.wrappers.RSInterface;
  38. import com.rarebot.script.methods.Skills;
  39. import com.rarebot.script.methods.Walking;
  40. import com.rarebot.script.wrappers.RSArea;
  41. import com.rarebot.script.wrappers.RSTile;
  42.  
  43. //Manifest
  44. @ScriptManifest (authors = { "Rawr" }, name = "RawrCoal", description = "Mines and banks coal")
  45.  
  46. public class RawrCoal extends Script implements PaintListener, MouseListener {
  47.  
  48. private int [] ROCK_ID = {}; //Rock ID's here separated by commas of course :D
  49.  
  50.         private int [] PICK_ID = {1265, 1267, 1269, 1271, 1273, 1275,
  51.                         14099, 14107, 15259, 15261, 15532};   //Pickaxe ID's are put here (You only need
  52. //Pickaxe ID's if you are powermining.
  53.  
  54. private final static int [] DEPOSIT_BOXES = [25937];
  55. public boolean onStart () {
  56.  
  57.                 log ("Welcome to RawrCoal :)"); //This message shows in the panel at the bottom of bot.
  58.  
  59.                 return true;} //This has to be true or script don't start.
  60.  
  61.  
  62.                 private void mineRocks () {
  63.                 RSObject rock = objects.getNearest(ROCK_ID); //You don't have to put in all the rock id's, //because you've already got them at the top. This statement is also saying that the rock is an object
  64.                 if (rock !=null) { //Null check or get null errors
  65.                     rock.interact("Mine");
  66.                 }else{ camera.turnTo(rock);
  67.  
  68.  
  69. @Override
  70. public int loop() { //The loop is where the method actually plays
  71.  
  72.         if (!inventory.isFull() && getMyPlayer().getAnimation() == -1) { //This makes sure inv aint full
  73.        
  74.         minerocks();
  75.        
  76. {
  77.  
  78.     //START: Code generated using Enfilade's Easel
  79.     private final Color color1 = new Color(255, 255, 255);
  80.     private final Color color2 = new Color(0, 0, 0);
  81.  
  82.     private final BasicStroke stroke1 = new BasicStroke(1);
  83.  
  84.     private final Font font1 = new Font("Arial", 0, 20);
  85.  
  86.     public void onRepaint(Graphics g1) {
  87.         Graphics2D g = (Graphics2D)g1;
  88.         g.setColor(color1);
  89.         g.fillRoundRect(7, 345, 488, 111, 16, 16);
  90.         g.setColor(color2);
  91.         g.setStroke(stroke1);
  92.         g.drawRoundRect(7, 345, 488, 111, 16, 16);
  93.         g.setFont(font1);
  94.         g.drawString("EXP/HR :", 18, 369);
  95.         g.drawString("profit made :", 18, 390);
  96.         g.drawString("OresMined/HR :", 13, 416);
  97.         g.drawString("Script Status :", 230, 369);
  98.     }
  99.     //END: Code generated using Enfilade's Easel