Thondar

s

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