Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/02/13 in Posts

  1. This is just something I threw together really quick import org.osbot.script.rs2.skill.Skill; public class Goal { public final Skill skill; public final int target; public final GoalEvent event; public Goal(Skill skill, int target, GoalEvent event) { this.skill = skill; this.target = target; this.event = event; } } import org.osbot.script.Script; public abstract class GoalEvent { private final Script script; public GoalEvent(Script script) { this.script = script; } public abstract void onGoalReached(); } import java.util.ArrayList; import java.util.Iterator; import java.util.List; import org.osbot.script.Script; public class HandleGoals { private final List<Goal> goals; private final Script script; public HandleGoals(Script script) { this.script = script; this.goals = new ArrayList<>(); } public void provide(Goal... goals) { for(Goal goal : goals) { if(!this.goals.contains(goal)) this.goals.add(goal); } } public void remove(Goal... goals) { for(Goal goal : goals) { if(this.goals.contains(goal)) this.goals.remove(goal); } } public boolean check() { Iterator<Goal> iterator = this.goals.iterator(); while(iterator.hasNext()) { Goal goal = iterator.next(); if(goal.target >= this.script.client.getSkills().getCurrentLevel(goal.skill)) { goal.event.onGoalReached(); this.remove(goal); return true; } } return false; } } Example Implementation... //put this anywhere in the script class private HandleGoals handle = null; //in your onStart put this... this.handle = new HandleGoals(this); handle.provide(new Goal(Skill.ATTACK, 99, new GoalEvent(this) { @Override public void onGoalReached() { log("I have reached my goal, tell me what to do now in this method"); } })); //in your onLoop put this... if(handle != null) handle.check();
    3 points
  2. 3 points
  3. i was thinking of making a video next time i ll post a link somewhere next week
    2 points
  4. So, i was testing out rawr's ddoser and i slowly moved up from 2k, 3k,5k, to 12k. Then i made a huge jump to 50k and it made my intellij use a huge amount of memory which then crashed my computer. So, i wouldn't do 50k Threads it's bad.
    1 point
  5. Just got my Wocom Bamboo tablet First piece made with it: So good imo x.x More to come !
    1 point
  6. 1 point
  7. Delete them and add them back one by one
    1 point
  8. Hottest person I know is me. I don't know any hot people besides me. That is how hot I am
    1 point
  9. So tell me what does this do.
    1 point
  10. 1 point
  11. I love your style, it's very ... personal haha! Keep it up
    1 point
  12. 1 point
  13. It doesn't rain in the wilderness
    1 point
×
×
  • Create New...