Jump to content

Writing my first script - logs don't appear in the console


Recommended Posts

Posted

I just started writing my first script and followed @Token's tutorial part 1 (see below)

This is my script so far, just logs for now to test if it works.


import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

@ScriptManifest(author = "Me", info = "Test", logo = "", name = "Example Script", version = 1)
public class ExampleScript extends Script {

    @Override
    public void onStart() {
        log("Starting the script.");
    }

    @Override
    public int onLoop() throws InterruptedException {
        log("loop");
        return random(200, 300);
    }

    @Override
    public void onExit() {
        log("Exiting the script.");
    }
}

I can build the jar and run it in osbot. But nothing is being printed in the console. Does anyone have an idea what could be the issue?

Posted (edited)
7 minutes ago, Carrera said:

Thanks but I already had it open. It's showing some logs but none of my script. 

Gif 76e2a4201fcbd113acd903e130be6f9a.gif

So from what I saw earlier is that you every time you build the .jar file, you most refresh scripts to update the script.

Edited by Articuz
  • Like 1
Posted
1 hour ago, Carrera said:

Refreshing the scripts fixed it, thank you!

Glad it worked man, good luck on your journey with writing scripts and don't quit if it get hard. Trial and error can be pain so don't forget to take breaks so you don't burn out and end up losing motivation!
 

  • Like 1
  • Heart 1

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