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
  • Flinching


    detrs

    Recommended Posts

    I'm extremely new to coding/scripting and I was wondering how you would go about making it flinch a mob? Like for the Holy Grail quest, the troll on the bridge. Any direction or help understanding it would be appreciated! 

    Link to comment
    Share on other sites

    9 hours ago, detrs said:

    I'm extremely new to coding/scripting and I was wondering how you would go about making it flinch a mob? Like for the Holy Grail quest, the troll on the bridge. Any direction or help understanding it would be appreciated! 

    Thinking out loud, don't scold me if this isn't the purest way.
    (Might also need to wait for start of tick, not sure)

    When the health bar of NPC is not visible:
    
    Retrieve the tile location of the NPC.
    Attack NPC.
    Use HitSplatListener to monitor when NPC is hit.
    Walk 2 tiles away from NPC tile (+2 or -2 to npc.getX or Y, something like that) after hitting it

     

    Edited by xyz111
    Link to comment
    Share on other sites

    23 hours ago, xyz111 said:

    Thinking out loud, don't scold me if this isn't the purest way.
    (Might also need to wait for start of tick, not sure)

    When the health bar of NPC is not visible:
    
    Retrieve the tile location of the NPC.
    Attack NPC.
    Use HitSplatListener to monitor when NPC is hit.
    Walk 2 tiles away from NPC tile (+2 or -2 to npc.getX or Y, something like that) after hitting it

     

    That sounds sorta what I was thinking, but I didnt know about hitsplatlistener. Don’t have to much experience with combat related things yet. I’ll give that a try and see if I can’t get it to flinch properly. Thank you, very helpful!

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