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
  • Question about detecting if player is being attacked by another player


    zeepzoop

    Recommended Posts

    Posted

    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?

    Posted

    i gues you could check if your player is in combat and then if the interaction character is a player or not?

    Posted

    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.  

    Posted

    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.

    Posted

    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

    Posted

    You can check if they are skulled first for efficiency

    • 1 year later...
    Posted

    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

    Archived

    This topic is now archived and is closed to further replies.

    ×
    ×
    • 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.