holyfoxx Posted November 15, 2014 Share Posted November 15, 2014 (edited) i am trying to use this code in onLoop class. i dont understand what am i doing wrong, if i write client.getinventory code in i get error : Cannot resolve method 'getinventory()'. i'm trying to make an if statement. if(!this.client.getInventory().contains()){} Edited November 15, 2014 by holyfoxx Link to comment Share on other sites More sharing options...
Xerion Posted November 15, 2014 Share Posted November 15, 2014 You are using the osbot 1 API. Check the api documents. Link to comment Share on other sites More sharing options...
MokeyMadness Posted November 16, 2014 Share Posted November 16, 2014 what is that mean ?+ Link to comment Share on other sites More sharing options...
holyfoxx Posted November 16, 2014 Author Share Posted November 16, 2014 oh i got it, now im using , inventory.isFull() Link to comment Share on other sites More sharing options...
Augury13 Posted December 10, 2014 Share Posted December 10, 2014 oh i got it, now im using , inventory.isFull() inventory.isFull() keeps running as an error for me.. Will run perfectly like this: private State getState() { Entity tree = objects.closest("Tree"); if(!inventory.isEmpty()) return State.DROP; if (tree != null) return State.CUT; return State.WAIT; but if i throw in the .isFull() the script won't run at all: private State getState() { Entity tree = objects.closest("Tree"); if(!inventory.isFull()) return State.DROP; if (tree != null) return State.CUT; return State.WAIT; pls halp (: Link to comment Share on other sites More sharing options...
Czar Posted December 10, 2014 Share Posted December 10, 2014 (edited) inventory.isFull() keeps running as an error for me.. Will run perfectly like this: private State getState() { Entity tree = objects.closest("Tree"); if(!inventory.isEmpty()) return State.DROP; if (tree != null) return State.CUT; return State.WAIT; but if i throw in the .isFull() the script won't run at all: private State getState() { Entity tree = objects.closest("Tree"); if(!inventory.isFull()) return State.DROP; if (tree != null) return State.CUT; return State.WAIT; pls halp (: If inventory isn't full, drop? Remember to remove the ! before the boolean (it was !isEmpty now !isFull) they are opposite so it should be if (getInventory().isFull()) Or is the isFull causing an actual error? Edited December 10, 2014 by Czar 1 Link to comment Share on other sites More sharing options...
Augury13 Posted December 10, 2014 Share Posted December 10, 2014 If inventory isn't full, drop? Remember to remove the ! before the boolean (it was !isEmpty now !isFull) they are opposite so it should be if (getInventory().isFull()) Or is the isFull causing an actual error? THANKS! this fixed it(for this issue at least) +1!! Link to comment Share on other sites More sharing options...
Czar Posted December 10, 2014 Share Posted December 10, 2014 (edited) If you need any more help just pm @OP remove the client. So its just this.getInventory() because in osbot2 they changed it around. Client. Is just for old osbot. Edited December 10, 2014 by Czar Link to comment Share on other sites More sharing options...