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
  • Tile comparison algorithm is broken.


    sergbot

    Recommended Posts

    • 10:49:20 PM: [SCRIPT] regular walk + timer reset(1862, 3536, 0) (1862, 3536, 0)
    • log("regular walk + timer reset" + CrabSpot + " " + getLocalPlayer().getTile());

    new CrabSpot = new Tile (1862, 3536);

    So I was using != operator to see if i was standing in the correct tile. 

    And as you can see the crabspot and local.gettile, both were returning the same exact coordinate. However the code was supposed to only execute if they weren't equal, so the client kept thinking they weren't equal, but they are actually equal as you can see in the log. 

    Link to comment
    Share on other sites

    5 hours ago, sergbot said:
    • 10:49:20 PM: [SCRIPT] regular walk + timer reset(1862, 3536, 0) (1862, 3536, 0)
    • 
      
      log("regular walk + timer reset" + CrabSpot + " " + getLocalPlayer().getTile());

    new CrabSpot = new Tile (1862, 3536);

    So I was using != operator to see if i was standing in the correct tile. 

    And as you can see the crabspot and local.gettile, both were returning the same exact coordinate. However the code was supposed to only execute if they weren't equal, so the client kept thinking they weren't equal, but they are actually equal as you can see in the log. 

    You need to use .equals() to compare objects. If you use != or == you are comparing the object references (which is not what you want)

    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.