Alext1996 Posted December 24, 2016 Share Posted December 24, 2016 (edited) Hello im having problem a little trouble with my script. I want it to be able to check the ground, if number of items on the ground currently are more than 28 or less than 28. if its less then 28 then im going to continue dropping items if its more than 28 then im going to pick them up but it says bad operander type I searched around and found no answer. I attached a screenshot of the problem below thanks alot merry christmas everyone! Edited December 24, 2016 by Alext1996 Quote Link to comment Share on other sites More sharing options...
Juggles Posted December 24, 2016 Share Posted December 24, 2016 http://osbot.org/forum/topic/97442-checking-numbers-of-items-in-a-stack/ Quote Link to comment Share on other sites More sharing options...
Team Cape Posted December 24, 2016 Share Posted December 24, 2016 (edited) m8... isFull() is a method !inventory.isFull() also, your operand is backwards => is not greater than or equal to. that's an arrow. >= is greater than or equal to. edit: you're also trying to ask if a GroundItem (an object) is greater than or equal to 28 / less than 28. That's like asking someone, "Is my textbook less than 20?". You can't compare an object to a number. Use getAmount(). it looks like you need to familiarize yourself with java a little bit more before coding. Edited December 24, 2016 by Imateamcape Quote Link to comment Share on other sites More sharing options...
Alext1996 Posted December 24, 2016 Author Share Posted December 24, 2016 m8... isFull() is a method !inventory.isFull() also, your operand is backwards => is not greater than or equal to. that's an arrow. >= is greater than or equal to. edit: you're also trying to ask if a GroundItem (an object) is greater than or equal to 28 / less than 28. That's like asking someone, "Is my textbook less than 20?". You can't compare an object to a number. Use getAmount(). it looks like you need to familiarize yourself with java a little bit more before coding. yeah I know isfull is a method, that is just a typo I was asking about if there is a way to check how many objects are on the ground. I have watched so many tutorials on youtube im sick of it thats why i decided to start coding instead so I learn by doing thanks for the help m8... isFull() is a method !inventory.isFull() also, your operand is backwards => is not greater than or equal to. that's an arrow. >= is greater than or equal to. edit: you're also trying to ask if a GroundItem (an object) is greater than or equal to 28 / less than 28. That's like asking someone, "Is my textbook less than 20?". You can't compare an object to a number. Use getAmount(). it looks like you need to familiarize yourself with java a little bit more before coding. Quote Link to comment Share on other sites More sharing options...