Jump to content

Local scripts not showing up


shtknt

Recommended Posts

Hey there, started to play around with scripting, although I can't find where to test my script, nothing is shown within the client, i'm assuming something is not right with my script manifest?, my code;

import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;

@ScriptManifest(name = "Cow Killer", author = "programer", version = 1.0, info = "", logo = "")
public class CowKiller extends Script{

    private String message;

    @Override
    public void onStart() throws InterruptedException {
        for(NPC n : npcs.getAll()){
            if(n != null)
                message = n.getName() + ", " + n.getId();
                System.out.println(message);
        }
    }

    @Override
    public int onLoop() throws InterruptedException {
        return 0;
    }
}

Link to comment
Share on other sites


import org.osbot.rs07.script.Script;

import org.osbot.rs07.script.ScriptManifest;

import java.awt.*;

@ScriptManifest(name = "Cow Killer", author = "programer", version = 1.0, info = "", logo = "")

public class CowKiller extends Script {

private String message;

@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() {

for(NPC n : npcs.getAll())

{

if(n != null)

message = n.getName() + ", " + n.getId();

System.out.println(message);

}

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)

}

}

Edited by twin 763
Link to comment
Share on other sites

Okay so I am not too familiar with eclipse or OSbot so my answer may sound very stupid or may be hard to follow... however i encountered the same problem, but messed with setting inside eclipse and then it suddenly loaded my local scripts after exporting my script for the 20th time hahahah. So my advice may be completely garbage to you, but this is what i did.

 

I freshly installed eclipse, made my basic script (used multiple templates and none would load in my local scripts in OSbot directory after exporting)

I began getting very frustrated and figured something had to be messed up with how it was compiling, so I clicked on my PROJECT folder(NOT the main.java file or whatever name you chose) then went to the FILE tab on the top left, then clicked PROPERTIES, and then a window will pop up.

 

From there i clicked on Java Compiler and unchecked the 2nd box from the top so that it would allow me to manually change the settings to 1.7 for the first 2 boxes, then decided to apply those settings.

 

Finally I clicked the box that makes it so i cant change those settings (2nd box from top) then hit apply again.

 

Whenever i hit apply the first time it had to change my project around and ever since i did that i could export fine and it would read my scripts. I think this had something to do with eclipse, i had set setting to 1.7 when i created my project however it didn't set it up that way i guess and when i applied the settings after messing with compiler it worked.

 

I know my directions are confusing and seem pointless because technically all i did was change the settings a bit then change them back, but it worked for me and i hope it helps you hahahahaha, otherwise i am just going to sound way stupider than i already do mellow.png

 


BTW i compiled your script as well and it loaded in my directory so your script itself is fine. it has to be your compiling options or you're not exporting it to the OSbot/scripts folder

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