HelloPeeps Posted February 23, 2014 Posted February 23, 2014 I'm trying to get my script to change state if it contains any items at all, not just when it's full? is this possible? I have the code to change when full. if (!client.getInventory().isFull() && BANK_AREA.contains(myPlayer())) return State.WALK_TO_AREA; Any help guys? Also It may contain numerous items so I can't put each ID down Thanks
Han Posted February 23, 2014 Posted February 23, 2014 API is there for a reason, take a quick look :P
Brown Posted February 23, 2014 Posted February 23, 2014 Try this: if(!client.getInventory().isEmpty && BANK_AREA.contains(myPlayer()){ state = State.WALK_TO_BANK; }
diamondcut11 Posted February 23, 2014 Posted February 23, 2014 (edited) if (!client.getInventory().isEmpty() && BANK_AREA.contains(myPlayer())) return State.WALK_TO_AREA; I believe...First time I've looked at the API so I cant make any promises haha Edited February 23, 2014 by diamondcut11
Booch Posted February 23, 2014 Posted February 23, 2014 if(!client.getInventory().isEmpty() && myPlayer().isInArea(BANK_AREA) { return State.WALK_TO_AREA; } Try that, wrote it right now so check for syntax