Jump to content

A Beginners Guide to Writing OSBot Scripts (where to get started!) by Apaec


Apaec

Recommended Posts

Hi, so what "execution environment JRE" should i use? It's set as CDC-1.1/Foundation-1.1 by default.

Thanks

 

You're going to want the latest one. At the moment I believe it is JavaSE-1.8, and you can change it by going:

 

window->preferences->Java->Installed JREs, then fiddling around in there.

 

Let me know if you have any other questions!

apa

Link to comment
Share on other sites

So should I just take this and keep doing trial and error on other things in the game such as fishing, other stalls, or what? I want to get into coding but I don't know how to take knowledge from doing this simple tea thiever into another script. ):

I feel you. I found this guide tho, hopefully that will teach us some more smile.png http://osbot.org/forum/topic/28798-pandemics-scripting-series-part-i-setup-and-basic-logic-updated-for-osbot-2/

Link to comment
Share on other sites

I feel you. I found this guide tho, hopefully that will teach us some more smile.png http://osbot.org/forum/topic/28798-pandemics-scripting-series-part-i-setup-and-basic-logic-updated-for-osbot-2/

 

 

So should I just take this and keep doing trial and error on other things in the game such as fishing, other stalls, or what? I want to get into coding but I don't know how to take knowledge from doing this simple tea thiever into another script. ):

 

I understand, i'd suggest you, as Hafdellaren mentioned, have a read of that thread as well. You should try and set your own goals - think of a relatively simple script idea and see if you can get it going. It won't work out at first, but if you ask the right people the right questions you should start to get the hang of it yourself :) As I mentioned, it really is a steep learning curve and you've gotta be in the right mindset to do it, but it's completely possible :)

 

One of the first scripts I tried to write myself was an f2p bone collector and burier at the chaos temple. This gained about 2.5k xp/h (pretty useless, sure), but it taught me the fundamentals of grounditems, and interacting with them, also inventory interactions, Area checks, pathwalking for a deathwalking system (which I added later ofcourse), and also I added a very simple Gui. 

 

There's lots of other ideas, perhaps an iron/clay miner, man thiever, basic fletcher, etc. Just pick one and go for it!

(Perhaps as a start you could add banking to the tea thieving script? - good practice for path walking and banking).

 

Feel free to ask me lots of questions, i'm always happy to answer, and i'm sure answering your question could help others too :)

~apa

Link to comment
Share on other sites

  • 2 weeks later...

It has a class and i've tried it with different names etc :l

 

EDIT; i also get a warning; https://gyazo.com/c5b09c5f5f1fd3054d72f7947bb43275

 

Have you got the project set to the latest JRE? (Not 100% sure how to check, perhaps google will know?) I'm not an eclipse wizard unfortunately, i'm only ok at the programming part!

Link to comment
Share on other sites

Have you got the project set to the latest JRE? (Not 100% sure how to check, perhaps google will know?) I'm not an eclipse wizard unfortunately, i'm only ok at the programming part!

its using the JRE 1.8.0_111

https://gyazo.com/1621d78beaa2fd9e96384133f8c64ebe

 

 

EDIT; I clicked the java button in the top right corner and clicked on reset(https://gyazo.com/784b3ffbe71db432d046106fcb284ee8)

now it works..

Edited by icecake
  • Like 1
Link to comment
Share on other sites

https://gyazo.com/7fa08cda2e910ed9944f79226e0d1667

Can u take a look a this idk what those light bulb are with red crosses?

 

Looks like you're using an outdated JRE. (Java run time environment). You'll have to configure your project to use the latest version. I'm not sure off the top of my head how to do that, however perhaps try clicking the error line like you did in the gif, then selecting the option in the box. If that doesn't seem to lead anywhere, i'm sure a quick google search should narrow down the issue! :)

 

cheers

apa

Link to comment
Share on other sites

Massive thank you, Apaec!

I have always been interested in botting, but after finding this tutorial and a few others about script writing on this forum, I decided to try it out myself with no previous knowledge in programming. I started a couple of days ago briefly going through Codecademy JavaScript lessons (did not finish it, but understood the basics of the language, syntax, etc.).

Thought it was enough for trying out to start creating something myself. Since I am not a member or active OSRS player anymore, I tried to create a woodcutter, based of the code from Tea thiever you posted here. Struggled for almost a day, but found some answers in this thread and elsewhere, so managed to create it!

By no means it's perfect and still needs a lot of work, but IT WORKS! And I am super excited!

 

Now, as for the WoodCutter itself, I created it for regular trees only, is it possible to somehow make it stop running around searching for 'Tree'? I would like it to stay in one spot.

 

Still, thanks! I am looking forward to broadening my knowledge with this simple, yet effective WoodCutter and then, we'll see... :)

Edited by Magerange
  • Like 1
Link to comment
Share on other sites

Massive thank you, Apaec!

I have always been interested in botting, but after finding this tutorial and a few others about script writing on this forum, I decided to try it out myself with no previous knowledge in programming. I started a couple of days ago briefly going through Codecademy JavaScript lessons (did not finish it, but understood the basics of the language, syntax, etc.).

Thought it was enough for trying out to start creating something myself. Since I am not a member or active OSRS player anymore, I tried to create a woodcutter, based of the code from Tea thiever you posted here. Struggled for almost a day, but found some answers in this thread and elsewhere, so managed to create it!

By no means it's perfect and still needs a lot of work, but IT WORKS! And I am super excited!

 

Now, as for the WoodCutter itself, I created it for regular trees only, is it possible to somehow make it stop running around searching for 'Tree'? I would like it to stay in one spot.

 

Still, thanks! I am looking forward to broadening my knowledge with this simple, yet effective WoodCutter and then, we'll see... :)

 

Wew that's great! It's always a good feeling when something works.

Firstly, remember that we're dealing with Java here, not JavaScript. Those are two very different things!

 

As for making it stay in one spot, you can define an area and filter out the trees who are not in this area. That's probably your best bet. Check out here for details on areas: http://osbot.org/api/org/osbot/rs07/api/map/Area.html

 

Good luck! let me know how you get on/if you have any more questions

apa

  • Like 1
Link to comment
Share on other sites

Wew that's great! It's always a good feeling when something works.

Firstly, remember that we're dealing with Java here, not JavaScript. Those are two very different things!

 

As for making it stay in one spot, you can define an area and filter out the trees who are not in this area. That's probably your best bet. Check out here for details on areas: http://osbot.org/api/org/osbot/rs07/api/map/Area.html

 

Good luck! let me know how you get on/if you have any more questions

apa

 

Thanks again!

Perhaps a little dull question - but how I could get the coordinates for specific place on map?

Link to comment
Share on other sites

  • Alek unpinned this topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...