Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.BasicStroke;
- import java.awt.Color;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.*;
- import org.rsbot.event.events.MessageEvent;
- import org.rsbot.event.listeners.MessageListener;
- import org.rsbot.event.listeners.PaintListener;
- @ScriptManifest(authors = "Elite92", keywords = "Power chops willows", name = "EliteChopper", version = 1, description = "Power chops willows")
- public class EliteChopper extends Script implements PaintListener, MessageListener{
- public int[] hatchets = {1349, 1351, 13523, 1355, 1357, 1359, 6739};
- public int[] willowTree = {5551, 5552, 5553};
- public int willowLog = 1519;
- long startTime;
- int startXp = 0;
- int expGained = 0;
- int logsCut = 0;
- public boolean onStart() {
- startTime = System.currentTimeMillis();
- startXp = skills.getCurrentExp(skills.WOODCUTTING);
- log("Welcome to Test.");
- return true;
- }
- public int loop() {
- if(inventory.isFull()) {
- inventory.dropAllExcept(hatchets);
- }else{
- if(getMyPlayer().getAnimation() != 867){
- RSObject tree = objects.getNearest(willowTree);
- if(tree != null){
- tree.doAction("Chop");
- sleep(500, 800);
- }
- }
- }
- return random(500, 800);
- }
- public void onFinish() {
- log("You gained:" + expGained + " exp");
- log("Goodbye");
- }
- @Override
- public void onRepaint(final Graphics g) {
- //START: Code generated using Enfilade's Easel
- final Color color1 = new Color(102, 0, 102, 185);
- final Color color2 = new Color(0, 0, 0);
- final BasicStroke stroke1 = new BasicStroke(1);
- final Font font1 = new Font("Lucida Handwriting", 1, 19);
- final Font font2 = new Font("Arial", 1, 14);
- long expGained = skills.getCurrentExp(skills.WOODCUTTING) - startXp;
- int xpTilLevel = skills.getExpToNextLevel(skills.WOODCUTTING);
- 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;
- float xpsec = 0;
- if((minutes > 0 || hours > 0 || seconds > 0) && expGained > 0) {
- xpsec = ((float)expGained)/(float)(seconds + (minutes * 60)+ hours * 60 *60);
- }
- float xpmin = xpsec * 60;
- float xpHour = xpmin * 60;
- float logsec = 0;
- if((minutes > 0 || hours > 0 || seconds > 0) && logsCut > 0) {
- xpsec = ((float)logsCut)/(float)(seconds + (minutes * 60)+ hours * 60 *60);
- }
- float logmin = xpsec * 60;
- float logHour = xpmin * 60;
- Graphics2D g1 = (Graphics2D)g;
- g1.setColor(color1);
- g1.fillRect(9, 347, 486, 110);
- g1.setColor(color2);
- g1.setStroke(stroke1);
- g1.drawRect(9, 347, 486, 110);
- g1.setFont(font1);
- g1.drawString("Elite Bots ", 11, 368);
- g1.setFont(font2);
- g1.drawString("Runtime:" + hours + ":" + minutes + ":" + seconds, 40, 391);
- g1.drawString("Exp Gained:" + (int)expGained, 39, 410);
- g1.drawString("Exp/h:" + (int)xpHour, 40, 429);
- g1.drawString("Logs Cut:" + (int)logsCut, 194, 390);
- g1.drawString("Logs/h:" + (int)logHour, 195, 408);
- g1.drawString("Xp Til Level:" + xpTilLevel, 193, 428);
- }
- //END: Code generated using Enfilade's Easel
- @Override
- public void messageReceived(MessageEvent e) {
- String txt = e.getMessage();
- if(txt.contains("logs")){
- logsCut++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement