Jump to content

OSBot Script Skeleton - The minimum code to make a script


Alek

Recommended Posts

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

  • 5 months later...

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

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