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 help, really appreciated


    Nosta

    Recommended Posts

    Walking.walk(fireMakingArea.getRandomTile());
    				sleepUntil(() -> getLocalPlayer().isMoving(), randomNum(1000, 1500));
    				sleepUntil(() -> !getLocalPlayer().isMoving(), randomNum(5000,7000));

    For this code. This code is basically an accident waiting to happen. If lag somehow occurs or etc. I would use maybe 5 retries in a loop with walking to a tile and tile checking. Also if u wanna fully walk to a target that involves multiple clicks. u need to call Walking.walk multiple times. Its not a blocking function.

    int i = 0;        
    while(!getLocalPlayer().getTile().equals(tileIwantToWalkto)) {
              Walking.walk //
                sleep // etc
              i++;
              if (i > 4)
                break;
            }

    The above code could be made even better probably.

    Link to comment
    Share on other sites

    Hello LordJasjin32! Thank you for the reply! :)
    Oh, yes! You are very correct. If this part of my code was to fail, it will simply realise that it is in a state where it needs to light a fire, and it will search for a new tile and try again. Also, I am not checking specifically if GetLocalPlayer is on a certain tile, from my tests and experience it's not a reliable function as it sporadically does not work.

    I do however got another question that perhaps you guys could give me some insight on. The function call "Tab.isOpen()" does sometimes return True even though it is false, any ideas?  Also "Tabs.openWithMouse()" fails very often, any ideas here? I've even added waits to be extra nice to it, yet it hates me :D


     

    public void selectTab(Tab t) {
    		for(int i = 0; i < 3; i++) {
    			sleep(randomNum(2000, 2500));
    			log("Attempted to open tab: " + t + ", Attempt ID: " + i);
    			Tabs.openWithMouse(t);
    			sleep(randomNum(2000, 2500));
    			if(t.isOpen()) {
    				log("Successfully opened tab: " + t + ", on Attempt ID: " + i);
    				break;
    			}
    		}

     

    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.