- //imports
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Image;
- import java.awt.Rectangle;
- import java.awt.Point;
- import java.awt.BasicStroke;
- import java.awt.Stroke;
- import java.io.IOException;
- import java.net.URL;
- import java.awt.image.BufferedImage;
- import java.net.MalformedURLException;
- import java.awt.*;
- import javax.imageio.ImageIO;
- import org.omg.PortableServer.Current;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- 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.wrappers.RSObject;
- import com.rarebot.script.wrappers.RSTile;
- import com.rarebot.script.wrappers.RSTilePath;
- import com.rarebot.script.wrappers.RSComponent;
- import com.rarebot.script.wrappers.RSInterface;
- import com.rarebot.script.methods.Skills;
- import com.rarebot.script.methods.Walking;
- import com.rarebot.script.wrappers.RSArea;
- import com.rarebot.script.wrappers.RSTile;
- //Manifest
- @ScriptManifest (authors = { "Rawr" }, name = "RawrCoal", description = "Mines and banks coal")
- public class RawrCoal extends Script implements PaintListener, MouseListener {
- private int [] ROCK_ID = {}; //Rock ID's here separated by commas of course :D
- private int [] PICK_ID = {1265, 1267, 1269, 1271, 1273, 1275,
- 14099, 14107, 15259, 15261, 15532}; //Pickaxe ID's are put here (You only need
- //Pickaxe ID's if you are powermining.
- private final static int [] DEPOSIT_BOXES = [25937];
- public boolean onStart () {
- log ("Welcome to RawrCoal :)"); //This message shows in the panel at the bottom of bot.
- return true;} //This has to be true or script don't start.
- private void mineRocks () {
- 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
- if (rock !=null) { //Null check or get null errors
- rock.interact("Mine");
- }else{ camera.turnTo(rock);
- @Override
- public int loop() { //The loop is where the method actually plays
- if (!inventory.isFull() && getMyPlayer().getAnimation() == -1) { //This makes sure inv aint full
- minerocks();
- {
- //START: Code generated using Enfilade's Easel
- private final Color color1 = new Color(255, 255, 255);
- private final Color color2 = new Color(0, 0, 0);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("Arial", 0, 20);
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- g.setColor(color1);
- g.fillRoundRect(7, 345, 488, 111, 16, 16);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRoundRect(7, 345, 488, 111, 16, 16);
- g.setFont(font1);
- g.drawString("EXP/HR :", 18, 369);
- g.drawString("profit made :", 18, 390);
- g.drawString("OresMined/HR :", 13, 416);
- g.drawString("Script Status :", 230, 369);
- }
- //END: Code generated using Enfilade's Easel