Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.scripts;
- import com.kbot2.scriptable.Script;
- import com.kbot2.scriptable.methods.wrappers.Tile;
- import com.kbot2.scriptable.methods.data.Walking;
- import com.kbot2.scriptable.methods.wrappers.NPC;
- import com.kbot2.scriptable.methods.wrappers.Obj;
- import com.kbot2.scriptable.methods.wrappers.Interface;
- import com.kbot2.handlers.eventSystem.eventListeners.PaintListener;
- import com.kbot2.handlers.eventSystem.eventListeners.ServerMessageListener;
- import java.awt.*;
- import java.awt.Graphics;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics2D;
- public class FALADORYEWS2 extends Script implements PaintListener, ServerMessageListener {
- //ID's mang
- int BANK_ID = 11758;
- int TREE_ID[] = { 1309 };
- int YEW_ID = 1515;
- int status = 0;
- Obj f;
- Obj b;
- //Paint
- String minute;
- String second;
- String hour;
- private int YewCount;
- long startTime = System.currentTimeMillis();
- /*Path to shop BANK*/
- Tile[] TO_BANK = new Tile[]{new Tile(2937,3233), new Tile(2942,3235), new Tile(2947,3238), new Tile(2952,3240), new Tile(2955,3244), new Tile(2958,3248), new Tile(2962,3252), new Tile(2967,3255), new Tile(2968,3260), new Tile(2969,3265), new Tile(2973,3268), new Tile(2978,3270), new Tile(2983,3272), new Tile(2987,3275), new Tile(2990,3279), new Tile(2994,3282), new Tile(2997,3286), new Tile(3001,3289), new Tile(3003,3294), new Tile(3005,3299), new Tile(3005,3304), new Tile(3005,3309), new Tile(3005,3314), new Tile(3005,3319), new Tile(3005,3324), new Tile(3005,3329), new Tile(3006,3334), new Tile(3006,3339), new Tile(3006,3344), new Tile(3006,3349), new Tile(3006,3354), new Tile(3008,3359), new Tile(3012,3356), };
- Tile[] TO_YEW = Walking.reversePath(TO_BANK);
- public boolean active() {
- return true;
- }
- public String getName() {
- return "Falador Yews v-2.0";
- }
- public String getAuthor() {
- return "Orca";
- }
- public String getDescription() {
- return "Start the script at FALADOR YEWS, it chops the yews and then banks.";
- }
- public void onServerMessage(String e) {
- if (e.contains("You get some Yew logs.")) {
- YewsCut++;
- }
- public int loop() { if(walking.getEnergy() > 50)
- walking.setRunning(true);
- switch (status) {
- case 0:
- if (inventory.isFull()) {
- status = 3;
- } else if (!inventory.isFull()) {
- status = 1;
- }
- return random(300, 500);
- case 1:
- // From Bank To YEW
- walking.walkPath(TO_YEW);
- if(getMyPlayer().isMoving())
- return 100;
- status = 2;
- return random(150, 300);
- case 2:
- // CHOPPING YEWS
- f = getClosestObject(7, TREE_ID);
- if (f != null)
- f.doAction("Chop down");
- sleep(10000);
- if (inventory.isFull()) {
- status = 3;
- }
- return random(150, 300);
- case 3:
- // Back To Bank
- walking.walkPath(TO_BANK);
- if(getMyPlayer().isMoving())
- return 100;
- status = 4;
- return random(150, 300);
- case 4:
- // Check Bank
- Obj bankBooth = getClosestObject(7, BANK_ID);
- if (bankBooth != null) {
- if (distanceTo(bankBooth.getLocation()) > 5)
- walking.walkToMM(bankBooth.getLocation());
- if (!bank.isOpen()) { // if bank is not open
- bankBooth.doAction("quickly");
- } else {
- sleep(750, 1000);
- bank.depositAll(1515);
- sleep(350, 500);
- if (inventory.getCount(true, 1515) == 0) {
- bank.close();
- status = 0;
- } else {
- return random(200, 300);
- }
- }
- }
- return random(100, 300);
- }
- return random(100, 300);
- }
- public void onRepaint(Graphics g){
- 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;
- hour = Long.toString(hours);
- minute = Long.toString(minutes);
- second = Long.toString(seconds);
- String time1 = "";
- String time2 = "";
- String time3 = "";
- if (hours < 10) {
- time1 = "0";
- }
- if (minutes < 10) {
- time2 = "0";
- }
- if (seconds < 10) {
- time3 = "0";
- }
- Graphics2D g2d = (Graphics2D) g;
- g2d.setColor(new Color(250, 250, 250, 110));
- g2d.fill3DRect(5, 269, 150, 69, true);
- g2d.setColor(Color.green); //Sets text color
- g2d.setFont(new Font("Comic Sans", Font.BOLD, 14));
- g2d.drawString("FALADORYEWS v" + getVersion(2), 11, 285);
- g2d.setColor(Color.red);
- g2d.setFont(new Font("Arial", Font.PLAIN, 12));
- g2d.drawString("Yews Cut: " + YewCount, 9, 321);
- g2d.drawString("Time running: " + time1 + hours + ":" + time2 + minutes + ":" + time3 + seconds, 9, 309);
- }
- }
Add Comment
Please, Sign In to add comment