Lewis Posted December 11, 2016 Share 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) Quote Link to comment Share on other sites More sharing options...
Team Cape Posted December 11, 2016 Share 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 Quote Link to comment Share on other sites More sharing options...
Lewis Posted December 11, 2016 Author Share 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 Quote Link to comment Share on other sites More sharing options...
TheJCR Posted December 11, 2016 Share 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? Quote Link to comment Share on other sites More sharing options...
Lewis Posted December 11, 2016 Author Share Posted December 11, 2016 how did you obtain the scripter rank? such on topic, much relevance Quote Link to comment Share on other sites More sharing options...
TheJCR Posted December 11, 2016 Share Posted December 11, 2016 such on topic, much relevance imateamcape already answered the question Quote Link to comment Share on other sites More sharing options...
Lewis Posted December 11, 2016 Author Share 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 Quote Link to comment Share on other sites More sharing options...
TheJCR Posted December 11, 2016 Share 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 Quote Link to comment Share on other sites More sharing options...
Team Cape Posted December 11, 2016 Share 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 Quote Link to comment Share on other sites More sharing options...
Night Posted December 11, 2016 Share 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 Quote Link to comment Share on other sites More sharing options...
Lewis Posted December 11, 2016 Author Share 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) Quote Link to comment Share on other sites More sharing options...
Team Cape Posted December 11, 2016 Share 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 Quote Link to comment Share on other sites More sharing options...
Juggles Posted December 11, 2016 Share 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 Quote Link to comment Share on other sites More sharing options...
Lewis Posted December 11, 2016 Author Share 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 Quote Link to comment Share on other sites More sharing options...
Juggles Posted December 11, 2016 Share 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); } Quote Link to comment Share on other sites More sharing options...