Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package core;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics2D;
- import org.osbot.rs07.api.map.constants.Banks;
- import org.osbot.rs07.api.map.Area;
- import org.osbot.rs07.api.model.RS2Object;
- import org.osbot.rs07.api.ui.Skill;
- import org.osbot.rs07.script.Script;
- import org.osbot.rs07.script.ScriptManifest;
- import org.osbot.rs07.utility.ConditionalSleep;
- @ScriptManifest(author = "Suss", info = "Cuts trees & banks the logs at Grand Exchange.", name = "Sus's Logger", version = 0.3, logo = "https://i.ibb.co/xgbRfTv/rsz-logger.png")
- public class Main extends Script {
- public Area grandExchange = new Area(3142, 3468, 3187, 3515);
- public int treeCount = 0;
- public int woodcuttingXP = 0;
- public int treeCountHour = 0;
- public int woodcuttingXPHR = 0;
- public long totalElapsed = 0;
- public long totalElapsedFixed = 0;
- public long totalLogsBanked = 0;
- public String botStatus;
- @Override
- public void onStart() {
- log("Sus's Logger Started");
- getExperienceTracker().start(Skill.WOODCUTTING);
- }
- public void statTracker() {
- // XP
- woodcuttingXP = getExperienceTracker().getGainedXP(Skill.WOODCUTTING);
- woodcuttingXPHR = getExperienceTracker().getGainedXPPerHour(Skill.WOODCUTTING);
- // Total Logs
- treeCount = woodcuttingXP / 25;
- treeCountHour = woodcuttingXPHR / 25;
- // Timings
- totalElapsed = getExperienceTracker().getElapsed(Skill.WOODCUTTING);
- totalElapsedFixed = totalElapsed / 1000;
- }
- public void botStatus() {
- if (getInventory().isFull() && myPlayer().isMoving()) {
- botStatus = "Walking to GE";
- } else if (myPlayer().isAnimating() && !getInventory().isFull()) {
- botStatus = "Chopping Tree";
- } else if (myPlayer().isMoving() || !myPlayer().isMoving() && !getInventory().isFull()) {
- botStatus = "Locating Tree";
- }
- }
- @Override
- public int onLoop() throws InterruptedException {
- RS2Object regTree = getObjects().closest(grandExchange, "Tree");
- if (grandExchange.contains(myPlayer())) {
- if (getInventory().contains("Logs") && getInventory().isFull()) {
- getWalking().webWalk(Banks.GRAND_EXCHANGE);
- bank.open();
- bank.depositAll("Logs");
- bank.close();
- } else if (regTree != null && !myPlayer().isAnimating()) {
- if (regTree.interact("Chop down")) {
- new ConditionalSleep(5000, 750) {
- @Override
- public boolean condition() throws InterruptedException {
- return myPlayer().isAnimating();
- }
- }.sleep();
- }
- }
- } else {
- getWalking().webWalk(grandExchange);
- }
- // Updates GUI
- statTracker();
- botStatus();
- return random(750, 1500);
- }
- @Override
- public void onExit() {
- log("========================================");
- log("Thank you for chopping with Sus Tree Chooper!");
- log("========================================");
- }
- @Override
- public void onPaint(Graphics2D title) {
- title.setFont(new Font("arial", Font.ITALIC, 12));
- title.setColor(Color.PINK);
- title.drawString("Sus's Tree Cutter", 30, 40);
- title.drawString("Total Logs Cut: " + treeCount, 30, 60);
- title.drawString("Logs Per Hour: " + treeCountHour, 30, 80);
- title.drawString("Total XP Gained: " + woodcuttingXP, 30, 100);
- title.drawString("XP Per Hour: " + woodcuttingXPHR, 30, 120);
- title.drawString("Total Time Ran: " + totalElapsedFixed + " Seconds", 30, 150);
- title.drawString("Bot Status: " + botStatus, 30, 170);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement