Advertisement
Guest User

Untitled

a guest
Jun 27th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.54 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.  
  29. public boolean onStart() {
  30. mouse.setSpeed(random (2,7));
  31. if (game.getCurrentTab() != Game.TAB_INVENTORY) {
  32. game.openTab(Game.TAB_INVENTORY);
  33. }
  34. return true;
  35. }
  36.  
  37. @Override
  38. public int loop() {
  39. if (inventory.isFull()) {
  40. if (atBank()) {
  41. bank();
  42. } else {
  43. if (!getMyPlayer().isMoving() || calc.distanceTo(walking.getDestination()) < random(5, 8)) {
  44. walking.walkPathMM(toBank, 15);
  45. }
  46. }
  47. } else {
  48. if (atGrab()) {
  49. grab();
  50. } else {
  51. //
  52. }
  53. }
  54. return random(1200,1800);
  55. }
  56.  
  57. private boolean atGrab() {
  58. if (calc.distanceTo(beerTile) <= 5) {
  59. return true;
  60. }
  61. return false;
  62. }
  63.  
  64. private void grab() {
  65. RSObject obj = objects.getNearest(shelvesID);
  66. if (obj != null) {
  67. //obj.doClick();
  68. obj.doAction("search");
  69. }
  70. }
  71.  
  72. private boolean atBank() {
  73. if (calc.distanceTo(bankTile) <= 5) {
  74. return true;
  75. }
  76. return false;
  77. }
  78.  
  79. private void bank() {
  80. bank.open();
  81. sleep(random(200,400));
  82. bank.depositAll();
  83. sleep(random(200,400));
  84. bank.close();
  85. sleep(random(200,400));
  86. cups = cups + inventory.getCount(cupID);
  87. }
  88.  
  89. public void onRepaint(Graphics g1) {
  90. final Color color1 = new Color(255, 254, 254);
  91. final Font font1 = new Font("Verdana", 0, 18);
  92. final Font font2 = new Font("Verdana", 1, 18);
  93. Graphics2D g = (Graphics2D)g1;
  94. g.setFont(font1);
  95. g.setColor(color1);
  96. g.drawString("Cups:" + cups, 575, 250);
  97. g.drawString("Cups/h:", 575, 275);
  98. g.drawString("Money:" + money, 575, 300);
  99. g.drawString("Money/h:", 575, 325);
  100. g.drawString("Time:", 575, 350);
  101. g.setFont(font2);
  102. g.drawString("TCupStealer", 575, 400);
  103. g.drawString("by Tooth", 575, 425);
  104. }
  105.  
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement