Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import javax.swing.Icon;
- import javax.swing.JOptionPane;
- import java.awt.Dialog;
- import java.util.ArrayList;
- import java.util.Map;
- import org.rsbot.bot.*;
- import org.rsbot.event.listeners.*;
- import org.rsbot.script.*;
- import org.rsbot.script.wrappers.*;
- @ScriptManifest(authors = "tssguy123", name = "Tssguy123's First Script", version = 1.0, category = "Other", description = "My First Script!")
- public class TssguysFirst extends Script implements PaintListener{
- int ironId = 11955;
- int pickId = 1275;
- public long startTime = System.currentTimeMillis();
- private String status = "";
- public int startexp;
- public void onRepaint(Graphics g) {
- if (isLoggedIn()) {
- int xpGained = 0;
- if ( startexp == 0) {
- startexp = skills.getCurrentSkillExp(STAT_MINING);
- }
- xpGained = skills.getCurrentSkillExp(STAT_MINING) - startexp;
- 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);
- g.setColor(Color.red);
- g.drawString("Time running: " + hours + ":" + minutes + ":" + seconds + "." , 9, 300);
- g.drawString("Status: " + status , 9, 315);
- g.drawString("XP Gained: " +xpGained, 9, 330);
- g.drawString("Approximatly: " + (int)xphour + "Gained An Hour.", 9, 345);
- float xpsec = 0;
- if ((minutes > 0 || hours > 0 || seconds > 0) && exp > 0) {
- xpsec = ((float) exp)/(float)(seconds + (minutes*60) + (hours*60*60));
- }
- float xpmin = xpsec * 60;
- float xphour = xpmin * 60;
- }
- }
- public int loop(){
- if(isInventoryFull()){
- status = "Dropping";
- dropAllExcept(pickId);
- return 500;
- }
- RSObject iron = getNearestObjectByID(iron Id);
- if(iron == null){
- return 500;
- }
- atObject(iron,"Mine")
- status = "Mining";
- return 100;
- }
- public void onFinish() {
- log("Thank you for using my script!")
- }
- public boolean onStart(final Map<String, String> args) {
- startTime = System.currentTimeMillis();
- log("Hello!")
- return true;
- }
- }
Add Comment
Please, Sign In to add comment