Jump to content

OSBot 2.0 - Disabling the RunAwayFromCombat antiban


pressxtolog

Recommended Posts

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 by Mysteryy
Link to comment
Share on other sites

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. happy.png

 

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 by pressxtolog
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 happy.png

 

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!
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...