Thondar

ss

Jun 10th, 2011
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.72 KB | None | 0 0
  1. import org.rsbot.script.*;
  2. import org.rsbot.script.wrappers.*;
  3.  
  4. @ScriptManifest(authors = {"TT Production"}, keywords = {"Cowhide Tanner"}, name = "TT Tanner", description = "A Cowhide Tanner", version = 0.1)
  5.  
  6. public class TTTanner extends Script{
  7.  
  8. RSTile tannerTile = new RSTile (3274,3191);
  9. RSTile bankTile = new RSTile (3270,3166);
  10.  
  11. int cowhide = 1739;
  12. int gold = 995;
  13. int Inventory = 0;
  14. int bankerID = 496;
  15. int tannerID = 2824;
  16. int leatherID;
  17. int leatherGot;
  18.  
  19. private boolean restCheck;
  20. private boolean antibanCheck;
  21. boolean leftClick;
  22.  
  23. @Override
  24. public boolean onStart() {
  25. return true;
  26. }
  27.  
  28. public void bank() {
  29. RSNPC banker = npcs.getNearest(bankerID);
  30. if (restCheck == true) {
  31. rest();
  32. }
  33. if (bank.isOpen() && inventory.contains(leatherID))
  34. bank.depositAll();
  35. Inventory = inventory.getCount(leatherID);
  36. leatherGot += Inventory;
  37. sleep(500, 750);
  38. if (bank.isOpen() && inventory.getCount(gold) < 5000);
  39. bank.withdraw(gold, 10000);
  40. sleep(500, 750);
  41. if (bank.isOpen() && !inventory.contains(leatherID)) {
  42. bank.withdraw(cowhide, 27);
  43. sleep(500, 750);
  44. bank.close();
  45. } else {
  46. if(banker != null) {
  47. if(banker.isOnScreen())
  48. banker.doAction("Bank Banker");{
  49. } sleep(1800, 2100);
  50. } else {
  51. walking.getPath(bankTile).traverse();
  52. }
  53. }
  54. }
  55. public void tan(){
  56. RSNPC tanner = npcs.getNearest(tannerID);
  57. if (tanner != null) {
  58. if(tanner.isOnScreen())
  59. tanner.doAction("Trade Ellis");{
  60. sleep(500, 700);
  61. mouse.click(205,108,false);
  62. sleep(150, 300);
  63. mouse.click(205,198,true);
  64.  
  65. } sleep(1800, 2100);
  66. }
  67. }
  68.  
  69. public boolean atBank(){
  70. RSArea BankArea = new RSArea(new RSTile(3265, 3160),
  71. new RSTile(3272, 3273));
  72. return BankArea.contains(getMyPlayer().getLocation());
  73. }
  74. public boolean atTanner(){
  75. RSArea TannerArea = new RSArea(new RSTile(3270, 3189),
  76. new RSTile(3277, 3194));
  77. return TannerArea.contains(getMyPlayer().getLocation());
  78. }
  79.  
  80. private void rest() {
  81. if(restCheck == true);
  82. if(walking.getEnergy() < 30)
  83. walking.rest(random(70,95));
  84. }
  85. private void antiBan() {
  86. int t = random(0, 10);
  87. int r = random(0, 15);
  88. if (t == 7);
  89. if (r == 2) {
  90. mouse.moveSlightly();
  91. sleep(500, 800);
  92. }
  93.  
  94. if (r == 3) {
  95. mouse.moveRandomly(10, 50);
  96. }
  97.  
  98. if (r == 5) {
  99. camera.moveRandomly(random(350, 650));
  100. }
  101.  
  102. if (r == 6) {
  103. camera.moveRandomly(random(450, 750));
  104. }
  105.  
  106. if (r == 8) {
  107. camera.moveRandomly(random(150, 450));
  108. }
  109.  
  110. if (r == 10) {
  111. camera.moveRandomly(random(750, 1250));
  112. }
  113.  
  114. if (r == 12) {
  115. mouse.moveOffScreen();
  116. }
  117.  
  118. if (r == 14) {
  119. camera.moveRandomly(random(500, 900));
  120. }
  121. }
  122.  
  123. public int loop() {
  124. if(atBank() && !inventory.contains(cowhide)){
  125. bank();
  126. log ("1");
  127. }
  128. if(atBank() && inventory.contains(leatherID)){
  129. bank();
  130. log ("2");
  131. }
  132. if(atTanner() && inventory.contains(cowhide)){
  133. tan();
  134. log ("3");
  135. }
  136. if(!atTanner() && inventory.contains(cowhide)){
  137. walking.walkTo(tannerTile);
  138. log ("4");
  139. }
  140. if(!atBank() && !inventory.contains(cowhide)){
  141. walking.walkTo(bankTile);
  142. log ("5");
  143. if(antibanCheck == true) {
  144. antiBan();
  145. }
  146. }
  147. return random(500, 1500);
  148.  
  149. }
  150.  
  151. @Override
  152. public void onFinish() {
  153. }
  154.  
  155. }
Advertisement
Add Comment
Please, Sign In to add comment