Jump to content

I'm stupid - Script wont start


Eldrism
 Share

Recommended Posts

I'm trying to follow Chris' tutorials on Youtube to hopefully get started so I can make some scripts, however for some reason when I try and run the script it doesn't do anything and I also can't click on anything in Runescape

https://streamable.com/j65s5

 

Here is what I have in IntelliJ:

// CTRL + O to implement methods

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

import java.awt.*;

public class ChocolateCrusher {
    @ScriptManifest(author = "Eldrism", name = "Chocolate Crusher", info = "Crush Chocolate Bars into Chocolate Dust.", version = 0.1, logo = "https://i.imgur.com/WPGHQcY.png")



    public final class Main extends Script {

        @Override
        public final void onStart() {
            log("This will be printed to the logger when the script starts");
            // Anything written in here will only run once.
        }


        @Override
        public final int onLoop() throws InterruptedException {
            //Anything in here will keep on looping (every 600 - 1200 milliseconds).


            NPC npc = getNpcs().closest("Goblin");

            if (npc.isVisible()) {
                //if it is true then it will run the code here
                log("Goblin exists!");
            }
            return (600);

        }


        @Override
        public final void onExit() {
            //Anything written in here will only run once (when the script is stopped).
            log("This will be printed to the logger when the script exits");
        }

        @Override
        public void onPaint(final Graphics2D g) {
            g.drawString("Chocolate Crusher",12,130);
        }



    }
}

 

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.

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.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...