July 26, 201312 yr Below I will show my onLoop() method. What I am trying to do is make it so when you log in, it checks for the item first, then picks it up, then hops. What it's doing right now is just logging in and hopping right away. :\ Also I apologize if this is not in the appropriate section I am new here public int onLoop() throws InterruptedException { worldHopper.hopWorld(world); sleep(2000); Player c = client.getMyPlayer(); Entity chisel = closestGroundItemForName("Chisel"); if (chisel != null) { if (chisel.isVisible()) { if (!c.isAnimating()) { if (!c.isMoving()) { chisel.interact("Take"); sleep(random(500, 700)); } } } else { client.moveCameraToEntity(chisel); } } return 50; }
July 26, 201312 yr Author That's because you call 'worldHopper.hopWorld(world); ' first. I've tried this: public int onLoop() throws InterruptedException { Player c = client.getMyPlayer(); Entity chisel = closestGroundItemForName("Chisel"); if (chisel != null) { if (chisel.isVisible()) { if (!c.isAnimating()) { if (!c.isMoving()) { chisel.interact("Take"); sleep(random(500, 700)); } } } else { client.moveCameraToEntity(chisel); } worldHopper.hopWorld(world); sleep(2000); } return 50; } As well as a few other ways but it still seems to do the same thing Edited July 26, 201312 yr by DJay
July 26, 201312 yr worldHopper.hopWorld(world); sleep(2000); add that inside your if statement so it will only execute if it picks up the chisel.
July 26, 201312 yr Author worldHopper.hopWorld(world); sleep(2000); add that inside your if statement so it will only execute if it picks up the chisel. Thanks! Works now! :) Didn't think of that o.o
July 26, 201312 yr public int onLoop() throws InterruptedException { Player c = client.getMyPlayer(); GroundItem chisel = closestGroundItemForName("Chisel"); if (chisel != null && chisel.exists()) { if (chisel.isVisible()) { chisel.interact("Take"); sleep(random(500, 700)); } else { client.moveCameraToEntity(chisel); } } else { worldHopper.hopWorld(world); } return 50; } } Try that.
July 26, 201312 yr Author worldHopper.hopWorld(world); sleep(2000); add that inside your if statement so it will only execute if it picks up the chisel. I have one more question. I'm using this method to hop worlds: http://osbot.org/forum/topic/4942-for-everyone-hopping-worlds-in-their-scripts/ But I think I'm missing something because it hops once, but the next time it goes to hop it just logs into the same world over and over. Any ideas? I feel like I'm missing something.
July 26, 201312 yr Author Make your 'world' variable random each time. Beware of world features though (i.e., if it must be members etc. If that's the case then you should create an array of possible worlds and randomly select one out of those)! int world = WORLDS[random(WORLDS.length -1)]; It's like that atm. It goes to "Random event: World hopping" then stops and goes to "Random event: logging in". Weird It switches to random event logging in before hopping worlds. Edited July 26, 201312 yr by DJay