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
  • isOnScreen / interact method is broken?


    Bl1zzard

    Recommended Posts

    Today my combat, woodcutting and fishing scripts were suddenly broken. I tried adding a log method at the start of the onLoop method but when the script broke, the log method is never called again. I managed to debug it to the root cause, normally before I attack an NPC, I will call the isOnScreen method, if it is false, I will rotate my camera towards that NPC.

     

    But the isOnScreen method always return true regardless, hence my camera never rotates if the NPC is out of my screen. When that happens, the interact method bugs out and completely halts the script.

     

    Appreciate any help on this matter, thanks.

    Link to comment
    Share on other sites

    log(1);
    if (!npc.isOnScreen()) {
        log(2);
        Camera.keyboardRotateToEntity(npc);
        this.METHODCONTEXT.sleep(Calculations.random(Calculations.random(Configuration.SLEEP_FLOOR, Configuration.SLEEP_CEILING)));
        Walking.walk(npc.getTile().getRandomizedTile());
        this.METHODCONTEXT.sleep(Calculations.random(Calculations.random(Configuration.SLEEP_FLOOR, Configuration.SLEEP_CEILING)));
    }
    log(3);

     

    Sorry I can't find the edit button, the console log shows that it stalls after log(1).

    Link to comment
    Share on other sites

    19 hours ago, Pseudo said:

    I assume you're definitely getting a valid instance of the npc object before trying to interact with it?

    Yep, I have a validation check before the interaction logic. Issue has been fixed in the latest Dreambot version 3, think I was encountering the same issue as everyone else 😀

    Link to comment
    Share on other sites

    On 9/8/2020 at 1:15 AM, Bl1zzard said:

    Yep, I have a validation check before the interaction logic. Issue has been fixed in the latest Dreambot version 3, think I was encountering the same issue as everyone else 😀

    yup use Dreambot 3.

    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.