Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Yew 'N' Fletch (Shortbow Edition) + Bank
- // Save As "YewFletcherSB.java"
- // Made By HUBEB
- // Do Not Modify, or Repost This Script Without My Permission
- // Script Posted to "Hubeb.webs.com", and "Powerbot.org"
- import org.rsbot.script.methods.GrandExchange.GEItem;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.Script;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.events.ServerMessageEvent;
- import java.awt.Graphics;
- import java.awt.Color;
- import org.rsbot.script.*;
- import org.rsbot.script.methods.*;
- import org.rsbot.script.wrappers.*;
- import java.awt.*;
- import org.rsbot.event.listeners.*;
- @ScriptManifest(authors = { "HUBEB" }, keywords = {
- "YewNFletch+Bank Shortbow ED." }, name = "YewFletcher(SB ED.)",
- version = 1.0, description = "Cuts Yew North of Varrock East
- Bank, fletches to Longs and Banks!")
- public class YewFletcherSB extends Script implements
- PaintListener, ServerMessageListener {
- private int anyMaple = 1309;
- private int anyPick = 6739;
- private int logID = 1515;
- private int knifeID[] = {946, 1349, 1357, 1361,
- 1351, 6739,
- 1355, 1359,
- 1353};
- private RSTile[] walkingPath = {new RSTile(3246, 3472),
- new RSTile(3245, 3458),
- new RSTile(3245, 3444), new RSTile(3247, 3431),
- new RSTile(3252, 3421)};
- // Maple 2 Bank
- private RSArea bankArea = new RSArea(new RSTile(3257,
- 3423), new RSTile(3250, 3419));
- private RSArea mineArea = new RSArea(new RSTile(3251,
- 3475), new RSTile(3244, 3470));
- int[] bankerId = {553, 2759};
- public int startExp;
- public int startLevel;
- public int currentLevel;
- public int gainedLevels;
- public int expGained = 0;
- public int expHour = 0;
- public int exp;
- public int percent;
- private int logCount;
- public int woodCuttingLevel;
- public int antiBanSelect;
- public int randomSkill;
- public int SKILL;
- private String status = "";
- public long startTime = System.currentTimeMillis();
- public long timeRan;
- private int startTab;
- int nextScreenShot = 1;
- int SSHours = 0;
- //fletch
- public int startExpFl;
- public int startLevelFl;
- public int currentLevelFl;
- public int gainedLevelsFl;
- public int expGainedFl = 0;
- public int expHourFl = 0;
- public int expFl;
- public int percentFl;
- public int fletchingLevel;
- public int bowCount;
- private int bowID = 68;
- public float bow;
- public float bowPrice;
- GEItem bowGE;
- private final Color color1 = new Color(0, 0, 0);
- private final Color color2 = new Color(255, 255, 255);
- private final Color color3 = new Color(255, 255, 51);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("Arial", 1, 11);
- public boolean onStart(){
- getPrices();
- startTime = System.currentTimeMillis();
- startLevel = skills.getRealLevel(Skills.WOODCUTTING);
- status = "Starting HUBEB's Yew 'N' Fletch + Bank
- (Shortbow Edition)!";
- log("Start at Bank or Yew with Knife in
- Inventory (hatchet can be in inventory too)");
- startExp = 0;
- if ( startExp == 0) {
- startExp = skills.getCurrentExp(Skills.WOODCUTTING);
- }
- startLevelFl =
- skills.getRealLevel(Skills.FLETCHING);
- startExpFl = 0;
- if ( startExpFl == 0) {
- startExpFl = skills.getCurrentExp(Skills.FLETCHING);
- }
- log("Mouse Speed is: " + mouse.getSpeed());
- mouse.setSpeed(10);
- log("Starting level (WC): " + startLevel);
- log("Starting level (FL): " + startLevelFl);
- return true;
- }
- public void serverMessageRecieved(ServerMessageEvent e)
- {
- String msg = e.getMessage();
- if (msg.contains("You get some")) {
- logCount++;
- }
- e.getMessage();
- if (msg.contains("You carefully")) {
- bowCount++;
- }
- }
- public void getPrices(){
- log("Getting the prices of the items from the
- GE. This can take a while.");
- bowGE = grandExchange.lookup(bowID);
- bowPrice = bowGE.getMarketPrice();
- }
- public int loop(){
- if(inventory.isFull()){
- if(bankArea.contains(getMyPlayer().getLocation())){
- Fletch();
- antiBan();
- RSNPC Banker =
- npcs.getNearest(bankerId);
- if (Banker.isOnScreen() && !bank.isOpen()) {
- Banker.doAction("Bank Banker");
- sleep(random(2000, 4000));
- if (bank.isOpen()) {
- bank.depositAllExcept(knifeID);
- }
- bank.close();
- antiBan();
- }
- }else{
- if(walking.getDestination() ==
- null || calc.distanceTo(walking.getDestination()) < random(4,
- 6)){
- walking.walkPathMM(walkingPath);
- return random(1000,
- 1500);
- }
- antiBan();
- }
- }else{
- if(mineArea.contains(getMyPlayer().getLocation())){
- if(getMyPlayer().getAnimation()
- != 2846){
- RSObject tree =
- objects.getNearest(anyMaple);
- antiBan();
- if(tree != null){
- tree.doAction("Chop");
- antiBan();
- sleep(1800,
- 2800);
- }
- antiBan();
- }
- }else{
- if(walking.getDestination() ==
- null || calc.distanceTo(walking.getDestination()) < random(4,
- 6)){
- walking.walkPathMM(walking.reversePath(walkingPath));
- return random(1000,
- 1500);
- }
- antiBan();
- }
- }
- return random(100, 200);
- }
- public void Fletch() {
- RSItem knife = inventory.getItem(knifeID);
- RSItem log = inventory.getItem(logID);
- knife.doClick(true);
- log.doClick(true);
- mouse.move(163, 426, 7, 7);
- sleep(500);
- mouse.click(true);
- antiBan();
- sleep(55000);
- }
- // HUBEBs Anti-Ban START
- public void antiBan() {
- int b = random(0, 10);
- switch (b) {
- case 1: //Mouse off Screen
- log("AntiBan Move Mouse
- Off Screen");
- if (random(0,4) == 3) {
- mouse.moveOffScreen();
- sleep(random(2000,
- 5500));
- }
- break;
- case 2: //Move Mouse
- log("AntiBan Move Mouse
- Randomly");
- if (random(0,4) == 2) {
- mouse.moveSlightly();
- sleep(300, 700);
- mouse.moveRandomly(40,
- 860);
- }
- break;
- case 3: //Turn Screen
- log("Turn Screen/Camera
- Randomly");
- if (random(0, 4) == 1) {
- camera.setAngle(random(100, 359));
- sleep(500,1500);
- }
- break;
- default:
- break;
- }
- }
- // HUBEBs Anti-Ban FINISH
- public void onFinish(){
- log("Script finished");
- }
- //START: Paint All
- public void onRepaint(Graphics g1) {
- //Timer
- long millis = System.currentTimeMillis() - startTime;
- long hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- long minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- long seconds = millis / 1000;
- long minutes2 = minutes + (hours * 60);
- //PaintNorm
- currentLevel =
- skills.getRealLevel(Skills.WOODCUTTING);
- gainedLevels = currentLevel - startLevel;
- expGained =
- skills.getCurrentExp(Skills.WOODCUTTING) - startExp;
- percent =
- skills.getPercentToNextLevel(Skills.WOODCUTTING);
- timeRan = System.currentTimeMillis() - startTime;
- //Fletching
- currentLevelFl =
- skills.getRealLevel(Skills.FLETCHING);
- gainedLevelsFl = currentLevelFl - startLevelFl;
- expGainedFl =
- skills.getCurrentExp(Skills.FLETCHING) - startExpFl;
- percentFl =
- skills.getPercentToNextLevel(Skills.FLETCHING);
- timeRan = System.currentTimeMillis() - startTime;
- Graphics2D g = (Graphics2D)g1;
- //Mouse
- g.setColor(Color.black);
- g.drawLine(0, (int)(mouse.getLocation().getY()),
- 800, (int)(mouse.getLocation().getY()));
- g.drawLine((int)(mouse.getLocation().getX()), 0,
- (int)(mouse.getLocation().getX()), 800);
- g.setColor(Color.black);
- g.drawLine(0, (int)(mouse.getLocation().getY()) +1,
- 800, (int)(mouse.getLocation().getY())+1);
- g.drawLine((int)(mouse.getLocation().getX()) +1, 0,
- (int)(mouse.getLocation().getX())+1, 800);
- //paint
- g.setColor(color1);
- g.fillRect(362, 7, 150, 121);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(362, 7, 150, 121);
- g.setFont(font1);
- g.drawString("Yews Cut: " + logCount, 374, 25);
- g.drawString("Bows made: " + bowCount, 374,
- 35);
- g.drawString("Exp Gained (WC): " + expGained, 374, 53);
- g.drawString("Exp Gained (FL): " + expGainedFl,
- 374, 63);
- g.drawString("" + percent + "% TNL (WC)", 384, 78);
- g.drawString("" + percentFl + "% TNL (FL)",
- 384, 88);
- g.drawString("Run Time: " + hours + ":" +
- minutes + ":" + seconds + ".",374, 103);
- g.drawString("Profit: approx.
- "+((int)(bowCount*bowPrice))+"gp",374,113);
- g.setColor(color3);
- g.drawString("Made By HUBEB", 385, 125);
- }
- //END: PaintAll
- }
Add Comment
Please, Sign In to add comment