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
  • getinventory().count - incorrect values


    ScripterSteve

    Recommended Posts

    if((getInventory().count("Warrior guild token") ) > this.config.getTokens()){
        log("Stopping cus collected so many tokens");
        stop();
    }

    Above is my stopping code for the script and it was stopping when I wasn't expecting it to so ran some debugging on the counts and..|
    Very occasionally it returns the wrong number, see screenshot below but when it does causes my script to stop when it shouldn't.

    https://gyazo.com/d3089bd5c5bfb2ffa059f0c7f34851b6

    https://gyazo.com/828dd5596b36815aaf0256c6b73410b4

    Link to comment
    Share on other sites

    4 hours ago, ScripterSteve said:
    
    Turns out mistake was i was using a long and not an int - thanks to Milasoft

    just btw, when logging you can just use log(""+long) you dont have to use Long.toString as long as the log begins with a string or an empty "" string

    Link to comment
    Share on other sites

    16 hours ago, None said:

    just btw, when logging you can just use log(""+long) you dont have to use Long.toString as long as the log begins with a string or an empty "" string

    Ah thanks :)

    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.