Jump to content

jar not showing up


lupy

Recommended Posts

Hi guys, 

When i make a jar of a script it's now showing up in the scripts folder maybe there is something wrong with the code and I don't see it.

 

this is the code:

 

package woodcutter;

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

public class woodcutter extends Script {
    final String TREE_NAME = "Tree";

    @ScriptManifest(info="test", logo = "", version = 0, author = "Lupy", name = "Woodcutter script")

    @Override
    public int onLoop() throws InterruptedException {

        if(! getInventory().isFull()) {
            //chop
            Entity tree = objects.closest(TREE_NAME);
            if(tree != null && tree.isVisible()) {
                tree.interact("Chop Down");
            } else {
                camera.toEntity(tree);
            }
        } else {
            //bank
        }
        return 0;
    }



    //when script is started
    public void onStart() {

    }
    //when script is exited
    public void onExit() {

    }
}

 

thanks in advance

 

Link to comment
Share on other sites

The code has nothing to do with creating the jar file.

You need to create an artifact and select the output file to be the OSBot script folder.

Then you can build the artifact which will convert your code to a jar file.

If this confuses you google “how to build an artifact in IntelliJ” and there are very helpful resources online.

Link to comment
Share on other sites

21 hours ago, lupy said:

Hi guys, 

When i make a jar of a script it's now showing up in the scripts folder maybe there is something wrong with the code and I don't see it.

 

this is the code:

 


package woodcutter;

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

public class woodcutter extends Script {
    final String TREE_NAME = "Tree";

    @ScriptManifest(info="test", logo = "", version = 0, author = "Lupy", name = "Woodcutter script")

    @Override
    public int onLoop() throws InterruptedException {

        if(! getInventory().isFull()) {
            //chop
            Entity tree = objects.closest(TREE_NAME);
            if(tree != null && tree.isVisible()) {
                tree.interact("Chop Down");
            } else {
                camera.toEntity(tree);
            }
        } else {
            //bank
        }
        return 0;
    }



    //when script is started
    public void onStart() {

    }
    //when script is exited
    public void onExit() {

    }
}

 

thanks in advance

 

Your script manifest is in the wrong spot. And since OsBot uses that to identify your script it will not show up in the script selector. Place it above the class and all should be fixed.

Edited by BravoTaco
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...