Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Save as: maple.java
- 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 = { "Maple" }, name = "maple", version = 1.0, description = "Cuts Maples South-East Of Seers BAnk!")
- public class maple extends Script implements PaintListener, ServerMessageListener {
- private int anyMaple = 1307;
- private int anyPick = 6739;
- private RSTile[] walkingPath = {new RSTile(2748, 3467), new RSTile(2742, 3475), new RSTile(2732, 3485), new RSTile(2726, 3493)};
- // Maple 2 Bank
- private RSArea bankArea = new RSArea(new RSTile(2730, 3493), new RSTile(2721, 3557));
- private RSArea mineArea = new RSArea(new RSTile(2752, 3470), new RSTile(2746, 3462));
- int[] bankerId = {494, 495};
- 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;
- 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(){
- startTime = System.currentTimeMillis();
- startLevel = skills.getRealLevel(Skills.WOODCUTTING);
- status = "Starting HUBEB's Maples";
- startExp = 0;
- if ( startExp == 0) {
- startExp = skills.getCurrentExp(Skills.WOODCUTTING);
- }
- log("Mouse Speed is: " + mouse.getSpeed());
- mouse.setSpeed(9);
- log("Starting level: " + startLevel);
- return true;
- }
- public void serverMessageRecieved(ServerMessageEvent e) {
- String msg = e.getMessage();
- if (msg.contains("You get some")) {
- logCount++;
- }
- }
- public int loop(){
- if(inventory.isFull()){
- if(bankArea.contains(getMyPlayer().getLocation())){
- RSNPC Banker = npcs.getNearest(bankerId);
- if (Banker.isOnScreen() && !bank.isOpen()) {
- Banker.doAction("Bank Banker");
- sleep(random(2000, 4000));
- if (bank.isOpen()) {
- bank.depositAll();
- }
- 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);
- 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);
- }
- // 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;
- Graphics2D g = (Graphics2D)g1;
- //paint
- g.setColor(color1);
- g.fillRect(396, 7, 116, 111);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(396, 7, 116, 111);
- g.setFont(font1);
- g.drawString("Maples Cut: " + logCount, 400, 25);
- g.drawString("Exp Gained: " + expGained, 400, 53);
- g.drawString("" + percent + "% TNL", 430, 77);
- g.setColor(color3);
- g.drawString("Made By HUBEB", 411, 109);
- }
- //END: PaintAll
- }
Advertisement
Add Comment
Please, Sign In to add comment