Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. import org.osbot.rs07.api.ui.RS2Widget;
  2. import org.osbot.rs07.script.Script;
  3. import org.osbot.rs07.script.ScriptManifest;
  4.  
  5. import java.util.Arrays;
  6. import java.util.List;
  7.  
  8. @ScriptManifest(author = "Malcolm", info = "", name = "Wildyattacker number two", version = 1.0, logo = "")
  9. public class wildyskip extends Script {
  10.  
  11. private boolean clickedSkip = false;
  12.  
  13. private String[] array = {"adriatric511"};
  14.  
  15. public int onLoop() throws InterruptedException {
  16.  
  17. if (!getCombat().isFighting()) {
  18. getTarget();
  19. } else {
  20. // fight();
  21. }
  22.  
  23. return 1500;
  24.  
  25. }
  26.  
  27. public void getTarget() throws InterruptedException {
  28.  
  29. if (getWidgets().matchingTextColour(90, 16777215) != null && !clickedSkip) {
  30. if (!getWidgets().matchingTextColour(90, 16777215).isEmpty()) {
  31. RS2Widget targetWidget = getWidgets().matchingTextColour(90, 16777215).get(0);
  32. for (int i = 0; i < array.length; i++) {
  33. if (!targetWidget.getMessage().contains(array[i])
  34. && !targetWidget.getMessage().contentEquals("None")) {
  35. if (getWidgets().containingActions(90, "Abandon target") != null) {
  36. if (!getWidgets().containingActions(90, "Abandon target").isEmpty()) {
  37. RS2Widget skipWidget = getWidgets().containingActions(90, "Abandon target").get(0);
  38. if (skipWidget.interact("Abandon target")) {
  39. clickedSkip = true;
  40.  
  41. }
  42. }
  43. }
  44. } else {
  45. // attack Target
  46. }
  47. }
  48. }
  49. } else if (clickedSkip) {
  50. if (getDialogues().isPendingContinuation()) {
  51. if (getDialogues().clickContinue()) {
  52. sleep(2000);
  53. // Sleep until you have a new target
  54. }
  55. } else {
  56. getKeyboard().typeString("1", false);
  57. sleep(2000);
  58. // Sleep until you have a new target
  59. clickedSkip = false;
  60. }
  61. }
  62. }
  63.  
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement