LostOtaku Posted December 15, 2018 Share Posted December 15, 2018 (edited) 15 hours ago, ReaperScripts said: I'm missing the .setting section of the project Does anyone know how to fix this? I had the same issue, but it seems it's not a problem at all, might just be because his pictures were created from a while back, updates may have changed it. Just try running it and it should be fine. I am confused about one thing though, why when I drop each cup of tea as it appears in my inventory it right clicks and presses drop, yet if I change that section to if (getInventory().isFull()) { //Checks if inventory is full getInventory().dropAll("Cup of Tea"); // drops all cups of tea It just shift clicks them (the more optimal setting if turned on), I was wondering how to make this the general option for even just dropping one. EDIT Sorted this out by just changing the one that drops them as soon as they appear in your inventory to also dropAll("Cup of Tea") and then it shift click drops them, I'm actually so slow lmao. I guess dropAll > drop xddd However on another note I'm trying to make a 3rd version of the tea script that banks, I've got it to locate the nearest bank and open the bank booth @Override public int onLoop() throws InterruptedException { RS2Object stall = getObjects().closest("Tea Stall"); //Checks for nearest tea stall to player location if (getInventory().isFull()) { //Checks invo for cup of tea RS2Object bank = getObjects().closest("Bank booth"); // Checks for nearest bank booth bank.interact("Bank"); //Opens the banking interface sleep(500); //if invo contains cup of tea and proceeds to drop it then after this sleeps for 0.5s } else if (stall != null && !myPlayer().isAnimating()) { //if no tea in invo checks if player is animating stall.interact("Steal-from"); // if player ins't animating steals from the stall sleep(500); //After stealing from stall sleeps for 0.5s before looping to start of script } return random(200, 300); } Just unsure how to actually either right click and deposit all the "Cup of Tea"s or how to click deposit inventory button. Any help would be greatly appreciated. (On a side note, sorry for my code not having colours in here, I'm not sure how to do that, I just copy and pasted it) Edited December 15, 2018 by LostOtaku Quote Link to comment Share on other sites More sharing options...
Apaec Posted December 15, 2018 Author Share Posted December 15, 2018 1 hour ago, LostOtaku said: I had the same issue, but it seems it's not a problem at all, might just be because his pictures were created from a while back, updates may have changed it. Just try running it and it should be fine. I am confused about one thing though, why when I drop each cup of tea as it appears in my inventory it right clicks and presses drop, yet if I change that section to if (getInventory().isFull()) { //Checks if inventory is full getInventory().dropAll("Cup of Tea"); // drops all cups of tea It just shift clicks them (the more optimal setting if turned on), I was wondering how to make this the general option for even just dropping one. EDIT Sorted this out by just changing the one that drops them as soon as they appear in your inventory to also dropAll("Cup of Tea") and then it shift click drops them, I'm actually so slow lmao. I guess dropAll > drop xddd However on another note I'm trying to make a 3rd version of the tea script that banks, I've got it to locate the nearest bank and open the bank booth @Override public int onLoop() throws InterruptedException { RS2Object stall = getObjects().closest("Tea Stall"); //Checks for nearest tea stall to player location if (getInventory().isFull()) { //Checks invo for cup of tea RS2Object bank = getObjects().closest("Bank booth"); // Checks for nearest bank booth bank.interact("Bank"); //Opens the banking interface sleep(500); //if invo contains cup of tea and proceeds to drop it then after this sleeps for 0.5s } else if (stall != null && !myPlayer().isAnimating()) { //if no tea in invo checks if player is animating stall.interact("Steal-from"); // if player ins't animating steals from the stall sleep(500); //After stealing from stall sleeps for 0.5s before looping to start of script } return random(200, 300); } Just unsure how to actually either right click and deposit all the "Cup of Tea"s or how to click deposit inventory button. Any help would be greatly appreciated. (On a side note, sorry for my code not having colours in here, I'm not sure how to do that, I just copy and pasted it) Glad you got the dropping sorted! Although it is weird that just calling 'drop' doesn't shift drop as well.. As for banking, you would want to use the banking API: https://osbot.org/api/org/osbot/rs07/api/Bank.html Try something like getBank().depositAll(); gl! Apa Quote Link to comment Share on other sites More sharing options...
LostOtaku Posted December 16, 2018 Share Posted December 16, 2018 On 12/15/2018 at 4:15 PM, Apaec said: Glad you got the dropping sorted! Although it is weird that just calling 'drop' doesn't shift drop as well.. As for banking, you would want to use the banking API: https://osbot.org/api/org/osbot/rs07/api/Bank.html Try something like getBank().depositAll(); gl! Apa Worked perfectly with what I had thanks, I also managed to play around with that line and get it deposit certain items etc. was lots of fun~ On another note would it be possible for you to create a WindowBuilder GUI tutorial? I've been trying for the last day using various tutorials on this website and nobody seems to lay out EVERY step (for someone like me with no brain xd) like you did in your tutorial here, which allowed me to learn SO much about different lines and how to improve this singular script in various ways. You have anything that would be useful, I've managed to create a GUI with a drop down list and a start button, but unsure how to either link my scripts to the various drop down lists or whatever I'm suppose to do. It would be incredibly useful if my list could for example like fetch said option (if I have each separate option as a different .class). Not sure if I'm looking at this the wrong way or what. 1 Quote Link to comment Share on other sites More sharing options...
Apaec Posted December 17, 2018 Author Share Posted December 17, 2018 On 12/16/2018 at 6:43 PM, LostOtaku said: Worked perfectly with what I had thanks, I also managed to play around with that line and get it deposit certain items etc. was lots of fun~ On another note would it be possible for you to create a WindowBuilder GUI tutorial? I've been trying for the last day using various tutorials on this website and nobody seems to lay out EVERY step (for someone like me with no brain xd) like you did in your tutorial here, which allowed me to learn SO much about different lines and how to improve this singular script in various ways. You have anything that would be useful, I've managed to create a GUI with a drop down list and a start button, but unsure how to either link my scripts to the various drop down lists or whatever I'm suppose to do. It would be incredibly useful if my list could for example like fetch said option (if I have each separate option as a different .class). Not sure if I'm looking at this the wrong way or what. Glad that helped I'd like to make a UI tutorial at some point, but i'm a little pushed for time at the moment. The good thing about making a GUI is it is not specific to OSBot scripts. The UI code and indeed the way this code links to your script is very generic and as such all tutorials that you can find online should be relevant. Key words to google are 'Java swing gui'. A simple initial way to get the two classes to communicate is by using static variables (although note that this solution is not very elegant and goes against object oriented principles). A better way would be for your script class to create a GUI class and call corresponding getter methods in said class. Good luck! Apa Quote Link to comment Share on other sites More sharing options...
LostOtaku Posted December 18, 2018 Share Posted December 18, 2018 15 hours ago, Apaec said: Glad that helped I'd like to make a UI tutorial at some point, but i'm a little pushed for time at the moment. The good thing about making a GUI is it is not specific to OSBot scripts. The UI code and indeed the way this code links to your script is very generic and as such all tutorials that you can find online should be relevant. Key words to google are 'Java swing gui'. A simple initial way to get the two classes to communicate is by using static variables (although note that this solution is not very elegant and goes against object oriented principles). A better way would be for your script class to create a GUI class and call corresponding getter methods in said class. Good luck! Apa Ah then of course that's fine, I know the one for sure. I'll look into Java Swing UI and getter methods (and maybe some static variables too) and hopefully I'll have a lot more knowledge on the subject when all's done, thanks for at least helping me find the right way to go about things. 1 Quote Link to comment Share on other sites More sharing options...
Apaec Posted December 18, 2018 Author Share Posted December 18, 2018 5 hours ago, LostOtaku said: Ah then of course that's fine, I know the one for sure. I'll look into Java Swing UI and getter methods (and maybe some static variables too) and hopefully I'll have a lot more knowledge on the subject when all's done, thanks for at least helping me find the right way to go about things. It's certainly a pretty steep learning curve but it sounds like you're motivated enough to overcome it. Good luck! Apa Quote Link to comment Share on other sites More sharing options...
ramy523 Posted January 11, 2019 Share Posted January 11, 2019 On 12/18/2018 at 1:21 PM, Apaec said: It's certainly a pretty steep learning curve but it sounds like you're motivated enough to overcome it. Good luck! Apa im getting this error when trying to compile - https://imgur.com/a/ReFF6E9 any ideas? Quote Link to comment Share on other sites More sharing options...
Apaec Posted January 11, 2019 Author Share Posted January 11, 2019 5 hours ago, ramy523 said: im getting this error when trying to compile - https://imgur.com/a/ReFF6E9 any ideas? Have you got any funny characters in your file? Not sure - i'd suggest googling this error, there should be plenty of eclipse support online Apa Quote Link to comment Share on other sites More sharing options...
dansb95 Posted January 16, 2019 Share Posted January 16, 2019 Hey Apaec! This was a wonderful tutorial! I have coding experience with Python, but never with Java. The IDE is a bit overwhelming but you explained it very well, and I was able to follow to the end. Thing is, I went to go try my script and I realized: I'm not a member! So I can't thieve, and thus can't test my script. And I don't want to try my first simple script on my main, or any account with members really. So point of the post, besides thanking you, is: how should I go about looking into the other commands or keywords from the osbot API. Like, if I want to try writing a woodcutting script, I would want to know how to get a tree from getObjects. I guess I'm looking for like documentation for the osbot commands/API. So that I could see all the possible commands and have a description of what each one does. Any idea if that exists? Or the closest thing to it? Thank you again, and I appreciate it/this tutorial! - Dan Quote Link to comment Share on other sites More sharing options...
Apaec Posted January 17, 2019 Author Share Posted January 17, 2019 3 hours ago, dansb95 said: Hey Apaec! This was a wonderful tutorial! I have coding experience with Python, but never with Java. The IDE is a bit overwhelming but you explained it very well, and I was able to follow to the end. Thing is, I went to go try my script and I realized: I'm not a member! So I can't thieve, and thus can't test my script. And I don't want to try my first simple script on my main, or any account with members really. So point of the post, besides thanking you, is: how should I go about looking into the other commands or keywords from the osbot API. Like, if I want to try writing a woodcutting script, I would want to know how to get a tree from getObjects. I guess I'm looking for like documentation for the osbot commands/API. So that I could see all the possible commands and have a description of what each one does. Any idea if that exists? Or the closest thing to it? Thank you again, and I appreciate it/this tutorial! - Dan Thanks for the comments! In hindsight, it was a bit silly to use a thieving script as an example. Perhaps a wood cutter might have been better The API can be found here: https://osbot.org/api/ and the classes available to you are listed on the left. It can sometimes take a bit of browsing to find what you're looking for, but most things are covered so you shouldn't have too much of a problem if you've read documentation before. Malcolm gave a nice example of interacting with a tree so that is a good starting point! Let me know if you have any further questions -Apa Quote Link to comment Share on other sites More sharing options...
Imthabawse Posted January 26, 2019 Share Posted January 26, 2019 Very nice tutorial. I've been wanting to get back into coding and make bots for fun and if there good enough share with the community. 1 Quote Link to comment Share on other sites More sharing options...
Fredz Posted January 27, 2019 Share Posted January 27, 2019 (edited) Thank you for this tutorial! Just made my first script, a woodcutter Edited January 27, 2019 by Fredz 1 Quote Link to comment Share on other sites More sharing options...
Imthabawse Posted January 27, 2019 Share Posted January 27, 2019 I give you guys a lot of credit, this scripting shit isn't for the faint of heart. I've been reading different tutorials, watching videos etc and all I've come up with so far is this: package oaklarders; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; // Start script lvl 33 Construction @ScriptManifest(author = "Imthabawse", info = "Oaklarder Builder", logo = "", name = "Oaklarders", version = 0) public class Oaklarders extends Script { @Override public void onStart() { log("Sit back and relax"); } @Override public int onLoop() throws InterruptedException { return random(200, 300); } @Override public void onExit() { log("Thank's for using Oaklardersv1"); } // Make bot build and remove larders // Make bot interact with butler to unote planks // Make bot call servant if needed // Add humanlike behavior sleeps etc } To say the least I'm very new to this but I'm eager to learn from all the amazing scripters on Osbot and add to the community. Quote Link to comment Share on other sites More sharing options...
Apaec Posted January 28, 2019 Author Share Posted January 28, 2019 11 hours ago, Imthabawse said: I give you guys a lot of credit, this scripting shit isn't for the faint of heart. I've been reading different tutorials, watching videos etc and all I've come up with so far is this: package oaklarders; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; // Start script lvl 33 Construction @ScriptManifest(author = "Imthabawse", info = "Oaklarder Builder", logo = "", name = "Oaklarders", version = 0) public class Oaklarders extends Script { @Override public void onStart() { log("Sit back and relax"); } @Override public int onLoop() throws InterruptedException { return random(200, 300); } @Override public void onExit() { log("Thank's for using Oaklardersv1"); } // Make bot build and remove larders // Make bot interact with butler to unote planks // Make bot call servant if needed // Add humanlike behavior sleeps etc } To say the least I'm very new to this but I'm eager to learn from all the amazing scripters on Osbot and add to the community. Looks like a good start so far. I have to say, making oak larders is quite an adventurous script to write as your first. You may find it easier to work with something simpler to begin with, then work your way up Perhaps a simple oak chopping script? Apa 1 Quote Link to comment Share on other sites More sharing options...
Imthabawse Posted January 29, 2019 Share Posted January 29, 2019 Yeah I've started a woodcutting project to get an idea how to get the bot to actually interact with something first. Slowly add in banking, sleeps, etc. Any tips and or snippets would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...