Thondar

TTPure 0.1

Oct 9th, 2011
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.51 KB | None | 0 0
  1. import org.rsbot.client.RSItem;
  2. import org.rsbot.script.Script;
  3. import org.rsbot.script.ScriptManifest;
  4. import org.rsbot.script.methods.Game;
  5. import org.rsbot.script.methods.Magic;
  6. import org.rsbot.script.methods.Skills;
  7. import org.rsbot.script.wrappers.RSArea;
  8. import org.rsbot.script.wrappers.RSGroundItem;
  9. import org.rsbot.script.wrappers.RSNPC;
  10. import org.rsbot.script.wrappers.RSTile;
  11.  
  12. @ScriptManifest(authors = "Thondar", description = "Trains Pures", keywords = "Pure, Str, Def, Att", name = "TTPure", version = 0.01)
  13.  
  14. public class TTPure extends Script {
  15.  
  16. int defCheck;
  17. int strCheck;
  18. int attCheck;
  19. String status;
  20.  
  21. int lvlCheck;
  22. int[] LUshopkeeper = {520, 521};
  23. int bones = 526;
  24. int featherID = 314;
  25. int[] chickenID = {41, 1017};
  26. int[] weaponID = {1205, 1206, 1321, 1322, 1277, 1278, 1291, 1292, 1279, 1280, 1293, 1294, 1323, 1324, 1207, 1208, 1281, 1282, 1295, 1296, 1217, 1218, 1283, 1284, 1297, 1298, 1327, 1328, 1209, 1210, 1285, 1286, 1299, 1300, 1329, 1330, 1211, 1212, 1287, 1288, 1301, 1302, 1331, 1332, 1213, 1214, 1289, 1290, 1303, 1304, 1333, 1334};
  27.  
  28. RSTile LUshoppath = new RSTile(3214,3242);
  29. RSTile chickenpath = new RSTile(3238,3295);
  30.  
  31. public final RSArea LUArea = new RSArea(new RSTile[] {
  32. new RSTile(3200, 3202), new RSTile(3201, 3238),
  33. new RSTile(3219, 3238), new RSTile(3216, 3303),
  34. new RSTile(3265, 3298), new RSTile(3264, 3203)
  35. });
  36.  
  37. @Override
  38. public boolean onStart() {
  39. walking.setRun(true);
  40. mouse.setSpeed(random(4, 6));
  41. log("Welcome to TTPure");
  42. return true;
  43. }
  44.  
  45.  
  46. public void getStarterKnife(){
  47. RSNPC startervendor = npcs.getNearest(LUshopkeeper);
  48. if(store.isOpen()){
  49. mouse.click(186,74,false);
  50. sleep(300);
  51. mouse.click(191,119,true);
  52. store.close();
  53. }else{
  54. if (startervendor != null) {
  55. if(startervendor.isOnScreen());
  56. startervendor.interact("Trade");
  57. sleep(150, 250);
  58. }
  59. }
  60. }
  61.  
  62. public void lumbridgeTeleport(){
  63. final int lumbridge = Magic.SPELL_HOME_TELEPORT;
  64. if (players.getMyPlayer().getAnimation() == -1)
  65. magic.castSpell(lumbridge);
  66. sleep(13250, 14750);
  67. status = ("Teleporting...");
  68. }
  69.  
  70. public void lootFeather(){
  71. RSGroundItem feather = groundItems.getNearest(featherID);
  72. if(feather != null);
  73. if(feather.isOnScreen());
  74. feather.interact("Take Feather");
  75. sleep(150, 250);
  76. while(getMyPlayer().isMoving())
  77. sleep(100,150);
  78. }
  79.  
  80. public boolean isIdle() {
  81. if (players.getMyPlayer().getAnimation() == -1){
  82. return true;
  83. }else{
  84. return false;
  85. }
  86. }
  87.  
  88. public void attackChicken() {
  89. RSNPC chicken = npcs.getNearest(chickenID);
  90. chicken.interact("attack");
  91. }
  92.  
  93. public void equipWeapon() {
  94. if(inventory.containsOneOf(weaponID));
  95. inventory.getItem(weaponID).interact("wield");
  96. }
  97.  
  98. public void killChicken() {
  99. RSNPC chicken = npcs.getNearest(chickenID);
  100. if(chicken.isOnScreen());
  101. if(!combat.isAttacking(chicken))
  102. if(!chicken.isInteractingWithLocalPlayer())
  103. attackChicken();
  104. }
  105.  
  106. public boolean atChickens() {
  107. RSArea ChickArea = new RSArea(new RSTile(3225, 3287), new RSTile(3238,
  108. 3302));
  109. return ChickArea.contains(getMyPlayer().getLocation());
  110. }
  111.  
  112. public void lvlCheck1() {
  113. if(attCheck <= 9 && strCheck <= 9 && defCheck <= 9);
  114. lvlCheck = 1;
  115. }{
  116. if(attCheck >= 10 || strCheck >= 10 || defCheck >= 10 && attCheck <= 30 && strCheck <= 30 && defCheck <= 30 );
  117. lvlCheck = 2;
  118. }
  119.  
  120. public boolean atLumbridge(){
  121. return LUArea.contains(getMyPlayer().getLocation());
  122. }
  123.  
  124. public boolean atLuShop(){
  125. RSArea LuShopArea = new RSArea(new RSTile(3210, 3238),
  126. new RSTile(3219, 3248));
  127. return LuShopArea.contains(getMyPlayer().getLocation());
  128. }
  129.  
  130. public int loop() {
  131. if(atLumbridge()) {
  132. attCheck = skills.getCurrentLevel(Skills.ATTACK);
  133. defCheck = skills.getCurrentLevel(Skills.DEFENSE);
  134. strCheck = skills.getCurrentLevel(Skills.STRENGTH);
  135. }
  136.  
  137. if(atLumbridge() && !equipment.containsOneOf(weaponID)) {
  138. walking.getPath(LUshoppath).traverse();
  139. log("Walking to Shop");
  140. }
  141. if(atLuShop()) {
  142. getStarterKnife();
  143. sleep(250, 300);
  144. if(inventory.containsOneOf(weaponID));
  145. equipWeapon();
  146. log("Getting Bronze Dagger");
  147. }
  148. if(equipment.containsOneOf(weaponID) && !atChickens()) {
  149. walking.getPath(chickenpath).traverse();
  150. log("Waling to Chickens");
  151. }
  152. if(atChickens()) {
  153. killChicken();
  154. log("Killing Chickens");
  155. }
  156. if(atChickens() && isIdle() == true) {
  157. lootFeather();
  158. log("Looting Feathers");
  159. }
  160. return random(500, 1500);
  161. }
  162.  
  163. public void onFinish() {
  164. log("Thanks for using TTPure");
  165. }
  166. }
Advertisement
Add Comment
Please, Sign In to add comment