LordJashin32 54 Share Posted October 4, 2020 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 More sharing options...
Nosta 0 Author Share Posted October 4, 2020 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 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.