Guest User

Untitled

a guest
Jun 19th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.84 KB | None | 0 0
  1. import java.awt.*;
  2. import java.util.*;
  3. import com.speljohan.rsbot.script.*;
  4. import com.speljohan.rsbot.bot.*;
  5. import com.speljohan.rsbot.script.wrappers.*;
  6. import com.speljohan.rsbot.event.listeners.*;
  7. import com.speljohan.rsbot.event.events.*;
  8. import com.sun.org.apache.bcel.internal.generic.IfInstruction;
  9.  
  10. public class Druidkiller extends Script{
  11.  
  12. public int druidID = 181;
  13. public int agility = 11844;
  14. public int booth = 11758;
  15.  
  16. public int ladderup = 32015;
  17. public int ladderdown = 20987;
  18.  
  19. public int marrentillID = 201;
  20. public int harralanderID = 205;
  21. public int ranarrID = 207;
  22. public int tarrominID = 203;
  23. public int guamID = 199;
  24. public int lantadymeID = 2485;
  25. public int iritID = 209;
  26. public int cadantineID = 215;
  27. public int dwarfWeedID = 217;
  28. public int kwuarmID = 213;
  29. public int avantoeID = 211;
  30. public int snapeID = 231;
  31.  
  32. RSTile banktoagility = new RSTile(2936, 3355);
  33.  
  34. RSTile[] agilitytoladder = { new RSTile(2919, 3366) , new RSTile(2904, 3377),
  35. new RSTile(2893, 3388) , new RSTile(2886, 3397 )};
  36.  
  37. RSTile[] laddertodruids = { new RSTile(2885, 9812) , new RSTile(2884, 9826),
  38. new RSTile(2884, 9840) , new RSTile(2897, 9849) , new RSTile(2914, 9850) , new RSTile(2930, 9848)};
  39.  
  40. RSTile[] druidstoladder = { new RSTile(2917, 9850) , new RSTile(2901, 9848),
  41. new RSTile(2887, 9844) , new RSTile(2884, 9833) , new RSTile(2884, 9818 ) , new RSTile(2885, 9803)};
  42.  
  43. RSTile[] laddertoagility = { new RSTile(2898, 3389) , new RSTile(2907, 3375),
  44. new RSTile(2919, 3362) , new RSTile(2928, 3355) , new RSTile(2934, 3354)};
  45.  
  46. RSTile agilitytobank = new RSTile(2946, 3369);
  47.  
  48.  
  49. public String getName(){
  50. return "Druid Killer";
  51. }
  52.  
  53. public String getAuthor(){
  54. return "Eric & Tmoe";
  55. }
  56.  
  57. public String getScriptCategory(){
  58. return "Combat";
  59. }
  60.  
  61. public double getVersion(){
  62. return 1.0;
  63. }
  64.  
  65. public boolean onStart(Map<String, String> args) {
  66. return true;
  67. }
  68.  
  69.  
  70.  
  71. public void onFinish(){
  72. return;
  73. }
  74.  
  75. public boolean needToBank(){
  76. return isInventoryFull();
  77.  
  78. }
  79.  
  80. public boolean atBank() {
  81. RSObject bank = getNearestObjectByID(booth);
  82. if(bank == null) return false;
  83.  
  84. return tileOnScreen(bank.getLocation());
  85. }
  86.  
  87. public boolean handleBank(){
  88. RSObject bankBooth = getNearestObjectByID(booth);
  89.  
  90. if(bank == null)
  91. return false; //We cannot find a bank booth.
  92.  
  93. if(bank.isOpen()){
  94. bank.depositAll();
  95. }else{
  96. atObject(bankBooth, "uickly");
  97. }
  98.  
  99. return true;
  100. }
  101. public boolean druidstoladder(){
  102. RSTile[] randomizedPath = randomizePath(druidstoladder, 2, 2);
  103. RSTilePath path = new RSTilePath(randomizedPath, this);
  104. try {
  105. return path.walkToEnd();
  106. } catch (InterruptedException e) {
  107. // TODO Auto-generated catch block
  108. e.printStackTrace();
  109. }
  110. return false;
  111. }
  112. public boolean laddertoagility(){
  113. RSTile[] randomizedPath = randomizePath(laddertoagility, 2, 2);
  114. RSTilePath path = new RSTilePath(randomizedPath, this);
  115. try {
  116. return path.walkToEnd();
  117. } catch (InterruptedException e) {
  118. // TODO Auto-generated catch block
  119. e.printStackTrace();
  120. }
  121. return false;
  122. }
  123. public boolean agilitytobank(){
  124. RSTile[] randomizedPath = randomizePath(agilitytobank, 2, 2);
  125. RSTilePath path = new RSTilePath(randomizedPath, this);
  126. try {
  127. return path.walkToEnd();
  128. } catch (InterruptedException e) {
  129. // TODO Auto-generated catch block
  130. e.printStackTrace();
  131. }
  132. return false;
  133. }
  134. public boolean banktoagility(){
  135. RSTile[] randomizedPath = randomizePath(banktoagility, 2, 2);
  136. RSTilePath path = new RSTilePath(randomizedPath, this);
  137. try {
  138. return path.walkToEnd();
  139. } catch (InterruptedException e) {
  140. // TODO Auto-generated catch block
  141. e.printStackTrace();
  142. }
  143. return false;
  144. }
  145. public boolean agilitytoladder(){
  146. RSTile[] randomizedPath = randomizePath(agilitytoladder, 2, 2);
  147. RSTilePath path = new RSTilePath(randomizedPath, this);
  148. try {
  149. return path.walkToEnd();
  150. } catch (InterruptedException e) {
  151. // TODO Auto-generated catch block
  152. e.printStackTrace();
  153. }
  154. return false;
  155. }
  156. public boolean laddertodruids(){
  157. RSTile[] randomizedPath = randomizePath(laddertodruids, 2, 2);
  158. RSTilePath path = new RSTilePath(randomizedPath, this);
  159. try {
  160. return path.walkToEnd();
  161. } catch (InterruptedException e) {
  162. // TODO Auto-generated catch block
  163. e.printStackTrace();
  164. }
  165. return false;
  166. }
  167. private boolean ATTACKNPC(final RSNPC npc, final String action) { // edited
  168. // ruskis
  169. // a lil
  170. final RSTile tile = npc.getLocation();
  171. tile.randomizeTile(1, 1);
  172. try {
  173. final int hoverRand = random(8, 13);
  174. for (int i = 0; i < hoverRand; i++) {
  175. final Point screenLoc = npc.getScreenLocation();
  176. if (!pointOnScreen(screenLoc)) {
  177. setCameraRotation(getCameraAngle() + random(-35, 150));
  178. return true;
  179. }
  180.  
  181. moveMouse(screenLoc, 15, 15);
  182.  
  183. final List<String> menuItems = getMenuItems();
  184. if (menuItems.isEmpty() || menuItems.size() <= 1) {
  185. continue;
  186. }
  187. if (menuItems.get(0).toLowerCase().contains(
  188. npc.getName().toLowerCase())
  189. && getMyPlayer().getInteracting() == null) {
  190. clickMouse(true);
  191. return true;
  192. } else {
  193. for (int a = 1; a < menuItems.size(); a++) {
  194. if (menuItems.get(a).toLowerCase().contains(
  195. npc.getName().toLowerCase())
  196. && getMyPlayer().getInteracting() == null) {
  197. clickMouse(false);
  198. return atMenu(action);
  199. }
  200. }
  201. }
  202. }
  203.  
  204. } catch (final Exception e) {
  205. log.warning("ATTACKNPC(RSNPC, String) error: " + e);
  206. return false;
  207. }
  208. return false;
  209. }
  210. public boolean isInArea(int[] points) {
  211. // maxX minY minX maxY
  212. int x = getMyPlayer().getLocation().getX();
  213. int y = getMyPlayer().getLocation().getY();
  214. if (x <= points[0] && y >= points[1] && x >= points[2] && y <= points[3]) {
  215. return true;
  216. }
  217. return false;
  218. }
  219.  
  220. public int loop() {
  221. if(needToBank()){
  222. RSObject bankBooth = getNearestObjectByID(booth);
  223. if(bank.isOpen()){
  224. depositHerbs();
  225. return 800;
  226. }
  227. if(!bank.isOpen() && bankBooth != null){
  228. openBank();
  229. return 800;
  230. }else{
  231. if(druidstoladder()){
  232. return 800;
  233. }else{
  234. RSObject LadderUp = getNearestObjectByID( 32015 );
  235. if(LadderUp != null){
  236. atObject(LadderUp, "Climb Up");
  237. return 800;
  238. }else{
  239. if(laddertoagility()){
  240. return 900;
  241. }else{
  242. RSObject wall = getNearestObjectByID( 11844 );
  243. if(agility != null){
  244. atObject(LadderUp, "Climb over");
  245. return 800;
  246. }else{
  247. if(agilitytobank()){
  248. return 700;
  249. }
  250. }
  251. }
  252. }
  253. }
  254. }
  255. } else if (in druid area) {
  256. //attack npc
  257. }
  258. } else {
  259. banktoagility()){
  260. return 900;
  261.  
  262. }else{
  263. RSObject agility = getNearestObjectByID( 11844 );
  264. if(agility != null){
  265. atObject(Wall, "Climb Over");
  266. return 800;
  267. }
  268. }else{
  269. agilitytoladder()){
  270. return 700;
  271.  
  272. }else{
  273. RSObject ladderdown = getNearestObjectByID( 11844 );
  274. if(ladderdown != null){
  275. atObject(Ladder, "Climb Down");
  276. return 800;
  277. }else{
  278. laddertodruids()){
  279. return 800;
  280. }
  281. }
Add Comment
Please, Sign In to add comment