Jump to content

how to setup a script on eclipse


Recommended Posts

Posted (edited)
On 1/16/2025 at 5:39 PM, Czar said:

This one needs to be Java 8, be careful it says JavaSE-21 there, need to right click project -> configure build path -> select jre system library -> edit... -> java 8 or java 1.8

I love how Czar takes me under his wing regardless of a decade year long "mutial relationship" :))) ty Czar, I wasn't sure if I needed JDK 8 or if JRE 21 would have worked but I will give it a shot. tytytyty

EDIT: Java 1.8 Worked ty !

Edited by Cmontryme
  • Like 1
Posted
On 1/20/2025 at 7:26 AM, Cmontryme said:

Could someone figure out how to setup a script skeleton and compile it in the modern version of eclipse? I am going to have to dodge this IntelliJ trial but I really like the eclipse look. plzzzzz

Intellij is free, just make sure you get the community edition.
Or if you stick with Eclipse, watch a few videos on how to compile java code to a jar file.

make sure you main.java looks a bit like this:

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

import java.awt.*;


@ScriptManifest(name = "Skeleton", author = "Wack", version = 1.0, info = "", logo = "") 
public class Skeleton extends Script {


    @Override
    public void onStart() {
        //Code here will execute at the start of the script only ones!
        //often used for guis etc.
    }
  
    @Override
    public void onExit() {
        //Code here will execute after the script gets stopped
    }

    @Override
    public int onLoop() {  
        //here goes your script!
        //e.g.
		if (!Banks.GRAND_EXCHANGE.contain(myPosition())) {
			getWalking().webWalk(Banks.GRAND_EXCHANGE);
		}
       return 100; //The amount of time in milliseconds before the loop starts over 600ms is one game tick ^^
    }

    @Override
    public void onPaint(Graphics2D g) {
        //This is where you will put your code for paint(s)
    }
}

 

Just adding this maybe usefull?

 

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