Thondar

s

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