Thondar

s

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