darkxor Posted April 15, 2014 Share Posted April 15, 2014 As for me, 1.8.2 has broken Molly and Pinball not fixed. Maybe, its only for me. I wrote hooks to fix randoms: class PinballRandomHook extends RandomBehaviourHook { public PinballRandomHook(int arg0) { super(arg0); } @Override public int onLoop() throws InterruptedException { RandomEventSolver pinball = randomManager.forId(randomManager.PINBALL); int ret = pinball.onLoop(); RS2Interface parent = client.getInterface(263); if(parent==null) return ret; RS2InterfaceChild child = parent.getChild(1); if(child==null) return ret; String message = child.getMessage(); if(!message.equals("Score: 10")) return ret; RS2Object caveExit = closestObjectForName("Cave Exit"); if(caveExit==null){ log("Pinball: no Cave Exit"); return ret; } if(distance(caveExit) > 4){ Position exitPos = caveExit.getPosition(); Position myPos = client.getMyPlayer().getPosition(); int x = exitPos.getX(); if(x - myPos.getX() > 3) x = myPos.getX() + 3; if(x - myPos.getX() < -3) x = myPos.getX() - 3; int y = exitPos.getY(); if(y - myPos.getY() > 3) y = myPos.getY() + 3; if(y - myPos.getY() < -3) y = myPos.getY() - 3; client.rotateCameraPitch(random(60, 67)); boolean walked = walk(new Position(x,y,0)); } return ret; } } class MollyRandomHook extends RandomBehaviourHook { public MollyRandomHook(int arg0) { super(arg0); } @Override public int onLoop() throws InterruptedException { RandomEventSolver molly = randomManager.forId(randomManager.MOLLY); int ret = molly.onLoop(); RS2Interface parent = client.getInterface(240); if(parent!=null) return ret; client.rotateCameraPitch(random(60, 67)); return ret; } } and this code add in onStart(): RandomBehaviourHook hook = new PinballRandomHook(randomManager.PINBALL); randomManager.registerHook(hook); RandomBehaviourHook hook = new MollyRandomHook(randomManager.MOLLY); randomManager.registerHook(hook); Link to comment Share on other sites More sharing options...
andzelmaz Posted April 17, 2014 Share Posted April 17, 2014 (edited) osm, i got like 7 fat account bans because bots were stuck overnight in pinball, thanx, btw aren't you supposed to do this also:? this.randomManager.unregisterHook(randomManager.PINBALL); this.randomManager.unregisterHook(randomManager.MOLLY); Edited April 17, 2014 by andzelmaz Link to comment Share on other sites More sharing options...
darkxor Posted April 17, 2014 Author Share Posted April 17, 2014 Hmm... I think it is not necessary. If you stop and start script, all hooks are cleared. Or you can just call randomManager.clearHooks() Link to comment Share on other sites More sharing options...
sam1234 Posted April 18, 2014 Share Posted April 18, 2014 How do i use this on my bot ?? where do i paste that code -.- ????? Link to comment Share on other sites More sharing options...
darkxor Posted April 18, 2014 Author Share Posted April 18, 2014 Its for scripters. They can add bug fix to their scripts. Link to comment Share on other sites More sharing options...
sam1234 Posted April 18, 2014 Share Posted April 18, 2014 ^^ Couldn't agree more. Link to comment Share on other sites More sharing options...