pressxtolog Posted June 26, 2014 Posted June 26, 2014 How would i go about disabling the RunAwayFromCombat antiban, i've looked through the API a bit, and i can't seem to figure it out. Can anybody point me in the right direction?
Botre Posted June 26, 2014 Posted June 26, 2014 RandomExecutor.unregisterHook(RandomEvent.RUN_AWAY_FROM_COMBAT) ; 1
Mysteryy Posted June 26, 2014 Posted June 26, 2014 (edited) How would i go about disabling the RunAwayFromCombat antiban, i've looked through the API a bit, and i can't seem to figure it out. Can anybody point me in the right direction? I assume when you say antiban, you really mean random event handler? If so, look in the RandomEventExecutor.unregisterHook(RandomEvent.EVENT_NAME). I'm on my phone, but I'm pretty sure that is where it is. ^_^ Edited June 26, 2014 by Mysteryy
pressxtolog Posted June 26, 2014 Author Posted June 26, 2014 (edited) RandomExecutor.unregisterHook(RandomEvent.RUN_AWAY_FROM_COMBAT) ; I assume when you say antiban, you really mean random event handler? If so, look in the RandomEventExecutor.unregisterHook(RandomEvent.EVENT_NAME). I'm on my phone, but I'm pretty sure that is where it is. Thanks a lot, i got it. Edit: I assumed it was working, but it isn't, i assume this may be an issue because the NPC it's running from is a tree spirit(From Lost City), even though i disabled all random events(just to make sure i wasn't missing anything) I am unregistering the hooks in the onStart method using a for loop for(RandomEvent e : RandomEvent.values()) { getBot().getRandomExecutor().unregisterHook(e); } Edited June 26, 2014 by pressxtolog
Mysteryy Posted June 26, 2014 Posted June 26, 2014 Thanks a lot, i got it. Edit: I assumed it was working, but it isn't, i assume this may be an issue because the NPC it's running from is a tree spirit(From Lost City), even though i disabled all random events(just to make sure i wasn't missing anything) I am unregistering the hooks in the onStart method using a for loop for(RandomEvent e : RandomEvent.values()) { getBot().getRandomExecutor().unregisterHook(e);} So you are saying that code isn't unregistering the random hooks? I think you might have to reload the random handlers after you disable them. Is that code giving you any errors, or is it just not working?
pressxtolog Posted June 26, 2014 Author Posted June 26, 2014 So you are saying that code isn't unregistering the random hooks? I think you might have to reload the random handlers after you disable them. Is that code giving you any errors, or is it just not working? What do you mean by reloading the random handler, and no i'm not getting any errors, the Event only seems to be triggered by the tree spirit.
Mysteryy Posted June 26, 2014 Posted June 26, 2014 What do you mean by reloading the random handler, and no i'm not getting any errors, the Event only seems to be triggered by the tree spirit. Uhmm look in RandimEventExecutor. I believe there is something like .registerHooks or registerRandoms. I think that method will refresh the random hooks. Again, I'm on my phone so I'm not much help. My Internet has been out for like 12 hours now so I can't do anything. t.t
Extreme Scripts Posted June 26, 2014 Posted June 26, 2014 It won't be working as of the moment due to the Random Executor in the client being non-functional. @Ericthecmh has rectified the issue and it will be fixed in the new update 2.1.18 ^_^
pressxtolog Posted June 28, 2014 Author Posted June 28, 2014 It won't be working as of the moment due to the Random Executor in the client being non-functional. @Ericthecmh has rectified the issue and it will be fixed in the new update 2.1.18 Bump, using OSBot 2.1.18, and the bot still wants to run away from the tree spirit even after unregistering RunAwayFromCombat/All randoms(I tried just RunAwayFromCombat, and then tried unregistering all of the hooks, all with the same outcome, a message logged and the bot runs to a random nearby location) The logged message - [INFO][Bot #1][06/28 08:32:06 AM]: This script does not use a custom RunAwayFromCombat handler! [INFO][Bot #1][06/28 08:32:06 AM]: For some scripts this is more than just a necessity, contact the developer! [INFO][Bot #1][06/28 08:32:06 AM]: We are running away from NPC : Tree spirit [INFO][Bot #1][06/28 08:32:06 AM]: We've selected position [[x=11880, y=12388, z=1]] as a suitable destination to run away to! [INFO][Bot #1][06/28 08:32:09 AM]: We've successfully walk to our run-away destination!