Jump to content

how to setup a script on eclipse


Cmontryme

Recommended Posts

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

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?

 

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