Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.BasicStroke;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- import java.util.Map;
- import org.rsbot.event.events.MessageEvent;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.*;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.listeners.MessageListener;
- @ScriptManifest(name = "WonderIronPowerMine", authors = "ARandomEwokk", version = 1.0, description = "Meow")
- public class WonderIronPowerMine extends Script implements PaintListener, MessageListener {
- public long startTime1 = 0;
- public long millis1 = 0;
- public long hours1 = 0;
- public long minutes1 = 0;
- public long seconds1 = 0;
- private int percentTNL;
- public int currLevel;
- private int expGained;
- private int expHour;
- private int startExp;
- private int oresHour;
- private int oresMined;
- private int startLevel;
- public int expForOre = 150;
- public int oresTNL;
- private int itemPrice;
- private int profit;
- public void messageReceived1(MessageEvent e) {
- String x = e.getMessage().toLowerCase();
- if(x.contains("some ores")) {
- oresMined ++;
- }
- }
- public void onRepaint1(Graphics g1) {
- Graphics2D g = (Graphics2D)g1; }
- //START: Code generated using Enfilade's Easel
- private final Color color1 = new Color(0, 0, 0);
- private final Color color2 = new Color(255, 255, 0);
- private final Color color3 = new Color(255, 0, 0);
- private final Color color4 = new Color(0, 204, 204);
- private final Color color5 = new Color(0, 255, 0);
- private final Color color6 = new Color(102, 0, 102);
- private final Color color7 = new Color(51, 255, 0);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("Arial", 1, 14);
- private final Font font2 = new Font("Arial", 1, 9);
- private final Font font3 = new Font("Arial", 0, 9);
- private final Font font4 = new Font("Arial", 0, 14);
- private final Font font5 = new Font("Arial", 0, 11);
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- g.setColor(color1);
- g.fillRoundRect(7, 7, 504, 18, 16, 16);
- g.setColor(color2);
- g.fillOval(556, 15, 140, 139);
- g.setColor(color1);
- g.fillRect(7, 346, 489, 111);
- g.fillOval(588, 51, 25, 26);
- g.fillOval(634, 53, 26, 27);
- g.fillOval(599, 105, 50, 23);
- g.setFont(font1);
- g.setColor(color3);
- g.drawString("ARandomEwokk's WonderCook", 142, 21);
- g.setColor(color4);
- g.drawString("Have Fun!", 689, 153);
- g.setFont(font2);
- g.setColor(color5);
- g.drawString("Contact me at ARandomEwokk on powerbot.org for proggies and critiscism! ", 61, 451);
- g.setFont(font3);
- g.setColor(color4);
- g.drawString("version 1.0", 456, 20);
- g.setFont(font4);
- g.setColor(color3);
- g.drawString("Info:", 11, 362);
- g.setFont(font5);
- g.drawString("Levelz:", 11, 375);
- g.drawString("Experiencez:", 147, 376);
- g.drawString("Status:", 301, 382);
- g.drawString("Runtimez:", 410, 383);
- g.setFont(font2);
- g.setColor(color6);
- g.drawString("Start LVL:", 11, 390);
- g.drawString("Current LVL:", 11, 405);
- g.drawString("Objects TNL:", 11, 420);
- g.drawString("% TNL:", 12, 435);
- g.drawString("Starting EXP:", 139, 391);
- g.drawString("EXP per Object:", 139, 405);
- g.drawString("EXP Gained:", 139, 420);
- g.drawString("EXP per Hour:", 139, 433);
- g.drawString("Objects Gotten:", 285, 394);
- g.drawString("Object per Hour:", 285, 409);
- g.drawString("Time ran:", 410, 396);
- g.setColor(color3);
- g.fillRoundRect(65, 349, 427, 15, 16, 16);
- g.setColor(color1);
- g.setStroke(stroke1);
- g.drawRoundRect(65, 349, 427, 15, 16, 16);
- g.setColor(color7);
- g.fillRoundRect(65, 349, 157, 14, 16, 16);
- g.setColor(color1);
- g.drawRoundRect(65, 349, 157, 14, 16, 16);
- g.setColor(color6);
- g.drawString("Profit:", 286, 422);
- profit = itemPrice * oresMined;
- {
- 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;
- long secondsTNL = (skills.getExpToNextLevel(skills.MINING)) / (expHour / 3600);
- long hoursTNL = secondsTNL / (60 * 60);
- secondsTNL -= hoursTNL * (60 * 60);
- long minutesTNL = secondsTNL / 60;
- secondsTNL -= minutesTNL * 60;
- final int percentBar = (int) (skills.getPercentToNextLevel(skills.MINING)*4.2);
- expGained = skills.getCurrentExp(skills.MINING) - startExp;
- oresHour = (int) ((oresMined) * 3600000D / (System.currentTimeMillis() - startTime));
- expHour = (int) ((expGained) * 3600000D / (System.currentTimeMillis() - startTime));
- oresTNL = expToGetNextLevel(skills.MINING)/expForOre;
- currLevel = skills.getCurrentLevel(skills.MINING);
- int lvlsGained = currLevel - startLevel;
- percentTNL = skills.getPercentToNextLevel(skills.MINING);
- ///////////////////////////////////////////////////////////////////////////////////////////////////////
- ///////////////////////////////// PAINT ///////////////////////////////////////////////////////////////
- ///////////////////////////////////////////////////////////////////////////////////////////////////////
- }
- }
- private int expToGetNextLevel(int mining) {
- // TODO Auto-generated method stub
- return 0;
- }
- int[] ironRockID = {9717, 9718};
- int[] pickID = {1265, 1267, 1269, 1271, 1273,
- 1275};
- int bankBoothID = 11758;
- int ironOreID = 440;
- RSTile[] rimmingtonMineToBank = { new RSTile(2981, 3234), new RSTile(2983, 3242),
- new RSTile(2980, 3254), new RSTile(2986, 3265),
- new RSTile(2997, 3275), new RSTile(3002, 3289),
- new RSTile(3001, 3301), new RSTile(3005, 3312),
- new RSTile(3006, 3322), new RSTile(3007, 3336),
- new RSTile(3006, 3352), new RSTile(3012, 3355) };
- @SuppressWarnings({ "deprecation", "static-access" })
- public boolean onStart(){
- log("Hello");
- startLevel = skills.getCurrentLevel(skills.MINING);
- startExp = skills.getCurrentExp(skills.MINING);
- startTime1 = System.currentTimeMillis();
- itemPrice = grandExchange.loadItemInfo(654).getMarketPrice();
- return true;
- }
- public long startTime = 0;
- public long millis = 0;
- public long hours = 0;
- public long minutes = 0;
- public long seconds = 0;
- public long last = 0;
- private void mine(){
- RSObject iron = objects.getNearest(ironRockID);
- if (iron != null && (getMyPlayer().getAnimation() == -1))
- iron.doAction("Mine"); }
- //private void dropOre(){
- //inventory.dropAllExcept(pickID);
- //}
- @SuppressWarnings("deprecation")
- private boolean walkToBankFromRimmington() {
- @SuppressWarnings("deprecation")
- RSTile[] randomizedPath = walking.randomizePath(rimmingtonMineToBank, 2, 2);
- return walking.walkPathMM(randomizedPath, 15);
- }
- private boolean atMine(){
- RSArea area = new RSArea(new RSTile(2979, 3232), new RSTile(2984, 3235));
- return (area.contains(getMyPlayer().getLocation()));
- }
- private boolean atBank(){
- RSArea area = new RSArea(new RSTile(3009, 3355), new RSTile(3016, 3358));
- return area.contains(getMyPlayer().getLocation());
- }
- @SuppressWarnings("deprecation")
- private boolean walkToRimmingtonFromBank() {
- @SuppressWarnings("deprecation")
- RSTile[] reversedPath = walking.reversePath(rimmingtonMineToBank);
- @SuppressWarnings("deprecation")
- RSTile[] randomizedPath = walking.randomizePath(reversedPath,
- 2, 2);
- return walking.walkPathMM(randomizedPath);
- }
- private void openBank() {
- RSObject bankBooth = objects.getNearest(bankBoothID);
- if (bankBooth != null && !bank.isOpen()) {
- bankBooth.doAction("uickly"); }
- }
- private void depositIron() {
- if(bank.isOpen()){
- bank.deposit(ironOreID, 0);
- sleep(200, 500);
- mouse.click(true); }
- }
- private void closeBank() {
- if(bank.isOpen()){
- mouse.move(490, 36, 3, 3);
- mouse.click(true); }
- }
- private void bank() {
- openBank();
- depositIron();
- closeBank();
- }
- public void onFinish(){
- log("Cyaz");
- }
- @Override
- public int loop() {
- if (atMine() && inventory.isFull()) {
- walkToBankFromRimmington();
- } else if (atBank() && inventory.isFull()) {
- bank();
- } else if(atBank() && !inventory.isFull()) {
- walkToRimmingtonFromBank();
- } else if (atMine() && !inventory.isFull()) {
- mineOre();
- }
- return (random(650, 950));
- }
- private void mineOre() {
- // TODO Auto-generated method stub
- }
- @Override
- public void messageReceived(MessageEvent arg0) {
- // TODO Auto-generated method stub
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement