December 29, 20169 yr 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" ?
December 29, 20169 yr 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, 20169 yr by Hereweald
December 29, 20169 yr Author 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, 20169 yr by Drewyboyo
December 29, 20169 yr 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, 20169 yr by Hereweald
December 29, 20169 yr Author No need to create a isntEmpty when you can just do !isEmpty so the ! is infront of isEmpty or inventory.. or both..
December 29, 20169 yr so the ! is infront of isEmpty or inventory.. or both.. It is infront of inventory. I was just doing pseudo
December 29, 20169 yr so the ! is infront of isEmpty or inventory.. or both.. ! Basically means NOT, like !Inventory.isEmpty() means NOT empty.
December 29, 20169 yr 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.
December 29, 20169 yr Author 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
December 29, 20169 yr 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).
December 29, 20169 yr Author 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.
December 29, 20169 yr 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.
Create an account or sign in to comment