klongrich 0 Share Posted October 31, 2019 this fixed it but looks horrible private void ExchangeCowhides(){ if (!GrandexchangeLocation.contains(getLocalPlayer())) { getWalking().walk(GrandexchangeLocation.getRandomTile()); } else { exchangComplete = false; while(!exchangComplete) { if (getInventory().contains("Hard leather")) sellCowhides(); else { buyCowhides(); exchangComplete = true; } } } } Link to comment Share on other sites More sharing options...
Defiled 423 Share Posted November 1, 2019 Good Job! But why are you looping a boolean inside the onLoop? You could just add && exchangComplete == false inside the if statement, then it'll check that condition each time the onLoop loops depending on the time you set in the return statement in the onLoop. and yeah, always check if the walker should walk to avoid spammy map clicking. Other than that, Congrats on getting it to work! Link to comment Share on other sites More sharing options...
klongrich 0 Author Share Posted November 3, 2019 Ohh It was just habit. We had a norm which was like rules to the way we write code so we could all read it quicker and we couldn't define things in constructors. Would be a simpler way though. I just ended up doing this instead. private void ExchangeCowhides(){ if (!GrandexchangeLocation.contains(getLocalPlayer())) { getWalking().walk(GrandexchangeLocation.getRandomTile()); } else { sleepUntil(() -> !sellHardLeather(), 10000); buyCowhides(); } } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.