Drewyboyo Posted December 29, 2016 Share Posted December 29, 2016 Where I have the red line (This is Apa's tea thiever guide, was reading it line by line to try and learn) Few questions, 1) Why does the script there say to drop when the inventory is empty (If this was correct in the tutorial ?) 2) I was gonna try and make my own walking to bank and walk back, would this be using the walk entity feature, or what part of the API do i utilize to try this? (Using the cake stall, and replaced the entity of tea stall with cake , thats it so far. 3)Why is the empty inventory in the onstart instead of onloop, is that to clear the inventory when the script is starting? 4) Maybe I missed this in the guide, what is "case" ? Quote Link to comment Share on other sites More sharing options...
Hereweald Posted December 29, 2016 Share Posted December 29, 2016 (edited) if (!getInventory().isEmpty()) { return State.Drop; } Means if the inventory is NOT empty. The ! is a negator to booleans boolean bool = true; if (bool) { // do if true } if (!bool) { //do if false } For walking I recommend using webWalker for longer distances where obstacles may be in your way getWalking().webWalk(Banks.ARDOUGNE_SOUTH) and for shorter distances where doors etc arent a problem use walk instead. Edited December 29, 2016 by Hereweald Quote Link to comment Share on other sites More sharing options...
Drewyboyo Posted December 29, 2016 Author Share Posted December 29, 2016 (edited) if (!getInventory().isEmpty()) { return State.Drop; } Means if the inventory is NOT empty. The ! is a negator to booleans boolean bool = true; if (bool) { // do if true } if (!bool) { //do if false } I assumed the ! means opposite, but wouldnt it just be wrote along the lines of isntEmpty ? inventory.isntempty over !inventory.isempty Edited December 29, 2016 by Drewyboyo Quote Link to comment Share on other sites More sharing options...
Hereweald Posted December 29, 2016 Share Posted December 29, 2016 (edited) I assumed the ! means opposite, but wouldnt it just be wrote along the lines of isntEmpty ? inventory.isntempty over !inventory.isempty http://www.osbot.org/api Read through the API, .isntEmpty() isn't a method. Switch basically means switch around the different cases so: switch(random(1, 30)) { case 1: //do if random(1, 30) produces 1 break; case 2: //do if random(1, 30) produces 2 break; } So for this if getState() method returns the State State.DROP; then it will call the Drop case and execute whatever is written in there. and i think you are misreading, its not in the onStart() it is its own method. Edited December 29, 2016 by Hereweald Quote Link to comment Share on other sites More sharing options...
Juggles Posted December 29, 2016 Share Posted December 29, 2016 No need to create a isntEmpty when you can just do !isEmpty Quote Link to comment Share on other sites More sharing options...
Drewyboyo Posted December 29, 2016 Author Share Posted December 29, 2016 No need to create a isntEmpty when you can just do !isEmpty so the ! is infront of isEmpty or inventory.. or both.. Quote Link to comment Share on other sites More sharing options...
Juggles Posted December 29, 2016 Share Posted December 29, 2016 so the ! is infront of isEmpty or inventory.. or both.. It is infront of inventory. I was just doing pseudo Quote Link to comment Share on other sites More sharing options...
Precise Posted December 29, 2016 Share Posted December 29, 2016 so the ! is infront of isEmpty or inventory.. or both.. ! Basically means NOT, like !Inventory.isEmpty() means NOT empty. Quote Link to comment Share on other sites More sharing options...
Team Cape Posted December 29, 2016 Share Posted December 29, 2016 Not knowing what '!' means is a pretty hard signal that you don't know much about Java. To be blunt, you need to learn a lot more before you will realistically know what you're doing. Quote Link to comment Share on other sites More sharing options...
Drewyboyo Posted December 29, 2016 Author Share Posted December 29, 2016 Not knowing what '!' means is a pretty hard signal that you don't know much about Java. To be blunt, you need to learn a lot more before you will realistically know what you're doing. I already knew it meant like the opposite, but to me it didn't make sense how the ! is infront of inventory and not isempty, because then I read it as opposite of inventory and not opposite of is empty and thats why it was confusing me :b Quote Link to comment Share on other sites More sharing options...
BrainDeadGenius Posted December 29, 2016 Share Posted December 29, 2016 Not knowing what '!' means is a pretty hard signal that you don't know much about Java. To be blunt, you need to learn a lot more before you will realistically know what you're doing. You mean any programming language? @OP, I'd read through some Java guides before attempting to make your own script. Just because it ends up working doesn't mean you won't get banned (more to do with the API than Java in general). Quote Link to comment Share on other sites More sharing options...
Drewyboyo Posted December 29, 2016 Author Share Posted December 29, 2016 You mean any programming language? @OP, I'd read through some Java guides before attempting to make your own script. Just because it ends up working doesn't mean you won't get banned (more to do with the API than Java in general). m8 im not worried about anti ban right now, no ones first script had antiban lol. everyone started somewhere. Quote Link to comment Share on other sites More sharing options...
BrainDeadGenius Posted December 29, 2016 Share Posted December 29, 2016 m8 im not worried about anti ban right now, no ones first script had antiban lol. everyone started somewhere. I'm not talking Anti-ban. I'm talking you mess up the script and your bot starts doing really obvious things a person wouldn't do. Quote Link to comment Share on other sites More sharing options...
Milo Posted December 31, 2016 Share Posted December 31, 2016 www.codecademy.com Quote Link to comment Share on other sites More sharing options...
Drewyboyo Posted December 31, 2016 Author Share Posted December 31, 2016 www.codecademy.com "hello world" x50 Quote Link to comment Share on other sites More sharing options...