Jump to content

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


Recommended Posts

Posted
28 minutes ago, Imrabid said:

What have i done wrong?

f170ce2dffcb5f811ef5290b268e33fc.png

Hey!

Firstly, you have created a new class above imports which cannot be done. If you want both classes in the same file, you will have to move the top one down below imports.

Secondly, both classes are named 'main', which is also not allowed. Choose a different name!

Thirdly, by convention, classes should start with a capital letter, e.g 'Main' instead of 'main'. It's just convention so it doesn't make any difference in terms of execution, but conventions are good to stick to! (I realise I stupidly named it with a lowercase in the tutorial, i've been meaning to rewrite this tutorial for a while now!)

In short, to fix your problem, just remove the top 'public class main { }'.

GL!

Apa

  • 1 month later...
Posted
27 minutes ago, Apaec said:

Hi there folks!

Just spent a couple of hours revamping the content of this guide. I did not change the download guide (I plan to update this in the near future). I only updated the interesting stuff :)

Take a look, best of luck!

Apa

Hey APA appreciate it. I have been eyeing this thread curious if it was still up to date seeing as it was written back in 14.

 

Thanks!

  • Like 1
Posted (edited)
6 hours ago, Apaec said:

Hi there folks!

Just spent a couple of hours revamping the content of this guide. I did not change the download guide (I plan to update this in the near future). I only updated the interesting stuff :)

Take a look, best of luck!

Apa

Was looking to get into scripting.. thank you for updating this you are a god send

Edited by pathwayp
  • 2 weeks later...
Posted (edited)

Tried exporting a very simple script to see if it would work but it doesn't appear when i load osbot. Not runnable jar , saved to right place, refreshed and restarted osbot. any idea?

edit: Gave .Jar to someone 

"i decompiled your code, copy pasted it, recompiled and it worked"

? ???????

Edited by FuryShark
Posted
13 hours ago, FuryShark said:

Tried exporting a very simple script to see if it would work but it doesn't appear when i load osbot. Not runnable jar , saved to right place, refreshed and restarted osbot. any idea?

edit: Gave .Jar to someone 

"i decompiled your code, copy pasted it, recompiled and it worked"

? ???????

Most likely you've got multiple jars in your scripts folder with the same script manifest name ?

You can test this by moving all your local scripts elsewhere (e.g your desktop), and only having your simple script in the directory. Then start OSBot and see if it shows up. If it still does not, let me know!

-Apa

Posted
2 hours ago, Apaec said:

Most likely you've got multiple jars in your scripts folder with the same script manifest name ?

You can test this by moving all your local scripts elsewhere (e.g your desktop), and only having your simple script in the directory. Then start OSBot and see if it shows up. If it still does not, let me know!

-Apa

This didnt change anything, but

when i gave it to my friend, he decompiled the jar i sent him then recompiled and gave it to me and it showed up. he didnt change anything in the script. 

and we both did exactly the same method thats shown in your tutorial for exporting.  

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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