Thondar

s

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