Jump to content

OSBot Script Skeleton - The minimum code to make a script


Recommended Posts

Posted

import org.osbot.rs07.script.Script;

import org.osbot.rs07.script.ScriptManifest;

import java.awt.*;

@ScriptManifest(name = "Skeleton", author = "Alek", version = 1.0, info = "", logo = "") 

public class Skeleton extends Script {

    @Override

    public void onStart() {

        //Code here will execute before the loop is started

    }

    

    @Override

    public void onExit() {

        //Code here will execute after the script ends

    }

    @Override

    public int onLoop() {

        return 100; //The amount of time in milliseconds before the loop starts over

    }

    @Override

    public void onPaint(Graphics2D g) {

        //This is where you will put your code for paint(s)

    }

}

  • Like 11
  • 5 months later...
Posted

Did I do something completely wrong. new to eclipse tongue.png http://prntscr.com/69pl97

 

you need to add OSBot client to the project, then the imports at the top which you missed out will work ^_^

 

To do this please do the following:

 - Right click on the Java Project and select Properties (at the bottom of the list).

 - Now a window will appear, select "Java Build Path" on the left hand side.

 - Now select the "Libraries" tab in the top middle of the window.

 - Then you will see on your left there is a button saying "Add External JARS..."

 - Navigate to the latest version of OSBot client is downloaded.

 - Press Open.

 - Press Ok.

 

Then the imports should work and so will all the other errors ^_^

 

 

Precise

  • Like 1
Posted (edited)

How do I go about getting model id so I can tell the script what to click on? I don't see anything for it inside the osbot client.

 

Settings > Debug tab > Entity Hover Debug (left column)

 

Additionally, there are plenty of methods in the API that take a string argument so you don't need the ID just the name.

Edited by organicjello

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