Guest User

Untitled

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