lfcandy Posted April 4, 2017 Posted April 4, 2017 @Apaec I get the same error now for RS2Object now. I have the OSBot 2.4.118 jar in referenced libraries. Eclipse quick-fixed it for me when I clicked on RS2Object and selected import RS2Object(or something similar). not sure what was going on
Apaec Posted April 4, 2017 Author Posted April 4, 2017 2 minutes ago, lfcandy said: @Apaec I get the same error now for RS2Object now. I have the OSBot 2.4.118 jar in referenced libraries. Eclipse quick-fixed it for me when I clicked on RS2Object and selected import RS2Object(or something similar). not sure what was going on Can you send me a screenshot of the exact error you're getting perhaps?
lfcandy Posted April 4, 2017 Posted April 4, 2017 (edited) forgot to crop... If I click 'import entity from osbot' the red line goes away and the script works. @Apaec Edited April 4, 2017 by lfcandy
Apaec Posted April 4, 2017 Author Posted April 4, 2017 18 minutes ago, lfcandy said: forgot to crop... If I click 'import entity from osbot' the red line goes away and the script works. @Apaec Ah, yeah. You need to make sure you import the things that you're using!
skeetballs Posted April 23, 2017 Posted April 23, 2017 (edited) Alright so I'm trying to make a basic powerfisher using my very limited knowledge. Here's what I have Quote import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.api.model.NPC; @ScriptManifest(name = "skeetfish", author = "skeetballs", version = 1.0, info = "", logo = "") public class Todfish extends Script { private enum State { FISH, DROP, WAIT }; private State getState() { NPC fishspot = (NPC) objects.closest("Fishing Spot"); if (!inventory.isEmptyExcept("Feather","Fly fishing rod")) return State.DROP; if (fishspot != null) return State.FISH; return State.WAIT; } @Override public int onLoop() throws InterruptedException { switch (getState()) { case FISH: NPC fishspot = (NPC) objects.closest("Fishing spot"); if (fishspot != null) { fishspot.interact("Lure"); } break; case DROP: inventory.dropAll("Trout","Salmon"); break; case WAIT: sleep(random(500, 700)); break; } return random(200, 300); } } Edited April 23, 2017 by skeetballs
Apaec Posted May 28, 2017 Author Posted May 28, 2017 Just rewrote a few parts of the tutorial since a few sections were unclear and poorly written. If you're reading, please refresh the page! Cheers -Apa
Abysm Posted June 13, 2017 Posted June 13, 2017 Really nice tutorial! I managed to make my first script ever! It only powerchops oak tho 1
Jakobson Posted June 28, 2017 Posted June 28, 2017 Well writed guide, nice. How did you start your own coding career?
Apaec Posted June 28, 2017 Author Posted June 28, 2017 9 hours ago, Jakobson said: Well writed guide, nice. How did you start your own coding career? Started out here, found a reputable scripter and annoyed them alot with questions!
osrs_pvm Posted July 5, 2017 Posted July 5, 2017 (edited) On 6/28/2017 at 5:21 AM, Apaec said: Started out here, found a reputable scripter and annoyed them alot with questions! Thanks for the guide, this will probably be me Edited July 5, 2017 by osrs_pvm
Apaec Posted July 5, 2017 Author Posted July 5, 2017 37 minutes ago, osrs_pvm said: Thanks for the guide, this will probably be me To answer your previous question, you will see that our script extends Script. This is an abstract class in the OSBot API and since we are extending it, we have access to all of its attributes. An example of an attribute is inventory, whereby we are calling the super inventory object attribute and using the methods that it provides. As for the stall, you will find that that is initialised just above the snippet you quoted, we're creating an instance of an RS2Object which is an API object describing an ingame object. Hope that makes sense, let me know if you're still unsure. Since you edited the post I would assume you figured this out yourself but I just thought i'd drop a quick reply in to clear it up if you didn't! -Apa