Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.script.*;
- import org.rsbot.script.Script;
- import org.rsbot.script.wrappers.*;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.events.MessageEvent;
- import org.rsbot.event.listeners.MessageListener;
- @ScriptManifest(authors = "Havefunpeeps", keywords = "", name = "Sheller", version = 1.00, description = "Makes Shells out of Dishes and Dough")
- public class Sheller extends Script implements PaintListener, MessageListener {
- int Pie = 2323;
- int Dough = 1953;
- int HalfPie = 2331;
- int Shell = 2315;
- int Dish = 2313;
- 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 int profit;
- private int profitHour;
- private int shellsMade;
- private int shellsHour;
- private int PiePrice;
- private int ShellPrice;
- private int DoughPrice;
- public boolean onStart(){
- mouse.setSpeed(random(8, 14));
- PiePrice = grandExchange.lookup(Pie).getGuidePrice();
- ShellPrice = grandExchange.lookup(Shell).getGuidePrice();
- DoughPrice = grandExchange.lookup(Dough).getGuidePrice();
- startTime = System.currentTimeMillis();
- return true;
- }
- public int loop() {
- if(inventory.getCount(Dish) == 14) {
- MakeShells();
- }
- if(inventory.getCount(Shell) == 14) {
- Bank();
- }
- if(inventory.contains(Shell) && inventory.contains(Dough)) {
- antiBan();
- }
- if(inventory.contains(Dough) && inventory.getCount() == 14) {
- FailSafe1();
- }
- if(!bank.isOpen() && inventory.getCount() == 0) {
- FailSafe2();
- }
- if(!bank.isOpen() && inventory.getCount(Dough) == 28) {
- FailSafe3();
- }
- if(!bank.isOpen() && inventory.contains(Dish) && inventory.getCount() == 14) {
- FailSafe4();
- }
- return(random(100, 200));
- }
- public void FailSafe4() {
- log("FailSafe4");
- bank.open();
- bank.depositAll();
- bank.withdraw(Dish, 14);
- bank.withdraw(Dough, 14);
- if(inventory.isFull() && inventory.getCount(Dish) == 14 && inventory.getCount(Dough) == 14) {
- log("Script Meltdown should have been averted");
- }
- bank.close();
- }
- public void FailSafe3() {
- log("FailSafe3");
- bank.open();
- bank.depositAll();
- bank.withdraw(Dish, 14);
- bank.withdraw(Dough, 14);
- if(inventory.isFull() && inventory.getCount(Dish) == 14 && inventory.getCount(Dough) == 14) {
- log("Script Meltdown should have been averted");
- }
- bank.close();
- }
- public void FailSafe2() {
- log("FailSafe2");
- bank.open();
- bank.withdraw(Dish, 14);
- bank.withdraw(Dough, 14);
- if(inventory.isFull() && inventory.getCount(Dish) == 14 && inventory.getCount(Dough) == 14) {
- log("Script Meltdown should have been averted");
- }
- bank.close();
- }
- public void FailSafe1() {
- log("FailSafe1");
- if(!bank.isOpen()) {
- bank.open();
- }
- bank.depositAll();
- bank.withdraw(Dish, 14);
- bank.withdraw(Dough, 14);
- if(inventory.isFull() && inventory.getCount(Dish) == 14 && inventory.getCount(Dough) == 14) {
- log("Script Meltdown should have been averted");
- }
- bank.close();
- }
- public void Bank() {
- bank.open();
- bank.depositAll();
- bank.withdraw(Dish, 14);
- bank.withdraw(Dough, 14);
- bank.close();
- }
- public void MakeShells() {
- RSItem DishA = inventory.getItem(Dish);
- RSItem DoughA = inventory.getItem(Dough);
- inventory.useItem(Dish, Dough);
- sleep(1000, 1500);
- if(interfaces.getComponent(905, 14).isValid()) {
- interfaces.getComponent(905, 14).doClick();
- sleep(random(600, 900));
- }
- }
- public void antiBanMouse() {
- int randomNum1 = random(1, 50);
- if (randomNum1 == 1 || randomNum1 == 2 || randomNum1 == 3) {
- mouse.moveSlightly();
- mouse.moveSlightly();
- }
- if (randomNum1 == 4 || randomNum1 == 5 || randomNum1 == 6) {
- mouse.move(random(175, 325), random(75, 225));
- }
- if (randomNum1 == 7) {
- mouse.moveRandomly(10, 150);
- }
- if (randomNum1 == 10 || randomNum1 == 11 || randomNum1 == 12
- || randomNum1 == 13) {
- mouse.moveSlightly();
- mouse.moveRandomly(random(30, 39), random(40, 60));
- }
- if (randomNum1 == 14) {
- mouse.moveOffScreen();
- }
- if (randomNum1 == 15) {
- mouse.moveSlightly();
- mouse.move(random(350, 700), random(50, 300));
- }
- if (randomNum1 == 16) {
- mouse.moveSlightly();
- mouse.moveSlightly();
- mouse.moveSlightly();
- mouse.moveSlightly();
- }
- if (randomNum1 > 16) {
- int randomNum2 = random(1, 3);
- if (randomNum2 == 1) {
- mouse.moveSlightly();
- }
- if (randomNum2 == 2) {
- mouse.moveRandomly(30, 50);
- }
- if (randomNum2 == 3) {
- mouse.moveSlightly();
- mouse.moveRandomly(30, 50);
- }
- }
- sleep(random(100, 400));
- }
- public void antiBanCamera() {
- int randomNumber3 = random(1, 40);
- if (randomNumber3 == 1 || randomNumber3 == 2 || randomNumber3 == 3) {
- camera.setPitch(random(40, 68));
- }
- if (randomNumber3 == 4 || randomNumber3 == 5 || randomNumber3 == 6) {
- camera.moveRandomly(random(800, 1200));
- }
- if (randomNumber3 == 7 || randomNumber3 == 8 || randomNumber3 == 9) {
- camera.setAngle(random(10, 50));
- }
- if (randomNumber3 == 10 || randomNumber3 == 11) {
- camera.setPitch(true);
- }
- if (randomNumber3 == 12 || randomNumber3 == 13) {
- camera.setPitch(false);
- }
- if (randomNumber3 == 14) {
- camera.moveRandomly(random(400, 800));
- }
- if (randomNumber3 == 15) {
- camera.setAngle(random(5, 40));
- sleep(random(200, 300));
- }
- if (randomNumber3 > 15 && randomNumber3 < 30) {
- camera.setPitch(true);
- }
- if (randomNumber3 > 29) {
- camera.moveRandomly(random(200, 800));
- }
- }
- public void antiBan(){
- int randomNumber123 = random(1, 3);
- if(randomNumber123 == 1) {
- antiBanMouse();
- }
- if(randomNumber123 == 2) {
- antiBanCamera();
- }
- }
- public void messageReceived(MessageEvent e) {
- String x = e.getMessage().toLowerCase();
- if (x.contains("dough into the pie")){
- shellsMade++;
- }
- }
- //START: Code generated using Enfilade's Easel
- private final Color color1 = new Color(0, 255, 0, 104);
- private final Color color2 = new Color(0, 0, 0);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("Arial", 0, 9);
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- profit = (ShellPrice - (DoughPrice + PiePrice)) * shellsMade;
- profitHour = (int) ((profit) * 3600000D / (System.currentTimeMillis() - startTime));
- shellsHour = (int) ((shellsMade) * 3600000 / (System.currentTimeMillis() - startTime));
- 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;
- g.setColor(color1);
- g.fillRect(375, 211, 141, 126);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(375, 211, 141, 126);
- g.setFont(font1);
- g.drawString("Time Running: "+ hours +":"+ minutes + ":" + seconds, 385, 234);
- g.drawString("Profit: " +profit, 385, 262);
- g.drawString("Profit Per Hour: " +profitHour, 385, 294);
- g.drawString("Shells p/h: " +shellsHour, 385, 310);
- g.drawString("Shells Made: " +shellsMade, 385, 327);
- g.setColor(color1);
- g.fillRect(578, 41, 101, 94);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(578, 41, 101, 94);
- g.setFont(font1);
- g.drawString("Shell Price: " +ShellPrice, 589, 63);
- g.drawString("Pie Price: " +PiePrice, 590, 88);
- g.drawString("Dough Price: "+DoughPrice, 589, 116);
- }
- //END: Code generated using Enfilade's Easel
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement