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
  • NPC attack handling


    Invidious

    Recommended Posts

    I'm trying to attack an NPC, move to a specified tile and then attack the same NPC again and I cant seem to figure it out. Are there other ways to check if you can interact with an NPC besides the common "if is in combat" or "if health bar is visible". Id appreciate any help provided.

    Link to comment
    Share on other sites

    Depends on the context really.

    One could create a listener that looks for the NPC's defensive animation, or a listener on the player for their attack animation. Another would be to listen for XP changes, but when hitting a 0, it wouldn't be detected.

    Even then, implementing something like woox walking on Vorkath for example is still a pretty big challenge to get perfect.

    Link to comment
    Share on other sites

    1 hour ago, Articron said:

    Depends on the context really.

    One could create a listener that looks for the NPC's defensive animation, or a listener on the player for their attack animation. Another would be to listen for XP changes, but when hitting a 0, it wouldn't be detected.

    Even then, implementing something like woox walking on Vorkath for example is still a pretty big challenge to get perfect.

    In this case my character is using magic while safe spotting. If the NPC is farther than the cast range the player will step out, cast and return to the safe spot. But once in the safe spot again the character and NPC both just stand there until either another one spawns or walks in to a specified area because im currently only checking if the NPC is in combat to avoid trying to attack an NPC fighting someone else

    Link to comment
    Share on other sites

    I cant edit the above comment for some reason but its meant to say  "Both just stand there until either another NPC of the same type spawns, or another NPC of the same type walks into the area I specified.

    Link to comment
    Share on other sites

    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.