June 11, 20214 yr Position myPos = myPlayer().getPosition(); if (myPlayer().isUnderAttack() && myPos.equals(afkPos)) { lastAtk = System.currentTimeMillis(); done = false; afk(); } else { if ( (System.currentTimeMillis() > (lastAtk + timer) ) && !done) { reset(); } else { log("CURRENTLY HERE"); getWalking().walk(afkPos); sleep(random(450, 750)); } } I'm at Sand Crabs and sometimes the script will missclick so I want it to return to the afk tile, but it doesn't actually walk to it. The logger spams "CURRENTLY HERE" so it reaches the code, but the script doesn't move. Does this have something to do with how getWalking().walk(Position) works?
June 11, 20214 yr You need to make an event and setMinDistanceThreshold to 0 to walk to exact tile WalkingEvent myEvent = new WalkingEvent(new Position(1, 2, 3)); //making the event myEvent.setMinDistanceThreshold(0); execute(myEvent); //executing the event Edited June 11, 20214 yr by skillerkidos1
June 11, 20214 yr Author 2 minutes ago, skillerkidos1 said: You need to make an event and setMinDistanceThreshold to 0 to walk to exact tile WalkingEvent myEvent = new WalkingEvent(new Position(1, 2, 3)); //making the event myEvent.setMinDistanceThreshold(0); myEvent.setEnergyThreshold(47); myEvent.setBreakCondition(new Condition() { @[member='Override'] public boolean evaluate() { return myPlayer().isUnderAttack(); } }); execute(myEvent); //executing the event Yeah after some searching I simply did WalkingEvent walkingEvent = new WalkingEvent(afkPos); walkingEvent.setMinDistanceThreshold(0); execute(walkingEvent); Thanks anyway Edited June 11, 20214 yr by Gam
June 11, 20214 yr Author 41 minutes ago, skillerkidos1 said: That’s exactly what I said? Lmao Yeah, I just mean I did that right before you commented.
Create an account or sign in to comment