Jump to content

Colivar

Members
  • Posts

    4
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Colivar's Achievements

Newbie

Newbie (1/10)

1

Reputation

  1. Thanks, this is really helpful!
  2. ouch, I guess after messing around too much I screwed up without realising, thanks! ;)
  3. ah wow... I feel foolish, thanks. only one error left: private State getState() { Entity tree = objects.closest("Willow Tree"); Entity booth = objects.closest("Bank Booth"); if (!myPlayer().isAnimating() && (!myPlayer().isMoving() && (tree == null))); return State.attrees; if (!myPlayer().isAnimating() && (!myPlayer().isMoving() && (booth == null))); // error: unreachable code return State.atbank; if (!myPlayer().isAnimating() && (!myPlayer().isMoving()) && (tree == null) && (inventory.isEmpty())); return State.walktotrees; if (!myPlayer().isAnimating() && !myPlayer().isMoving() && (booth == null) && (inventory.isFull())); return State.walktobank; return State.idle; }
  4. Hi, I`m trying to learn to script in OSbot, I was wondering if anyone could take the time and tell me what I am doing wrong. I get 3 errors that I dont quite understand. Thanks in advance! import org.osbot.rs07.api.LocalWalker; import org.osbot.rs07.api.map.Position; import org.osbot.rs07.api.model.Entity; import org.osbot.rs07.api.model.Player; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.api.model.*; @ScriptManifest(author = "", info = "", logo = "", name = "", version = 0) public class test extends Script { @Override public void onStart() { log("Welcome"); } private enum State { idle, walktobank, walktotrees, atbank, attrees } private State getState() { Entity tree = objects.closest("Willow Tree"); Entity booth = objects.closest("Bank Booth"); if (!myPlayer().isAnimating() && (!myPlayer().isMoving() && (tree == null))); return State.attrees; if (!myPlayer().isAnimating() && (!myPlayer().isMoving() && (booth == null))); return State.atbank; if (!myPlayer().isAnimating() && (!myPlayer().isMoving()) && (tree == null) && (inventory.isEmpty())); return State.walktotrees; if (!myPlayer().isAnimating() && !myPlayer().isMoving() && (booth == null) && (inventory.isFull())); return State.walktobank; return State.idle; } public int onLoop() throws InterruptedException { switch (getState()) { case idle: sleep(random(500, 700)); break; case attrees: Entity tree = objects.closest("Willow Tree"); tree.interact("Chop"); break; case walktobank: Entity booth = objects.closest("Bank Booth"); LocalWalker.walk(booth); break; case walktotrees: Entity tree_2 = objects.closest("Willow Tree"); LocalWalker.walk(tree_2); break; } return random(200,300); } public void onExit() { log("Bye"); } }
×
×
  • Create New...