Lewis Posted December 11, 2016 Posted December 11, 2016 Still having an issue with my case being called even though inventory contains over 1k coins after world hopping if (getInventory().getAmount("Coins") <= 1000 && !GE.contains(myPlayer())) return State.WALKGE; is the case being called after it world hops my world hop code: else if (store.getAmount(ITEM) == 0 && store.getAmount(ITEM) < 215) { if (store.isOpen()) { store.close(); } worlds.hopToP2PWorld(); new ConditionalSleep(20000) { @[member=Override] public boolean condition() throws InterruptedException { return widgets.isVisible(548, 62); } }.sleep(); getTabs().open(Tab.INVENTORY); } note*: The conditional sleep widget is, the loading text you get when world hopping / hoping for a ghetto fix (where current world would be)
Team Cape Posted December 11, 2016 Posted December 11, 2016 your inventory isnt open so it doesnt know how many it has. probably returns a -1, which is less than 1000
Lewis Posted December 11, 2016 Author Posted December 11, 2016 your inventory isnt open so it doesnt know how many it has. probably returns a -1, which is less than 1000 yeah i tried the conditional sleep after hopping, then open inv like in example code yet it still does it
TheJCR Posted December 11, 2016 Posted December 11, 2016 your inventory isnt open so it doesnt know how many it has. probably returns a -1, which is less than 1000 how did you obtain the scripter rank?
Lewis Posted December 11, 2016 Author Posted December 11, 2016 how did you obtain the scripter rank? such on topic, much relevance
TheJCR Posted December 11, 2016 Posted December 11, 2016 such on topic, much relevance imateamcape already answered the question
Lewis Posted December 11, 2016 Author Posted December 11, 2016 (edited) imateamcape already answered the question i know it was being falsely called already. I'm looking for a solution to the problem. So no, he hasnt answered the question yet. Please refrain from any unrelated posts Edited December 11, 2016 by Lewis
TheJCR Posted December 11, 2016 Posted December 11, 2016 i know it was being falsely called already. I'm looking for a solution to the problem. So no, he hasnt answered the question yet. Please refrain from any unrelated posts sorry lel didnt read. i just found out that ur op
Team Cape Posted December 11, 2016 Posted December 11, 2016 (edited) how did you obtain the scripter rank? stay on topic. no more about this in this thread. http://osbot.org/forum/topic/82806-new-scripter-ranks/ yeah i tried the conditional sleep after hopping, then open inv like in example code yet it still does it && inventory.getAmount("Coins") >= 0 is probably a reasonable (lil ghetto) fix thatll work Edited December 11, 2016 by Imateamcape
Night Posted December 11, 2016 Posted December 11, 2016 (edited) Found these on another thread (think credit goes to Explv) public boolean isLoggedIn() { return isHopping() || getClient().getLoginStateValue() == 30 || getClient().isLoggedIn() || isLoading(); } public boolean isHopping() { return getClient().getLoginStateValue() == 45 || getClient().getLoginStateValue() == 25; } public boolean isLoading() { return getClient().getLoginState() == Client.LoginState.LOADING || getClient().getLoginState() == Client.LoginState.LOADING_MAP; } Should help you to wait until you're done hopping. Edited December 11, 2016 by Night
Lewis Posted December 11, 2016 Author Posted December 11, 2016 && inventory.getAmount("Coins") >= 0 is probably a reasonable (lil ghetto) fix thatll work Tried it and it still does it ive even added: if (!getTabs().getOpen().equals(Tab.INVENTORY)) { getTabs().open(Tab.INVENTORY); } in my ge walker case It seems to be when world hopping lags slightly, causing it not to reopen inventory (even though i have open in in walking case too)
Team Cape Posted December 11, 2016 Posted December 11, 2016 (edited) Tried it and it still does it ive even added: if (!getTabs().getOpen().equals(Tab.INVENTORY)) { getTabs().open(Tab.INVENTORY); } in my ge walker case It seems to be when world hopping lags slightly, causing it not to reopen inventory (even though i have open in in walking case too) imagine your current code in the walk_to_ge state is just walkToGE(); say this: if(inventory.isOpen()) { walkToGE(); } else { tabs.open(Tab.INVENTORY); } and let it go thru the loop again Found these on another thread (think credit goes to Explv) public boolean isLoggedIn() { return isHopping() || getClient().getLoginStateValue() == 30 || getClient().isLoggedIn() || isLoading(); } public boolean isHopping() { return getClient().getLoginStateValue() == 45 || getClient().getLoginStateValue() == 25; } public boolean isLoading() { return getClient().getLoginState() == Client.LoginState.LOADING || getClient().getLoginState() == Client.LoginState.LOADING_MAP; } Should help you to wait until you're done hopping. the issue isnt that hes still hopping - it's that the inventory is returning a -1 value for the coins in the inventory Edited December 11, 2016 by Imateamcape
Juggles Posted December 11, 2016 Posted December 11, 2016 stay on topic. no more about this in this thread. http://osbot.org/forum/topic/82806-new-scripter-ranks/ && inventory.getAmount("Coins") >= 0 is probably a reasonable (lil ghetto) fix thatll work Can confirm this works. I use it in my scripts as a Ghetto fix to it. 1
Lewis Posted December 11, 2016 Author Posted December 11, 2016 Can confirm this works. I use it in my scripts as a Ghetto fix to it. how do you use it? i tried: if (getInventory().getAmount("Coins") <= 1000 && inventory.getAmount("Coins") >= 0 && !GE.contains(myPlayer())) return State.WALKGE; and it was still doing it
Juggles Posted December 11, 2016 Posted December 11, 2016 how do you use it? i tried: if (getInventory().getAmount("Coins") <= 1000 && inventory.getAmount("Coins") >= 0 && !GE.contains(myPlayer())) return State.WALKGE; and it was still doing it Has to be a > can't be a >= bc it's equal to 0 when you are hopping Just basic math logic :P My code if (getInventory().getAmount("Coins") > 0 && getInventory().getAmount("Coins") < 10000) { getStatus = ("Walk to GE"); walking.walkPath(toGrandExchange); }