Thondar

s

Jun 10th, 2011
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.63 KB | None | 0 0
  1. import java.awt.*;
  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;
  24.  
  25. long starttime;
  26.  
  27. private boolean restCheck;
  28. private boolean antibanCheck;
  29.  
  30. @Override
  31. public boolean onStart() {
  32. goldcheck = inventory.getCount(true, gold);
  33. return true;
  34. }
  35.  
  36.  
  37. public void bank() {
  38. RSNPC banker = npcs.getNearest(bankerID);
  39. if (restCheck == true) {
  40. rest();
  41. }
  42. if (bank.isOpen() && inventory.contains(leatherID))
  43. bank.depositAllExcept(gold);
  44. Inventory = inventory.getCount(leatherID);
  45. leatherGot += Inventory;
  46. sleep(500, 750);
  47. if (inventory.getCount(gold) < 1000 && bank.isOpen());
  48. log ("gold check");
  49. bank.withdraw(gold, 10000);
  50. sleep(500, 750);
  51. if (bank.isOpen() && !inventory.contains(leatherID)) {
  52. bank.withdraw(cowhide, 27);
  53. sleep(500, 750);
  54. bank.close();
  55. } else {
  56. if(banker != null) {
  57. if(banker.isOnScreen())
  58. banker.doAction("Bank Banker");{
  59. } sleep(1800, 2100);
  60. } else {
  61. walking.getPath(bankTile).traverse();
  62. }
  63. }
  64. }
  65. public void tan(){
  66. RSNPC tanner = npcs.getNearest(tannerID);
  67. if (tanner != null) {
  68. if(tanner.isOnScreen())
  69. tanner.doAction("Trade Ellis");{
  70. sleep(800, 1100);
  71. mouse.click(205,108,false);
  72. sleep(350, 500);
  73. mouse.click(205,198,true);
  74. } sleep(500, 800);
  75. }
  76. }
  77.  
  78. public boolean atBank(){
  79. RSArea BankArea = new RSArea(new RSTile(3265, 3160),
  80. new RSTile(3272, 3273));
  81. return BankArea.contains(getMyPlayer().getLocation());
  82. }
  83. public boolean atTanner(){
  84. RSArea TannerArea = new RSArea(new RSTile(3270, 3189),
  85. new RSTile(3277, 3194));
  86. return TannerArea.contains(getMyPlayer().getLocation());
  87. }
  88.  
  89. private void rest() {
  90. if(restCheck == true);
  91. if(walking.getEnergy() < 30)
  92. walking.rest(random(70,95));
  93. }
  94. private void antiBan() {
  95. int t = random(0, 10);
  96. int r = random(0, 15);
  97. if (t == 7);
  98. if (r == 2) {
  99. mouse.moveSlightly();
  100. sleep(500, 800);
  101. }
  102.  
  103. if (r == 3) {
  104. mouse.moveRandomly(10, 50);
  105. }
  106.  
  107. if (r == 5) {
  108. camera.moveRandomly(random(350, 650));
  109. }
  110.  
  111. if (r == 6) {
  112. camera.moveRandomly(random(450, 750));
  113. }
  114.  
  115. if (r == 8) {
  116. camera.moveRandomly(random(150, 450));
  117. }
  118.  
  119. if (r == 10) {
  120. camera.moveRandomly(random(750, 1250));
  121. }
  122.  
  123. if (r == 12) {
  124. mouse.moveOffScreen();
  125. }
  126.  
  127. if (r == 14) {
  128. camera.moveRandomly(random(500, 900));
  129. }
  130. }
  131.  
  132. public int loop() {
  133. if(atBank() && !inventory.contains(cowhide)){
  134. bank();
  135. log ("1");
  136. }
  137. if(atBank() && inventory.contains(leatherID)){
  138. bank();
  139. log ("2");
  140. }
  141. if(atTanner() && inventory.contains(cowhide)){
  142. tan();
  143. log ("3");
  144. }
  145. if(!atTanner() && inventory.contains(cowhide)){
  146. walking.walkTo(tannerTile);
  147. log ("4");
  148. }
  149. if(!atBank() && !inventory.contains(cowhide)){
  150. walking.walkTo(bankTile);
  151. log ("5");
  152. if(antibanCheck == true) {
  153. antiBan();
  154. }
  155. }
  156. return random(500, 1500);
  157.  
  158. }
  159.  
  160. @Override
  161. public void onFinish() {
  162. }
  163. //START: Code generated using Enfilade's Easel
  164. private final Color color1 = new Color(0, 0, 0);
  165. private final Color color2 = new Color(255, 255, 255);
  166.  
  167. private final BasicStroke stroke1 = new BasicStroke(1);
  168.  
  169. private final Font font1 = new Font("Arial", 1, 14);
  170.  
  171. public void onRepaint(Graphics g1) {
  172. Graphics2D g = (Graphics2D)g1;
  173. g.setColor(color1);
  174. g.fillOval(566, 29, 123, 115);
  175. g.setStroke(stroke1);
  176. g.drawOval(566, 29, 123, 115);
  177. g.setFont(font1);
  178. g.setColor(color2);
  179. g.drawString("Check: " + goldcheck, 572, 95);
  180. }
  181. //END: Code generated using Enfilade's Easel
  182.  
  183. }
Advertisement
Add Comment
Please, Sign In to add comment