Thondar

s

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