Thondar

s

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