Jump to content

Do scripts not need public static void main?


Recommended Posts

Posted

I was reading the guide on how to setup a basic script and I didn't see it anywhere. I'm not new to java, I have about 6 months of experience with it, but i've never wrote anything that didn't use public static void main.

 

Scripts aren't standalone applications, the main method is in the code of the client (through which a script is executed).

Posted

Scripts aren't standalone applications, the main method is in the code of the client (through which a script is executed).

 

ahh okay that makes more sense. Everything I have written so far has just been standalone. Thanks for the quick reply! Don't know why I didnt think of this lol.

Posted

Your script class files get loaded into memory by the bot. The bot then calls the necessary methods within your script (#onLoop, #onStart, etc.) to make it "work". You're not starting a new process.

 

Yeah, it makes a lot more sense now. I didn't really have a good understanding of how osbot/its api worked. Still trying to figure all that out.

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

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