Jump to content

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


Apaec

Recommended Posts

  • 1 month later...
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

Link to comment
Share on other sites

  • 1 month later...
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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 2 weeks later...

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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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...