Exemple #1
0
 /**
  * Gets the current Wilderness Level. Written by Speed.
  *
  * @return The current wilderness level otherwise, 0.
  */
 public int getWildernessLevel() {
   return methods.interfaces.get(381).getComponent(2).isValid()
       ? Integer.parseInt(
           methods
               .interfaces
               .get(381)
               .getComponent(2)
               .getText()
               .replace(om.Server.toString("combatLevel: "), "")
               .trim())
       : 0;
 }
Exemple #2
0
 /**
  * Eats at the desired HP %.
  *
  * @param percent The health percentage to eat at; 10%-90%
  * @param foods Array of Foods we can eat.
  * @return <tt>true</tt> once we eaten to the health % (percent); otherwise <tt>false</tt>.
  */
 public boolean eat(final int percent, final int... foods) {
   final int firstPercent = getHealth();
   for (final int food : foods) {
     if (!methods.inventory.contains(food)) {
       continue;
     }
     if (methods.inventory.getItem(food).interact(om.Server.toString("combatEat"))) {
       for (int i = 0; i < 100; i++) {
         sleep(random(100, 300));
         if (firstPercent < percent) {
           break;
         }
       }
     }
     if (getHealth() >= percent) {
       return true;
     }
   }
   return false;
 }