Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.AlphaComposite;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Composite;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Point;
- import java.awt.Rectangle;
- import java.awt.RenderingHints;
- import java.awt.event.MouseEvent;
- import java.io.BufferedReader;
- import java.io.BufferedWriter;
- import java.io.File;
- import java.io.FileWriter;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.net.URL;
- import java.net.URLConnection;
- import java.text.NumberFormat;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.awt.Container;
- import java.awt.image.BufferedImage;
- import java.util.List;
- import java.util.Map;
- import java.util.logging.Level;
- import java.util.prefs.Preferences;
- import javax.swing.JCheckBox;
- import javax.swing.JComboBox;
- import javax.swing.JOptionPane;
- import javax.swing.JSpinner;
- import javax.swing.event.MouseInputListener;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.listeners.ServerMessageListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.methods.Game;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.util.Timer;
- import org.rsbot.script.util.WindowUtil;
- import org.rsbot.script.wrappers.RSArea;
- import org.rsbot.script.wrappers.RSInterface;
- import org.rsbot.script.wrappers.RSItem;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.util.GlobalConfiguration;
- import java.awt.BorderLayout;
- import java.awt.Color;
- import java.awt.FlowLayout;
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.lang.String;
- import java.awt.Point;
- import java.awt.Polygon;
- import org.rsbot.script.methods.Walking;
- import java.awt.RenderingHints;
- import org.rsbot.script.methods.MethodProvider;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.methods.Keyboard;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- import java.io.File;
- import java.io.FileInputStream;
- import java.io.FileOutputStream;
- import java.text.NumberFormat;
- import java.util.ArrayList;
- import java.util.HashMap;
- import java.util.Map;
- import java.util.Properties;
- import org.rsbot.script.wrappers.RSObject;
- import javax.swing.BorderFactory;
- import javax.swing.BoxLayout;
- import javax.swing.JButton;
- import javax.swing.JCheckBox;
- import javax.swing.JFrame;
- import javax.swing.JLabel;
- import javax.swing.JOptionPane;
- import javax.swing.JPanel;
- import javax.swing.JTextField;
- import javax.swing.JRadioButton;
- import javax.swing.JSlider;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.util.Filter;
- import org.rsbot.script.wrappers.RSCharacter;
- import org.rsbot.script.wrappers.RSComponent;
- import org.rsbot.script.wrappers.RSGroundItem;
- import org.rsbot.script.wrappers.RSItem;
- import org.rsbot.script.wrappers.RSModel;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSPlayer;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.util.GlobalConfiguration;
- import java.awt.Color;
- import java.awt.Graphics;
- import java.util.Map;
- import java.awt.*;
- import javax.swing.*;
- import java.awt.Window;
- import org.rsbot.bot.Bot;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSInterface;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSNPC;
- @ScriptManifest(authors = { "happyfeet" }, name = "ConstructionBot", version = 1.10, description = "Welcome! Options are in the GUI. Enjoy!")
- public class ConstructionBot extends Script implements PaintListener{
- //START OF CLASS VARIABLES//
- private int teakB = 18790;
- private int teakUn = 18811;
- public String status = "";
- private int teakPlank = 8780;
- private int mahoganyPlank = 8782;
- private int oakDB = 13345;
- private int oakDUn = 15327;
- private int mahB = 13298;
- private int mouseSpeed;
- private int mahUn = 15298;
- private int mahPlank = 8782;
- private long startingTime;
- private boolean guiStart = false;
- private int startXP = 0;
- private int startLvl = 0;
- private long scriptStartTime = 0;
- final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
- private Rectangle experienceProgressBar;
- BufferedImage normal = null;
- BufferedImage clicked = null;
- private int normalButler = 4241;
- private int demonButler = 4243;
- private int Built, Unbuilt, plank, whatToMake;
- private int butler;
- private long startExp, st, startLevel;
- private RSTile nearWardrobe;
- private boolean ButlerHere = true;
- //END OF CLASS VARIABLES//
- //START OF GUI//
- public class ConstructionGUI extends JPanel {
- public ConstructionGUI() {
- initComponents();
- }
- //START OF COMPONENTS
- private void initComponents() {
- frame1 = new JFrame();
- panel1 = new JPanel();
- comboBox1 = new JComboBox();
- comboBox2 = new JComboBox();
- label1 = new JLabel();
- label2 = new JLabel();
- label3 = new JLabel();
- slider1 = new JSlider();
- label4 = new JLabel();
- label5 = new JLabel();
- label6 = new JLabel();
- label7 = new JLabel();
- label8 = new JLabel();
- label9 = new JLabel();
- label10 = new JLabel();
- button1 = new JButton();
- //======== frame1 ========
- {
- Container frame1ContentPane = frame1.getContentPane();
- frame1ContentPane.setLayout(null);
- frame1.setVisible(true);
- frame1.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
- //======== panel1 ========
- {
- // JFormDesigner evaluation mark
- panel1.setBorder(new javax.swing.border.CompoundBorder(
- new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0),
- "", javax.swing.border.TitledBorder.CENTER,
- javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12),
- java.awt.Color.red), panel1.getBorder())); panel1.addPropertyChangeListener(
- new java.beans.PropertyChangeListener(){
- public void propertyChange(java.beans.PropertyChangeEvent e){
- if("border".equals(e.getPropertyName()))throw new RuntimeException();}});
- panel1.setLayout(null);
- //---- comboBox1 ----
- comboBox1.setModel(new DefaultComboBoxModel(new String[] {
- "Normal Butler",
- "Demon Butler"
- }));
- panel1.add(comboBox1);
- comboBox1.setBounds(95, 215, 185, comboBox1.getPreferredSize().height);
- //---- comboBox2 ----
- comboBox2.setModel(new DefaultComboBoxModel(new String[] {
- "Oak Dungeon Door",
- "Mahogany Table",
- "Carved teak magic wardrobe"
- }));
- panel1.add(comboBox2);
- comboBox2.setBounds(95, 255, 185, comboBox2.getPreferredSize().height);
- //---- label1 ----
- label1.setText("Mida teha tahad:");
- panel1.add(label1);
- label1.setBounds(new Rectangle(new Point(120, 240), label1.getPreferredSize()));
- //---- label2 ----
- label2.setText("määne toateenija sul on:");
- panel1.add(label2);
- label2.setBounds(new Rectangle(new Point(125, 200), label2.getPreferredSize()));
- //---- label3 ----
- label3.setText("mingi munni script on see");
- label3.setFont(new Font("Tahoma", Font.PLAIN, 24));
- panel1.add(label3);
- label3.setBounds(new Rectangle(new Point(35, 25), label3.getPreferredSize()));
- //---- slider1 ----
- slider1.setPaintTicks(true);
- slider1.setPaintLabels(true);
- slider1.setSnapToTicks(true);
- slider1.setValue(4);
- slider1.setMaximum(8);
- slider1.setMajorTickSpacing(1);
- slider1.setMinorTickSpacing(1);
- panel1.add(slider1);
- slider1.setBounds(new Rectangle(new Point(95, 150), slider1.getPreferredSize()));
- //---- label4 ----
- label4.setText("Mouse Speed:");
- panel1.add(label4);
- label4.setBounds(new Rectangle(new Point(155, 135), label4.getPreferredSize()));
- //---- label5 ----
- label5.setText("0 on väga kiire");
- panel1.add(label5);
- label5.setBounds(new Rectangle(new Point(40, 155), label5.getPreferredSize()));
- //---- label6 ----
- label6.setText("8 in kõige aeglasem");
- panel1.add(label6);
- label6.setBounds(new Rectangle(new Point(300, 155), label6.getPreferredSize()));
- //---- label7 ----
- label7.setText("Üks buggine bot");
- panel1.add(label7);
- label7.setBounds(new Rectangle(new Point(45, 55), label7.getPreferredSize()));
- //---- label8 ----
- label8.setText("alusta oma majas");
- panel1.add(label8);
- label8.setBounds(new Rectangle(new Point(20, 70), label8.getPreferredSize()));
- //---- label9 ----
- label9.setText("saag ja haamer olgu kotis ja saada toateenija laudade järele");
- panel1.add(label9);
- label9.setBounds(new Rectangle(new Point(25, 85), label9.getPreferredSize()));
- //---- label10 ----
- label10.setText("enne alustamist seisa ehitatava eseme lähedale");
- panel1.add(label10);
- label10.setBounds(new Rectangle(new Point(35, 100), label10.getPreferredSize()));
- //---- button1 ----
- button1.setText("Start!");
- panel1.add(button1);
- button1.setBounds(95, 285, 190, button1.getPreferredSize().height);
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for(int i = 0; i < panel1.getComponentCount(); i++) {
- Rectangle bounds = panel1.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
- }
- Insets insets = panel1.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- panel1.setMinimumSize(preferredSize);
- panel1.setPreferredSize(preferredSize);
- }
- }
- frame1ContentPane.add(panel1);
- panel1.setBounds(-5, -20, 390, 320);
- { // compute preferred size
- Dimension preferredSize = new Dimension();
- for(int i = 0; i < frame1ContentPane.getComponentCount(); i++) {
- Rectangle bounds = frame1ContentPane.getComponent(i).getBounds();
- preferredSize.width = Math.max(bounds.x + bounds.width, preferredSize.width);
- preferredSize.height = Math.max(bounds.y + bounds.height, preferredSize.height);
- }
- Insets insets = frame1ContentPane.getInsets();
- preferredSize.width += insets.right;
- preferredSize.height += insets.bottom;
- frame1ContentPane.setMinimumSize(preferredSize);
- frame1ContentPane.setPreferredSize(preferredSize);
- }
- frame1.pack();
- frame1.setLocationRelativeTo(frame1.getOwner());
- button1.addActionListener(
- new java.awt.event.ActionListener() {
- public void actionPerformed(
- java.awt.event.ActionEvent arg0) {
- if(comboBox2.getSelectedItem().equals("Carved teak magic wardrobe")){
- Built = teakB;
- Unbuilt = 18811;
- plank = teakPlank;
- whatToMake = 0;
- log("Making teak wardrobes.");
- }
- else if(comboBox2.getSelectedItem().equals("Oak Dungeon Door"))
- {
- Built = oakDB;
- Unbuilt = oakDUn;
- plank = teakPlank;
- whatToMake = 1;
- log("Making oak dungeon doors");
- }
- else if(comboBox2.getSelectedItem().equals("Mahogany Table"))
- {
- Built = mahB;
- Unbuilt = mahUn;
- plank = mahPlank;
- whatToMake = 2;
- log("Making mahogany tables.");
- }
- if(comboBox1.getSelectedItem().equals("Normal Butler"))
- {
- butler = normalButler;
- log("Your Butler is the normal one.");
- }
- if(comboBox1.getSelectedItem().equals("Demon Butler"))
- {
- butler = demonButler;
- log("You have the demon Butler.");
- }
- if (slider1.getValue() == 0) {
- mouseSpeed = 0;
- }
- else if (slider1.getValue() == 1) {
- mouseSpeed = 1;
- }
- else if (slider1.getValue() == 2) {
- mouseSpeed = 2;
- }
- else if (slider1.getValue() == 3) {
- mouseSpeed = 3;
- }
- else if (slider1.getValue() == 4) {
- mouseSpeed = 4;
- }
- else if (slider1.getValue() == 5) {
- mouseSpeed = 5;
- }
- else if (slider1.getValue() == 6) {
- mouseSpeed = 6;
- }
- else if (slider1.getValue() == 7) {
- mouseSpeed = 7;
- }
- else if (slider1.getValue() == 8) {
- mouseSpeed = 8;
- }
- log("Your mouse speed is " + mouseSpeed + ".");
- guiStart = true;
- frame1.dispose();
- }
- });
- }
- }
- //END OF COMPONENTS//
- private JFrame frame1;
- private JPanel panel1;
- private JComboBox comboBox1;
- private JComboBox comboBox2;
- private JLabel label1;
- private JLabel label2;
- private JLabel label3;
- private JSlider slider1;
- private JLabel label4;
- private JLabel label5;
- private JLabel label6;
- private JLabel label7;
- private JLabel label8;
- private JLabel label9;
- private JLabel label10;
- private JButton button1;
- }
- //END OF GUI//
- public int getMouseSpeed() {
- if (mouseSpeed == 8) {
- return 8;
- }
- if (mouseSpeed == 7) {
- return 7;
- }
- else if (mouseSpeed == 6) {
- return 6;
- }
- else if (mouseSpeed == 5) {
- return 5;
- }
- else if (mouseSpeed == 4) {
- return 4;
- }
- else if (mouseSpeed == 3) {
- return 3;
- }
- else if (mouseSpeed == 2) {
- return 2;
- }
- else if (mouseSpeed == 1) {
- return 1;
- }
- else
- return 0;
- }
- //WHAT TO DO RIGHT WHEN THE BOT STARTS//
- public boolean onStart() {
- final ConstructionGUI GUI = new ConstructionGUI();
- GUI.setVisible(true);
- while(!guiStart){
- sleep(50);
- }
- scriptStartTime = System.currentTimeMillis();
- startXP = skills.getCurrentExp(Skills.CONSTRUCTION);
- startLvl = skills.getCurrentLevel(Skills.CONSTRUCTION);
- st = System.currentTimeMillis();
- log("Started");
- return true;
- }
- //END OF ONSTART METHOD//
- //MAIN LOOP , WHERE EVERYTHING OCCURS//
- public int loop(){
- mouse.setSpeed(getMouseSpeed());
- if (calc.distanceTo(nearWardrobe) > 3) {
- walking.walkTo(nearWardrobe);
- return 1300;
- }
- if (interfacesss()) {
- return 800;
- }
- if (inventory.getCount(plank) < 16) {
- if (npcs.getNearest(butler) != null) {
- if (ButlerHere == false) {
- ButlerHere = true;
- int waitCount = 24;
- if (inventory.getCount(plank) < 1) {
- CountTheInventory(plank, waitCount, 3000);
- }
- }
- if(whatToMake == 0){
- if ( inventory.getCount(plank) <= 10 && objects.getNearest(Unbuilt) != null ) {
- npcs.getNearest(butler).doAction("Fetch-from-bank");
- sleep(500);
- if (interfaces.get(242).isValid() || interfaces.get(232).isValid() || interfaces.get(234).isValid()) {
- interfacesss();
- return 1500;
- }
- return(1200);
- }
- }
- else if(whatToMake == 1){
- if ( inventory.getCount(plank) <= 16 && objects.getNearest(Unbuilt) != null) {
- npcs.getNearest(butler).doAction("Fetch-from-bank");
- sleep(500);
- if (interfaces.get(242).isValid() || interfaces.get(232).isValid() || interfaces.get(234).isValid()) {
- interfacesss();
- return 1500;
- }
- return(1200);
- }
- }
- else if(whatToMake == 2){
- if ( inventory.getCount(plank) <= 8 && objects.getNearest(Unbuilt) != null) {
- npcs.getNearest(butler).doAction("Fetch-from-bank");
- sleep(500);
- if (interfaces.get(242).isValid() || interfaces.get(232).isValid() || interfaces.get(234).isValid()) {
- interfacesss();
- return 1500;
- }
- }
- return(1200);
- }
- if (inventory.getCount(plank) >= 16)
- return 1500;
- }
- // else {
- // ButlerHere = false;
- // if (objects.getNearest(Built) != null) {
- // objects.getNearest(Built).doAction("Remove");
- // return(1500);
- // }
- // }
- }
- if (objects.getNearest(Built) != null && inventory.getCount(plank) > 6) {
- objects.getNearest(Built).doAction("Remove");
- return(1500);
- }
- if(whatToMake == 0){
- if(objects.getNearest(Unbuilt) != null && inventory.getCount(plank) > 7 ) {
- while(interfaces.get(394).isValid() != true ){
- objects.getNearest(Unbuilt).doAction("Build");
- }
- sleep(1500);
- mouse.move(random(101, 122), random(128, 151));
- sleep(600);
- mouse.click(true);
- sleep(500);
- return(1200);
- }
- }
- else if(whatToMake == 1){
- if(objects.getNearest(Unbuilt) != null && inventory.getCount(plank) > 5 ) {
- while(interfaces.get(394).isValid() != true){
- objects.getNearest(Unbuilt).doAction("Build");
- }
- sleep(1500);
- mouse.move(random(100, 120), random(60, 90));
- sleep(600);
- mouse.click(true);
- sleep(500);
- return(1200);
- }
- }
- else if(whatToMake == 2){
- if( objects.getNearest(Unbuilt) != null && inventory.getCount(plank) > 7 ) {
- while(interfaces.get(394).isValid() != true){
- objects.getNearest(Unbuilt).doAction("Build");
- }
- sleep(1200);
- mouse.move(random(290,310), random(131,147));
- sleep(600);
- mouse.click(true);
- sleep(500);
- return(1200);
- }
- }
- return 500;
- }
- //END OF MAIN LOOP//
- private boolean interfacesss() {
- if (isValid(interfaces.get(242),5)) {
- if(interfaces.get(232).containsText("any of those ite")) {
- log("No more Planks! Thanks for using the ConstructionBot");
- stopScript(true);
- return true;
- }
- }
- if (interfaces.get(394).isValid()) {
- WardrobeClick(8234);
- nearWardrobe = getMyPlayer().getLocation();
- return true;
- }
- if (isValid(interfaces.get(232),3)) {//pay from bank
- if(interfaces.get(232).containsText("Pay servant")) {
- interfaces.getComponent(232,3).doClick();
- return true;
- }
- }
- if (isValid(interfaces.get(228),2)) {
- mouse.move(random(250, 280), random(398, 412));
- sleep(random(15,50));
- mouse.click(true);
- return true;
- }
- if (isValid(interfaces.get(241),5)) {
- if (interfaces.get(241).containsText("Yes, madam?") || interfaces.get(241).containsText("Yes, sir?") ||interfaces.get(241).containsText("Your goods") )
- return false;
- interfaces.getComponent(241,5).doClick();
- return true;
- }
- if (isValid(interfaces.get(234),2)) {
- if (inventory.getCount(plank) < 16) {
- interfaces.getComponent(234,2).doClick();
- }
- // else {
- // objects.getNearest(Built).doAction( "Walk here" );
- // }
- return true;
- }
- if (isValid(interfaces.get(232),3)) {
- interfaces.getComponent(232, 3).doClick();
- sleep (random(1000,2000));
- keyboard.sendText("24", true);
- sleep(random(100, 200));
- return true;
- }
- if (isValid(interfaces.get(242),6)) {interfaces.getComponent(242,6).doClick();
- return true;}
- if (interfaces.get(243).containsText("until thou art ready."))
- return false;
- if (isValid(interfaces.get(243), 7)) {
- interfaces.getComponent(243, 7).doClick();
- return true;
- }
- return false;
- }
- public int CountTheInventory(int item, int count, int timeout) {
- long start = System.currentTimeMillis();
- while (System.currentTimeMillis() - start < timeout) {
- if ( inventory.getCount(item) >= count) {
- break;
- }
- }
- return inventory.getCount(item);
- }
- private boolean isValid (RSInterface a, int child) {
- return (a.isValid() && a.getComponent(child).getAbsoluteY() > 30);
- }
- public boolean WardrobeClick(int itemID) {
- RSComponent WardrobeMenu = interfaces.get(394).getComponent(11);
- if (WardrobeMenu == null || WardrobeMenu.getComponents() == null)
- return false;
- for (RSComponent item : WardrobeMenu.getComponents()) {
- if (item != null && item.getComponentID() == itemID) {
- WardrobeMenu.doClick();
- sleep(1000);
- }
- }
- return true;
- }
- public int getThatAnimation(){
- return getMyPlayer().getAnimation();
- }
- public void drawMouse(final Graphics g) {
- if (normal != null) {
- final double mouseX = mouse.getLocation().getX() - 8,
- mouseY = mouse.getLocation().getY() - 8;
- final double mousePressX = mouse.getPressLocation().getX() - 8,
- mousePressY = mouse.getPressLocation().getY() - 8;
- if (System.currentTimeMillis() - mouse.getPressTime() < 400) {
- g.drawImage(clicked, (int) mousePressX, (int) mousePressY, null);
- }
- g.drawImage(normal, (int) mouseX, (int) mouseY, null);
- }
- }
- public void onRepaint(Graphics g) {
- long runTime = 0;
- long seconds = 0;
- long minutes = 0;
- long hours = 0;
- int percent = 0;
- int currentXP = 0;
- int currentLVL = 0;
- int gainedXP = 0;
- int gainedLVL = 0;
- int lapsPerHour = 0;
- int expPerHour = 0;
- runTime = System.currentTimeMillis() - scriptStartTime;
- /* ************************ NEW PAINT ******************* */
- percent = skills.getPercentToNextLevel(Skills.CONSTRUCTION);
- currentXP = skills.getCurrentExp(Skills.CONSTRUCTION);
- currentLVL = skills.getCurrentLevel(Skills.CONSTRUCTION);
- gainedXP = currentXP - startXP;
- gainedLVL = currentLVL - startLvl;
- expPerHour = (int) (3600000.0 / (double) runTime * gainedXP);
- final int fillBar = (int) (4.7 * (double) percent);
- drawMouse(g);
- g.setColor(new Color(32, 0, 0, 175)); // border-top-right
- g.fillRect(23, 387, 470, 26); // border-top-right
- g.setColor(new Color(108, 108, 108, 200)); // border-bottom-left
- g.fillRect(25, 389, 470, 26); // border-bottom-left
- g.setColor(new Color(0, 0, 0, 175));
- g.fillRoundRect(7, 345, 506, 129, 7, 7);
- g.setColor(new Color(139, 0, 0, 175)); // red1
- g.fillRect(24, 388, 470, 26); // red1
- g.setColor(new Color(0, 166, 0, 200)); // green1
- g.fillRect(24, 388, fillBar, 26); // green1
- g.setColor(new Color(207, 58, 58, 175)); // red2
- g.fillRect(24, 401, 470, 13); // red2
- g.setColor(new Color(128, 219, 128, 200)); // green2
- g.fillRect(24, 401, fillBar, 13); // green2
- g.setFont(new Font("Verdana", 0, 14));
- g.setColor(new Color(0, 0, 0, 255));
- g.drawString(percent + "% - " + skills.getExpToNextLevel(Skills.CONSTRUCTION) + "xp remaining", 43, 406);
- // title
- g.setFont(new Font( "Verdana", Font.ITALIC | Font.BOLD , 20 ));
- g.setColor(Color.red);
- g.drawString("DemonButlerOakLarder by Happyfeet",48,375);
- g.setFont(new Font("Verdana", 0, 12));
- g.setColor(new Color(225, 225, 225, 175));
- // left side
- g.drawString("Current Lvl: " + currentLVL + " (+ " + gainedLVL + ")", 24, 445);
- g.drawString("Exp Gained: " + gainedXP + " (" + expPerHour + "/hr)", 24, 460);
- // right side
- g.drawString("Run Time: " + Timer.format(runTime), 250, 445);
- try {
- if (expPerHour > 0) {
- long sTNL = (skills.getExpToNextLevel(Skills.CONSTRUCTION)) / (expPerHour / 3600);
- long hTNL = sTNL / (60 * 60);
- sTNL -= hTNL * (60 * 60);
- long mTNL = sTNL / 60;
- sTNL -= mTNL * 60;
- g.drawString("Level in: " + hTNL + ":" + mTNL + ":" + sTNL + " (" + percent + "%)", 250, 460);
- }
- else {
- g.drawString("Level in: 0:0:0 (" + percent + "%)", 250, 460);
- }
- }
- catch(Exception e) {
- g.drawString("Level in: -1:-1:-1 (" + percent + "%)", 250, 460);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement