Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. import java.awt.event.ItemEvent;
  2. import java.awt.*;
  3.  
  4. import org.rsbot.script.Script;
  5. import org.rsbot.script.ScriptManifest;
  6. import org.rsbot.script.methods.*;
  7. import org.rsbot.script.wrappers.*;
  8. import org.rsbot.event.listeners.PaintListener;
  9.  
  10. @ScriptManifest(authors = "Tooth", name = "TBeerStealer")
  11. public class TBeerStealer extends Script /* implements PaintListener */{
  12.  
  13. RSTile bankTile = new RSTile(3270, 3167);
  14. RSTile beerTile = new RSTile(3319, 3137);
  15. int cupID = 1919;
  16. int shelvesID = 21794;
  17. int bankBoothID = 35647;
  18. int startTime = 0;
  19. int time = startTime;
  20. int cups = 0;
  21. int money = cups * grandExchange.getMarketPrice(cupID);
  22. int cupsh = cups / time;
  23. private final RSTile[] toBank = {
  24. new RSTile(3311, 3146), new RSTile(3297, 3149),
  25. new RSTile(3286, 3151), new RSTile(3277, 3157),
  26. new RSTile(3270, 3167)
  27. };
  28. // RSTile[] toBank = walking.randomizePath(bankPath, 2, 2);
  29.  
  30. public boolean onStart() {
  31. if (game.getCurrentTab() != Game.TAB_INVENTORY) {
  32. game.openTab(Game.TAB_INVENTORY);
  33. }
  34. mouse.setSpeed(random (2,7));
  35. return true;
  36. }
  37.  
  38. @Override
  39. public int loop() {
  40. if (inventory.isFull()) {
  41. if (atBank()) {
  42. bank();
  43. } else {
  44. if (!getMyPlayer().isMoving() || calc.distanceTo(walking.getDestination()) < random(5, 8)) {
  45. walking.walkPathMM(toBank, 2, 2);
  46. }
  47. }
  48. } else {
  49. if (atGrab()) {
  50. grab();
  51. } else {
  52. //
  53. }
  54. }
  55. return random(1200,1800);
  56. }
  57.  
  58. private boolean atGrab() {
  59. if (calc.distanceTo(beerTile) <= 5) {
  60. return true;
  61. }
  62. return false;
  63. }
  64.  
  65. private void grab() {
  66. RSObject obj = objects.getNearest(shelvesID);
  67. if (obj != null) {
  68. //obj.doClick();
  69. obj.doAction("search");
  70. }
  71. }
  72.  
  73. private boolean atBank() {
  74. if (calc.distanceTo(bankTile) <= 5) {
  75. return true;
  76. }
  77. return false;
  78. }
  79.  
  80. private void bank() {
  81. bank.open();
  82. sleep(random(200,400));
  83. bank.depositAll();
  84. sleep(random(200,400));
  85. bank.close();
  86. sleep(random(200,400));
  87. cups = cups + inventory.getCount(cupID);
  88. }
  89.  
  90. public void onRepaint(Graphics g1) {
  91. final Color color1 = new Color(255, 254, 254);
  92. final Font font1 = new Font("Verdana", 0, 18);
  93. final Font font2 = new Font("Verdana", 1, 18);
  94. Graphics2D g = (Graphics2D)g1;
  95. g.setFont(font1);
  96. g.setColor(color1);
  97. g.drawString("Cups:" + cups, 575, 250);
  98. g.drawString("Cups/h:", 575, 275);
  99. g.drawString("Money:" + money, 575, 300);
  100. g.drawString("Money/h:", 575, 325);
  101. g.drawString("Time:", 575, 350);
  102. g.setFont(font2);
  103. g.drawString("TCupStealer", 575, 400);
  104. g.drawString("by Tooth", 575, 425);
  105. }
  106.  
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement