DKoumane Posted March 30, 2016 Share Posted March 30, 2016 Hi all. I've been wanting to get into making scripts for a while now. I have no classroom knowledge of Java, but I am familiar with C++. I have taken the introductory to C++ course, which taught me the basics (types, syntax, functions, if-statements, etc), and I just recently finished a course on Object Oriented Programming (it involved a lot of class types) and it looks very similar to this Java coding. I just started playing around with java and following Apaec's basic guide, I can now get my character to attack cows. But here is where I feel I need exposure to: I've been seeing bits of other example codes and I've seen functions such as "isUnderAttack()" or "myPlayer()" and I was wondering if there is a list of these functions I could view. I am trying to incorporate eating in my basic cow killer, just to play around and get more familiarized with RS coding. I assume it would be something like... private static final int pike = 351; //pike if (myPlayer.hitpoints() < 5) { inventory.pike.interact(pike); } This is just an assumption. I don't know if there is a hitpoints() function, or if my syntax is correct. I hope I'm not confusing anyone. Pretty much is there a list of functions that I can see that exists? Any steps in the right direction would greatly be appreciated as well. Thank you all! Quote Link to comment Share on other sites More sharing options...
Rudie Posted March 30, 2016 Share Posted March 30, 2016 You can view all methods here: http://osbot.org/api/ Quote Link to comment Share on other sites More sharing options...
Vilius Posted March 30, 2016 Share Posted March 30, 2016 Look at the api page at the top if the forums, look in the tutorial section I have a tutorial about the APIs documentation. Plus if you know oop look at my guide about tasks or someone elses taks tutorials. Because Apeacs tutorial is a bit outdated :\ Goodluck :p Quote Link to comment Share on other sites More sharing options...
Isolate Posted March 30, 2016 Share Posted March 30, 2016 (edited) Most things are documented pretty well in the API most base calls are pretty straight forward, Think as close as you can to english, but then allow for the fact it's a program Your example in the most basic form in the OSBot api would look like final int PIKE = 351; if(myPlayer().getCurrentHealth() < 5){ getInventory().getItem(PIKE).interact(); } so most things you'd ever need to access are pretty straight foward , eg. myPlayer() getInventory() getBank() getGroundItems() ect.storing stuff is pretty straight foward too Item itemExample = getInventory().getItem("Example name"); GroundItem groundItemExample = getGroundItems().closest("Example Name"); RS2Object objectExample = getObjects().closest("Example name"); ectit's pretty straight forward, if in doubt, search api Edited March 30, 2016 by Isolate Quote Link to comment Share on other sites More sharing options...
DKoumane Posted March 30, 2016 Author Share Posted March 30, 2016 Thank you everyone! I will look into it. I appreciate the very fast responses! Quote Link to comment Share on other sites More sharing options...
FrostBug Posted March 30, 2016 Share Posted March 30, 2016 All the API access methods you use come from the MethodProvider, have a look around in there http://osbot.org/api/org/osbot/rs07/script/MethodProvider.html Quote Link to comment Share on other sites More sharing options...