Guest User

Untitled

a guest
Jul 19th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. import java.awt.*;
  2.  
  3. import javax.swing.Icon;
  4. import javax.swing.JOptionPane;
  5. import java.awt.Dialog;
  6. import java.util.ArrayList;
  7. import java.util.Map;
  8.  
  9. import org.rsbot.bot.*;
  10. import org.rsbot.event.listeners.*;
  11. import org.rsbot.script.*;
  12. import org.rsbot.script.wrappers.*;
  13.  
  14. @ScriptManifest(authors = "tssguy123", name = "Tssguy123's First Script", version = 1.0, category = "Other", description = "My First Script!")
  15. public class TssguysFirst extends Script implements PaintListener{
  16. int ironId = 11955;
  17. int pickId = 1275;
  18. public long startTime = System.currentTimeMillis();
  19. private String status = "";
  20. public int startexp;
  21.  
  22. public void onRepaint(Graphics g) {
  23. if (isLoggedIn()) {
  24. int xpGained = 0;
  25. if ( startexp == 0) {
  26. startexp = skills.getCurrentSkillExp(STAT_MINING);
  27. }
  28. xpGained = skills.getCurrentSkillExp(STAT_MINING) - startexp;
  29. long millis = System.currentTimeMillis() - startTime;
  30. long hours = millis / (1000 * 60 * 60);
  31. millis -= hours * (1000 * 60 * 60);
  32. long minutes = millis / (1000 * 60);
  33. millis -= minutes * (1000 * 60);
  34. long seconds = millis / 1000;
  35. long minutes2 = minutes + (hours * 60);
  36. g.setColor(Color.red);
  37. g.drawString("Time running: " + hours + ":" + minutes + ":" + seconds + "." , 9, 300);
  38. g.drawString("Status: " + status , 9, 315);
  39. g.drawString("XP Gained: " +xpGained, 9, 330);
  40. g.drawString("Approximatly: " + (int)xphour + "Gained An Hour.", 9, 345);
  41. float xpsec = 0;
  42. if ((minutes > 0 || hours > 0 || seconds > 0) && exp > 0) {
  43. xpsec = ((float) exp)/(float)(seconds + (minutes*60) + (hours*60*60));
  44. }
  45. float xpmin = xpsec * 60;
  46. float xphour = xpmin * 60;
  47. }
  48. }
  49.  
  50. public int loop(){
  51. if(isInventoryFull()){
  52. status = "Dropping";
  53. dropAllExcept(pickId);
  54. return 500;
  55. }
  56. RSObject iron = getNearestObjectByID(iron Id);
  57. if(iron == null){
  58. return 500;
  59. }
  60. atObject(iron,"Mine")
  61. status = "Mining";
  62. return 100;
  63. }
  64.  
  65.  
  66. public void onFinish() {
  67. log("Thank you for using my script!")
  68.  
  69. }
  70. public boolean onStart(final Map<String, String> args) {
  71. startTime = System.currentTimeMillis();
  72. log("Hello!")
  73. return true;
  74. }
  75.  
  76. }
Add Comment
Please, Sign In to add comment