Advertisement
Guest User

Untitled

a guest
May 5th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.90 KB | None | 0 0
  1. //This function will drive the player to click on the combat style matching the text in String combat_style
  2.     public static void changeCombatStyle(MethodProvider api, String combat_style)
  3.     {
  4.         //First, get the combat style icon...
  5.         RS2Widget combatStanceIcon = api.getWidgets().get(164, 50);
  6.  
  7.         //Click on the combat style icon
  8.         if(combatStanceIcon != null){
  9.             combatStanceIcon.interact();
  10.         }
  11.  
  12.         //Get the combat style widget of the matching combat style
  13.         RS2Widget combatStanceWidget = api.getWidgets().getWidgetContainingText(combat_style);
  14.  
  15.         //Click on the matching style... switching styles.
  16.         if(combatStanceWidget != null){
  17.             combatStanceWidget.interact();
  18.         }
  19.  
  20.         //And closing the Combat Style screen
  21.         if(combatStanceIcon != null){
  22.             combatStanceIcon.interact();
  23.         }
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement