klongrich 0 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; } } } }
Defiled 426 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!
klongrich 0 Author 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(); } }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.