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
  • Need some combat help


    Diddy

    Recommended Posts

    Hi guys

     

    I'm currently making a hill giant script and I incounter a few bugs.

     

    So first problem is that it takes a while until the bot realises it's not longer in combat.

    I remember though that others complaned about the simplicity of getLocalPlayer().isInCombat() , 

    but is there a way around this? If so pls share ;p

     

    My other problem I have is with picking up loot.

    It sometimes tries to pick up the same loot twice when it already disapeared.

    I don't just want to add a sleep of 5mins and I can't think of a proper sleepUntil.

     

     

    All help is appreciated :)

    Link to comment
    Share on other sites

    Hi guys

     

    I'm currently making a hill giant script and I incounter a few bugs.

     

    So first problem is that it takes a while until the bot realises it's not longer in combat.

    I remember though that others complaned about the simplicity of getLocalPlayer().isInCombat() , 

    but is there a way around this? If so pls share ;p

     

    My other problem I have is with picking up loot.

    It sometimes tries to pick up the same loot twice when it already disapeared.

    I don't just want to add a sleep of 5mins and I can't think of a proper sleepUntil.

     

     

    All help is appreciated :)

    maybe pick up item then set the item object = null right afterwards or sleepuntil(s.getinventory.count(itemid) > oldcount)

    Link to comment
    Share on other sites

    It's best to try and create triggers for a state machine. Combat is triggered by animations, specifically animations for the weapon you have equipped. Or, the animations of a target that you current are facing or is facing you. As for ground items, there might be a bit of a different of time from when you pick an item up and from when it vanishes from the floor. Most of the time you have to execute actions over and over again until the trigger is met or completely try and complete the action again.

     

    So say, to reach S1 from S0 you must meat C0. Execute S0 until C0 is met, or wait X amount of time until C0 is met and if C0 is not met then execute S0 again.

    Link to comment
    Share on other sites

    The best workaround for the isInCombat() method sucking is checking if npcs are interacting and facing a target. (You can also do animations as Sini noted, it might actually be more accurate in the longrun)

     

    Can't say I've run into that issue with looting so I can't be much help, sorry =(

    Link to comment
    Share on other sites

    The best workaround for the isInCombat() method sucking is checking if npcs are interacting and facing a target. (You can also do animations as Sini noted, it might actually be more accurate in the longrun)

     

    Can't say I've run into that issue with looting so I can't be much help, sorry =(

    looting seems to be fixed with just checking if player is moving or not

    Link to comment
    Share on other sites

    wait what's wrong with isInCombat ._.

    it waits until the mob is down and the localplayer his health bar is gone

    so it's almost a minute delay

    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.