thatguycalledrob Posted September 13, 2017 Share Posted September 13, 2017 Great Quickstart guide, thanks! I did have to change .entity to .RS2Object in my code for some reason - I'm sure I will work out why as I read into the API more! Also there have been some interface changes in newer versions of eclipse (since your screenshots), adding the osbot jar file to your library is in a different interface in eclipse neon. Quote Link to comment Share on other sites More sharing options...
Apaec Posted September 13, 2017 Author Share Posted September 13, 2017 4 minutes ago, thatguycalledrob said: Great Quickstart guide, thanks! I did have to change .entity to .RS2Object in my code for some reason - I'm sure I will work out why as I read into the API more! Also there have been some interface changes in newer versions of eclipse (since your screenshots), adding the osbot jar file to your library is in a different interface in eclipse neon. Cheers (: Yes, this guide is look overdue a re-write. Hopefully I can find time in the coming weeks to work on it! Apa Quote Link to comment Share on other sites More sharing options...
Drokle Posted October 1, 2017 Share Posted October 1, 2017 Great introduction example, after completing this I was able to make up my own script without too many problems. This should be stickied. 1 Quote Link to comment Share on other sites More sharing options...
Rautamies Posted October 4, 2017 Share Posted October 4, 2017 https://gyazo.com/174eb8879e30f76086794a1b4f95830f What i can do? Quote Link to comment Share on other sites More sharing options...
Apaec Posted October 4, 2017 Author Share Posted October 4, 2017 1 minute ago, Rautamies said: https://gyazo.com/174eb8879e30f76086794a1b4f95830f What i can do? Not sure have a look at the log file, see what it says, and maybe try googling ? Quote Link to comment Share on other sites More sharing options...
justin111111 Posted October 7, 2017 Share Posted October 7, 2017 re-write this! 1 Quote Link to comment Share on other sites More sharing options...
BeefWellington Posted October 7, 2017 Share Posted October 7, 2017 I am trying to compile this script and I get the .jar file into the scripts folder, but when I open OSBot it does not show up. How to fix this? Quote Link to comment Share on other sites More sharing options...
Apaec Posted October 8, 2017 Author Share Posted October 8, 2017 10 hours ago, BeefWellington said: I am trying to compile this script and I get the .jar file into the scripts folder, but when I open OSBot it does not show up. How to fix this? Are you sure the script successfully compiled, you didn't re-use the same name for a different jar, and the manifest is correct? Otherwise there's no reason it shouldn't show up! Also make sure you have the build path set up correctly! Quote Link to comment Share on other sites More sharing options...
Broker12 Posted October 22, 2017 Share Posted October 22, 2017 I tried to make a simple power chopping script, building off of your tea thiever. However, it empties the inventory of logs and not the axe, like its supposed to, then it hovers over the tree and never attempts to chop. I think the issue is in using !inventory.isEmptyExcept import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(author = "broker12", info = "Power chops", name = "OakChopper", version = 0, logo = "") public class Main extends Script { @Override public void onStart() { log("OakChopper status: Started"); } private enum State { CHOP, DROP, WAIT, }; private State getState() { RS2Object tree = getObjects().closest("Oak"); if (!inventory.isEmptyExcept("Rune axe")) return State.DROP; if (tree != null) return State.CHOP; return State.WAIT; } @Override public int onLoop() throws InterruptedException { switch (getState()) { case CHOP: RS2Object tree = getObjects().closest("Oak"); if (tree != null) { tree.interact("Chop-down"); } break; case DROP: inventory.dropAllExcept("Rune axe"); break; case WAIT: sleep(random(400, 700)); break; } return random(200, 300); } @Override public void onExit() { log("OakChopper status: Ended"); } @Override public void onPaint(Graphics2D g) { } Quote Link to comment Share on other sites More sharing options...
Apaec Posted October 22, 2017 Author Share Posted October 22, 2017 15 minutes ago, Broker12 said: I tried to make a simple power chopping script, building off of your tea thiever. However, it empties the inventory of logs and not the axe, like its supposed to, then it hovers over the tree and never attempts to chop. I think the issue is in using !inventory.isEmptyExcept import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; @ScriptManifest(author = "broker12", info = "Power chops", name = "OakChopper", version = 0, logo = "") public class Main extends Script { @Override public void onStart() { log("OakChopper status: Started"); } private enum State { CHOP, DROP, WAIT, }; private State getState() { RS2Object tree = getObjects().closest("Oak"); if (!inventory.isEmptyExcept("Rune axe")) return State.DROP; if (tree != null) return State.CHOP; return State.WAIT; } @Override public int onLoop() throws InterruptedException { switch (getState()) { case CHOP: RS2Object tree = getObjects().closest("Oak"); if (tree != null) { tree.interact("Chop-down"); } break; case DROP: inventory.dropAllExcept("Rune axe"); break; case WAIT: sleep(random(400, 700)); break; } return random(200, 300); } @Override public void onExit() { log("OakChopper status: Ended"); } @Override public void onPaint(Graphics2D g) { } That sounds like you might have got the interaction name wrong; double check what the exact (case sensitive) interaction is by overing over the oak tree and looking at the tool tip! Quote Link to comment Share on other sites More sharing options...
Broker12 Posted October 22, 2017 Share Posted October 22, 2017 Thanks! It works now but it ends up dropping each log as soon as it gets it. Fiddling with it now. Quote Link to comment Share on other sites More sharing options...
Apaec Posted October 22, 2017 Author Share Posted October 22, 2017 39 minutes ago, Broker12 said: Thanks! It works now but it ends up dropping each log as soon as it gets it. Fiddling with it now. Nice, that's because you're checking 'is empty except'. Perhaps try checking for a full inventory instead? Quote Link to comment Share on other sites More sharing options...
BotArmy_Sabo Posted October 22, 2017 Share Posted October 22, 2017 This is cool, thanks man! currently learning Java before my next CS semester. So glad to have a few ideas in the right direction! 1 Quote Link to comment Share on other sites More sharing options...
Vitanet Posted October 22, 2017 Share Posted October 22, 2017 its good netbeans ide? and how i can setup Quote Link to comment Share on other sites More sharing options...
Apaec Posted October 22, 2017 Author Share Posted October 22, 2017 1 minute ago, vitanet said: its good netbeans ide? and how i can setup You can use whichever IDE you want, even notepad if you are crazy enough! I personally use eclipse and it works well for me, but i've heard good things about IntelliJ Idea. Quote Link to comment Share on other sites More sharing options...