Guest User

Untitled

a guest
Jun 24th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.71 KB | None | 0 0
  1. package com.scripts;
  2.  
  3. import java.awt.*;
  4.  
  5. import com.kbot2.handlers.eventSystem.eventListeners.PaintListener;
  6. import com.kbot2.handlers.eventSystem.eventListeners.ServerMessageListener;
  7. import com.kbot2.scriptable.Script;
  8. import com.kbot2.scriptable.methods.wrappers.Obj;
  9.  
  10. public class iEssReceiver extends Script implements PaintListener, ServerMessageListener {
  11.  
  12. boolean TRADE = false;
  13. int status = 0;
  14. Rectangle ACCEPT = new Rectangle (9, 442, 483, 13);
  15.  
  16. Obj altar;
  17.  
  18.  
  19. public boolean active() {
  20. return true;
  21. }
  22.  
  23. @Override
  24. public boolean onStart() {
  25. return true;
  26. }
  27. public void onServerMessage(String trade) {
  28. if (trade.contains(":tradereq:")) {
  29. TRADE = true;}
  30. }
  31.  
  32.  
  33. public int loop() {
  34. switch (status) {
  35.  
  36. case 0: //checks
  37. log("status = 0");
  38. if (inventory.contains(1436)) {
  39. status = 1; }
  40. if (TRADE = true) {
  41. clickMouse(250, 448, 200, 5, true);
  42. TRADE = false;
  43. sleep(400, 600);
  44. status = 2; }
  45.  
  46.  
  47. return random(600, 1000);
  48.  
  49. case 1: //craft runes
  50. log("status = 1");
  51. altar = getClosestObject(20, 2478);
  52. if (inventory.contains(1436)) {
  53. altar.doAction("Craft-rune"); }
  54. if (!inventory.contains(1436)) {
  55. status = 0; }
  56.  
  57.  
  58. return random(200, 300);
  59.  
  60. case 2://trading
  61. log("status = 2");
  62. if (interfaces.interfaceExists(335, 16)) {
  63. inventory.atItem("Offer-X", 1437);
  64. sleep(1000, 1400);
  65. sendText("26", true);
  66. status = 3;}
  67.  
  68.  
  69. return random(200, 300);
  70.  
  71. case 3://more trading
  72. log("status = 3");
  73. if (interfaces.interfaceExists(335, 16)) {
  74. interfaces.getInterface(335, 16).doAction("Accept");
  75. sleep(400, 600); }
  76. if (interfaces.interfaceExists(334, 20)) {
  77. interfaces.getInterface(334, 20).doAction("Accept");
  78. sleep(500, 800); }
  79. if (inventory.contains(1436)) {
  80. status = 0; }
  81.  
  82. return random(200, 300);
  83. }
  84. return random(200, 300);
  85.  
  86. }
  87.  
  88. void clickMouse(int x, int y, int randx, int randy, boolean button) {
  89. mouse.moveMouse(x, y, randx, randy);
  90. sleep(100);
  91. mouse.clickMouse(button);
  92.  
  93. }
  94.  
  95. public String getName() {
  96. return "iEssReceiver";
  97. }
  98.  
  99. public String getAuthor() {
  100. return "Ryan";
  101. }
  102.  
  103. public String getDescription() {
  104. return "Takes the ess from accounts using iEssWalker and creates air runes";
  105. }
  106.  
  107. public void onRepaint(Graphics w) {
  108.  
  109. }
  110. }
Add Comment
Please, Sign In to add comment