Jump to content
Frequently Asked Questions
  • Are you not able to open the client? Try following our getting started guide
  • Still not working? Try downloading and running JarFix
  • Help! My bot doesn't do anything! Enable fresh start in client settings and restart the client
  • How to purchase with PayPal/OSRS/Crypto gold? You can purchase vouchers from other users
  • Try asking for help in the chatbox
  • Question about detecting if player is being attacked by another player


    zeepzoop
     Share

    Recommended Posts

    I'm making a script that goes into the wilderness and I want to detect if the bot is being attacked by another player.  

     

    Right now I'm getting nearest player then getting interacting character for that player to check if the bot is being attacked.  

     

    Is there a better way to do this?

    Link to comment
    Share on other sites

    what if my character is being attacked but I am not attacking them, does it still detect the player?

     

    My script will run away and I want to know when the enemy player stops attacking as well.  

    Link to comment
    Share on other sites

    You have to do a loop through all players starting with the closest and check if they are in combat and have you as an interacting character.

    Wouldn't this create a huge RAM buffer? I can imagine the memory peaking here lol

    Link to comment
    Share on other sites

    • 1 year later...

    just check all players in the area and see if they are interacting with you + if they are within the combat range you can attack no point hopping/teleporting for someone that can't even attack you

    Link to comment
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
     Share

    ×
    ×
    • Create New...

    Important Information

    We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.