Guest User

Untitled

a guest
Jun 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. private boolean ATTACKNPC(final RSNPC npc, final String action) { // edited
  2. // ruskis
  3. // a lil
  4. final RSTile tile = npc.getLocation();
  5. tile.randomizeTile(1, 1);
  6. try {
  7. final int hoverRand = random(8, 13);
  8. for (int i = 0; i < hoverRand; i++) {
  9. final Point screenLoc = npc.getScreenLocation();
  10. if (!pointOnScreen(screenLoc)) {
  11. setCameraRotation(getCameraAngle() + random(-35, 150));
  12. return true;
  13. }
  14.  
  15. moveMouse(screenLoc, 15, 15);
  16.  
  17. final List<String> menuItems = getMenuItems();
  18. if (menuItems.isEmpty() || menuItems.size() <= 1) {
  19. continue;
  20. }
  21. if (menuItems.get(0).toLowerCase().contains(
  22. npc.getName().toLowerCase())
  23. && getMyPlayer().getInteracting() == null) {
  24. clickMouse(true);
  25. return true;
  26. } else {
  27. for (int a = 1; a < menuItems.size(); a++) {
  28. if (menuItems.get(a).toLowerCase().contains(
  29. npc.getName().toLowerCase())
  30. && getMyPlayer().getInteracting() == null) {
  31. clickMouse(false);
  32. return atMenu(action);
  33. }
  34. }
  35. }
  36. }
  37.  
  38. } catch (final Exception e) {
  39. log.warning("ATTACKNPC(RSNPC, String) error: " + e);
  40. return false;
  41. }
  42. return false;
  43. }
Add Comment
Please, Sign In to add comment