Tj2907 Posted March 12, 2017 Posted March 12, 2017 This one video that had client.getInventory but it's not recognized in eclipse. I looked in the API in inventory and I couldn't find anything that had to do with the inventory capacity. Am I retarded?
Tj2907 Posted March 13, 2017 Author Posted March 13, 2017 5 minutes ago, TrekToop11 said: inventory.isFull() would work I'm getting the error "inventory cannot be resolved or is not a field"
IHB Posted March 13, 2017 Posted March 13, 2017 3 minutes ago, Tj2907 said: I'm getting the error "inventory cannot be resolved or is not a field" if (getInventory().isFull()) { do stuff... } That not work?
Tj2907 Posted March 13, 2017 Author Posted March 13, 2017 (edited) 7 minutes ago, IHB said: if (getInventory().isFull()) { do stuff... } That not work? Okay that works, but in the video he has client.getInventory Will it function the same? Edited March 13, 2017 by Tj2907
IHB Posted March 13, 2017 Posted March 13, 2017 4 minutes ago, Tj2907 said: Okay that works, but in the video he has client.getInventory Will it function the same? Ehh you're probably writing all your code in one class? The guy in the video you're watching is probably using a Task based method of programming which involves using multiple classes and a method provider, he's called it client I guess. In every class he uses client.theMethod, for you just remove the .client before everything you're following.
TrekToop11 Posted March 13, 2017 Posted March 13, 2017 (edited) 10 minutes ago, Tj2907 said: Okay that works, but in the video he has client.getInventory Will it function the same? thats basically saying " If the inventory is full, do this/these actions " for example if (getInventory().isFull()){ getInventory().dropAll(); } if the inventory is full, drop everything in the inventory. Edited March 13, 2017 by TrekToop11 edit for clarification.
Chris Posted March 13, 2017 Posted March 13, 2017 dont watch an old video use the API docs http://osbot.org/api
Tj2907 Posted March 13, 2017 Author Posted March 13, 2017 8 minutes ago, IHB said: Ehh you're probably writing all your code in one class? The guy in the video you're watching is probably using a Task based method of programming which involves using multiple classes and a method provider, he's called it client I guess. In every class he uses client.theMethod, for you just remove the .client before everything you're following. 6 minutes ago, TrekToop11 said: thats basically saying " If the inventory is full, do this/these actions " for example if (getInventory().isFull()){ getInventory().dropAll(); } if the inventory is full, drop everything in the inventory. Alright thanks guys! 3 minutes ago, Chris said: dont watch an old video use the API docs http://osbot.org/api I was watching an old video because I am trying to learn how to properly use the API with a video representation because it is easier to learn that way
IHB Posted March 13, 2017 Posted March 13, 2017 Just now, Tj2907 said: Alright thanks guys! You're watching the same draynor chopper video I watched I think? @Chris is right that's very old for OSBot 1 You're better off having a look through the tutorial section on the actual forum https://osbot.org/forum/forum/250-tutorials/
Tj2907 Posted March 13, 2017 Author Posted March 13, 2017 5 minutes ago, IHB said: You're watching the same draynor chopper video I watched I think? @Chris is right that's very old for OSBot 1 You're better off having a look through the tutorial section on the actual forum https://osbot.org/forum/forum/250-tutorials/ Well I tried to follow by looking at the pictures on some of the forum topics but it was harder for me to understand it all compared to a video. I'm just using the video as like reference I guess to learn to use the API
Juggles Posted March 13, 2017 Posted March 13, 2017 client. Is just a name for it. It's to call the OSBOT API In another class basically https://www.google.com/amp/www.javaworld.com/article/2979739/learn-java/java-101-classes-and-objects-in-java.amp.html 1
pipez Posted March 13, 2017 Posted March 13, 2017 3 hours ago, Juggles said: client. Is just a name for it. It's to call the OSBOT API In another class basically https://www.google.com/amp/www.javaworld.com/article/2979739/learn-java/java-101-classes-and-objects-in-java.amp.html lol the banter