Guest User

Untitled

a guest
Dec 18th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. import java.awt.Color;
  2. import java.awt.Graphics;
  3. import java.awt.Graphics2D;
  4. import java.awt.Rectangle;
  5.  
  6. import org.dynamac.bot.api.methods.Client;
  7. import org.dynamac.bot.api.methods.Mouse;
  8. import org.dynamac.bot.api.methods.NPCs;
  9. import org.dynamac.bot.api.wrappers.NPC;
  10. import org.dynamac.bot.script.ScriptDef;
  11. import org.dynamac.bot.api.methods.Skills;
  12.  
  13. public class LinearGuildPickpocketer extends ScriptDef {
  14. public static int STUN_ANIM;
  15. public static int TRAINER_ID;
  16. private final long timeStarted;
  17. private String Status;
  18.  
  19. public LinearGuildPickpocketer() {
  20. System.out
  21. .println("[ - Welcome To Linear Guild Pickpocketer for Dynamac - ]");
  22. System.out.println("[ - Created By Linear - ]");
  23. Mouse.setSpeed(0);
  24. timeStarted = System.currentTimeMillis();
  25.  
  26. }
  27.  
  28. @Override
  29. public void run() {
  30.  
  31. while (true) {
  32. try {
  33. if (Client.getMyPlayer() != null) {
  34. NPC Trainer = NPCs.getNearest(TRAINER_ID);
  35. if (Trainer.getAnimationID() == -1) { // psuedo for now
  36. pickPocket();
  37. } else {
  38. sophiPause();
  39. }
  40. }
  41. sleep(10);
  42. } catch (Exception e) {
  43.  
  44. }
  45. }
  46. }
  47.  
  48. int startExp = Skills.getSkillExperience(Skills.THIEVING_INDEX);
  49.  
  50. public void pickPocket() {
  51. NPC Trainer = NPCs.getNearest(TRAINER_ID);
  52. Status = "Picking Pockets";
  53. while (Trainer.getAnimationID() == -1) {
  54. // trainer.click
  55. }
  56. }
  57.  
  58. public void sophiPause() {
  59. Status = "Sophisticated Sleeping";
  60. }
  61.  
  62. @Override
  63. public void repaint(Graphics g) {
  64. long timeElapsed = System.currentTimeMillis() - this.timeStarted;
  65.  
  66. // Elapsed time
  67.  
  68. int seconds = (int) (timeElapsed / 1000) % 60;
  69. int minutes = (int) ((timeElapsed / (1000 * 60)) % 60);
  70. int hours = (int) ((timeElapsed / (1000 * 60 * 60)) % 24);
  71.  
  72. g.drawString(hours + ":" + minutes + ":" + seconds, 20, 20);
  73.  
  74. // Stuff per hr
  75.  
  76. int stuffPerHour = (int) ((Skills.THIEVING_INDEX - startExp * 3600000D) / timeElapsed);
  77.  
  78. g.drawString("Stuff per hour: " + stuffPerHour, 20, 40);
  79.  
  80. /*
  81. * int xpHour = (int) ((float) (Skills.THIEVING_INDEX - startExp) /
  82. * (float) runTime.getElapsed() * 3600000);
  83. */
  84.  
  85. final Graphics2D g2d = (Graphics2D) g;
  86. Rectangle bg = new Rectangle(5, 20, 260, 150);
  87.  
  88. g2d.setColor(Color.CYAN);
  89. g2d.fill(bg);
  90.  
  91. g2d.setColor(Color.PINK);
  92. g2d.fill(new Rectangle(4, 2, 15, 30));
  93. g2d.fill(new Rectangle(2, 16, 2, 30));
  94. g2d.setColor(Color.BLACK);
  95. g2d.drawString("Linear Guild Pickpocketer!", 80, 35);
  96. g2d.drawString(
  97. "Thieving Level:" + Skills.getLevel(Skills.THIEVING_INDEX), 20,
  98. 60);
  99. g2d.drawString(
  100. "Thieving Experience gained:"
  101. + (Skills.getSkillExperience(Skills.THIEVING_INDEX) - startExp),
  102. 20, 80);
  103. g2d.drawString("Runtime: UNDER CONSTRUCTION", 20, 100); // +
  104. // runTime.toElapsedString(),
  105. // 20, 100);
  106. // g2d.drawString("XP/Hr: " + xpHour, 20, 120);
  107. g2d.drawString("Status: " + Status, 20, 140);
  108.  
  109. }
  110. }
Add Comment
Please, Sign In to add comment