Aepeos Posted April 15, 2018 Share Posted April 15, 2018 literally have no idea what to do completely new to this 1 Quote Link to comment Share on other sites More sharing options...
Canidae Posted May 12, 2018 Share Posted May 12, 2018 Very good tutorial, thanks! Quote Link to comment Share on other sites More sharing options...
Coolst0rybr0 Posted May 12, 2018 Share Posted May 12, 2018 Wow just seeing this now ;/ Quote Link to comment Share on other sites More sharing options...
shaba123 Posted May 26, 2018 Share Posted May 26, 2018 Thanks a lot for this, really helpful. Will you be expanding on the GUI section at any point? or can you point me to a tutorial you think is useful for GUI's? Quote Link to comment Share on other sites More sharing options...
Explv Posted July 9, 2018 Author Share Posted July 9, 2018 On 5/26/2018 at 12:31 PM, shaba123 said: Thanks a lot for this, really helpful. Will you be expanding on the GUI section at any point? or can you point me to a tutorial you think is useful for GUI's? Finished off the GUI section. Still not happy with it (don't think it is very tidy or well explained) but it is better than it was before. I may revisit again in the future. 1 Quote Link to comment Share on other sites More sharing options...
sobyandrew Posted July 21, 2018 Share Posted July 21, 2018 I know there haven't been many posts to this recently. I was just running through the tutorial to see if I could get a script working (using Explv's pre-made script), then was going to delve into trying my own. How do you get the script to show up within OSBot's possible scripts to run? I'm using a mac so I created an artifact and put it into the correct file structure from step 2 I believe it is. Then step 3 mentions building the artifact and then refreshing the script list and it should be there. Are there any steps that I'm missing? Thanks for the help and awesome guide! Quote Link to comment Share on other sites More sharing options...
barackogama Posted August 9, 2018 Share Posted August 9, 2018 Awesome post! Thanks a lot! Quote Link to comment Share on other sites More sharing options...
JaguarKnight Posted August 12, 2018 Share Posted August 12, 2018 (edited) Entity tree = getObjects().closest("Tree"); if (tree != null && tree.interact("Chop down")) { new ConditionalSleep(5000) { @Override public boolean condition() { return myPlayer().isAnimating() || !tree.exists(); } }.sleep(); } New to OSBot, but not new to Java. I was following through your tutorial, and I am curious about your sleep condition in this snippet. Why do we want to stop sleeping if myPlayer is animating. Maybe I do not understand what that method will return, but my naive assumption is that myPlayer is animating while in the act of "chopping". It seems to me that this wouldn't sleep at all as it would meet the condition upon either "chopping" or walking to the next tree. Your thoughts on this would be much appreciated Thank you for an awesome guide. Edited August 12, 2018 by JaguarKnight Quote Link to comment Share on other sites More sharing options...
Explv Posted August 12, 2018 Author Share Posted August 12, 2018 (edited) 30 minutes ago, JaguarKnight said: Entity tree = getObjects().closest("Tree"); if (tree != null && tree.interact("Chop down")) { new ConditionalSleep(5000) { @Override public boolean condition() { return myPlayer().isAnimating() || !tree.exists(); } }.sleep(); } New to OSBot, but not new to Java. I was following through your tutorial, and I am curious about your sleep condition in this snippet. Why do we want to stop sleeping if myPlayer is animating. Maybe I do not understand what that method will return, but my naive assumption is that myPlayer is animating while in the act of "chopping". It seems to me that this wouldn't sleep at all as it would meet the condition upon either "chopping" or walking to the next tree. Your thoughts on this would be much appreciated Thank you for an awesome guide. Walking != animating Once the player clicks the tree, this sleep will sleep until the player starts chopping the tree, or until the tree no longer exists, or until 5 seconds has passed. You would want to check if the player is chopping a tree (animating) first: if (!myPlayer().isAnimating()) { // If the player is not chopping a Tree Entity tree = getObjects().closest("Tree"); // Get the closest Tree if (tree != null && tree.interact("Chop down")) { // If the "Chop down" interaction is successful new ConditionalSleep(5000) { // Sleep for 5 seconds, or until the player is animating (chopping the tree), or until the tree no longer exists (someone else chopped it down) @Override public boolean condition() { return myPlayer().isAnimating() || !tree.exists(); } }.sleep(); } } You could also write this in a different way, by having a very long sleep: if (!myPlayer().isAnimating()) { // If the player is not chopping a Tree Entity tree = getObjects().closest("Tree"); // Get the closest Tree if (tree != null && tree.interact("Chop down")) { // If the "Chop down" interaction is successful new ConditionalSleep(90_000, 600) { // Sleep for 90 seconds, or until the tree no longer exists, checking if the tree exists at 600ms intervals @Override public boolean condition() { return !tree.exists(); } }.sleep(); } } Edited August 12, 2018 by Explv 1 Quote Link to comment Share on other sites More sharing options...
JaguarKnight Posted August 12, 2018 Share Posted August 12, 2018 (edited) Ah, that makes sense now. Thank you for such a thorough explanation! I was thinking the logic was ( sleep until no longer chopping or tree is gone ) which is kind of silly considering they would both be true at about the same time. Edited August 12, 2018 by JaguarKnight Quote Link to comment Share on other sites More sharing options...
someguy69 Posted October 21, 2018 Share Posted October 21, 2018 (edited) Hey Explv! Thank you for your tuts, you're a shining light in the dark, especially for brainlets like me. On that note, if anyone else was having trouble with your gui, (I was getting this since the recent 2.5.24 update: "Cannot call invokeAndWait from the event dispatcher thread" ), on a guess I just removed the try/catch blocks, and it turns out this is all you need: (doing this is probably very wrong, I'm no one to learn from, but if you need your code to work, this solution may help, it did for me) Cheers! In your main class: private GUI gui = new GUI(); In onStart: gui = new GUI(); gui.open(); if (!gui.isStarted()) { stop(); return; } Edited October 21, 2018 by someguy69 Removed sentence fragments Quote Link to comment Share on other sites More sharing options...
Dirtdong Posted October 21, 2018 Share Posted October 21, 2018 Was looking for a guide to maybe get started scripting and this is awesome! Thanks Lifetime sponsorship already worth it with community like this 1 Quote Link to comment Share on other sites More sharing options...
Imthabawse Posted February 4, 2019 Share Posted February 4, 2019 (edited) So I've been working on this Oak larder project for a bit now and I'm wondering where I would go from here: @Override public void onStart() { log("Welcome to Simple larders! Let's get started."); } @Override public int onLoop() throws InterruptedException { Entity larder_space = getObjects().closest("Larder space"); if (larder_space != null && larder_space.interact("Build")) { new ConditionalSleep(5000) { @Override public boolean condition() { return !larder_space.exists(); // Not sure I'm using this right either } }.sleep(); } return 1000; } @Override public void onExit() { log("Thanks for using Simple larders!"); } } Now that I got the bot interacting with the "Larder space" and clicking "Build" I'm trying to get it to interact with the widget: RS2Widget widget = widgets.get(458, 5, 4); Which is the "Oak larder" icon but I'm having trouble on implementing this so it flows step by step. My plans for the bot are too: // 0. Make sure your in front of "Larder space" in build mode before starting. // 1.Make bot check inventory to see if "Oak planks" exist. // 2.If true, "Build" the "Larder space" // 3."Remove" the "Larder" and repeat till > 5 "Oak planks" // 4.If > 5 then call butler to un-note "Oak planks" // 5.Wait for butler to get back with "Oak planks" // 6.Repeat You're tutorials helping a lot but some tips or a push in the right direction from someone that knows what they're talking about would be great! Edited February 4, 2019 by Imthabawse Quote Link to comment Share on other sites More sharing options...
Hoots Posted April 18, 2019 Share Posted April 18, 2019 Amazing guide, thanks so much! Made my first few noob scripts following it. Quote Link to comment Share on other sites More sharing options...
Jacksonpm23 Posted April 23, 2019 Share Posted April 23, 2019 (edited) Starting this now. Looks like the most recent guide for this I could find off google haha. If my computer ends up on fire I blame you Do you think codeacademy or something is a good place to fulfill that pre-requisite? @Explv Edited April 23, 2019 by Jacksonpm23 Quote Link to comment Share on other sites More sharing options...