Jump to content

Getting the error, cannot find symbol class Message, any tips? Thank you


CheckingItOut

Recommended Posts

Hi, I'm a beginner learning how to script and following this guide 

I'm on Step 4 The Script Class Continued, trying to add the following code 

@Override
public final void onMessage(final Message message) {
    log("A message arrived in the chatbox: " + message.getMessage());
}

 This gives me the error 

  • cannot find symbol class Message

It seems a simple fix like I'm not including a library or something, but I can't find anything online.

Here is my current code. 

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

@ScriptManifest(author = "IronMike5424", name = "An Example Script", info = "Just an empty script :(", version = 0.1, logo = "")
public final class Skeleton extends Script  {
    @Override
    public final int onLoop() throws InterruptedException {
        return 0;
    }

    @Override
    public final void onStart() {
        log("This will be printed to the logger when the script starts");
    }

    @Override
    public final void onExit() {
        log("This will be printed to the logger when the script exits");
    }


    public final void onMessage(final Message message) {
        log("A message arrived in the chatbox: " + message.getMessage());
    }


}
Link to comment
Share on other sites

@CheckingItOut

You are missing the import for the Message class.

I would recommend giving this a look, https://stackoverflow.com/questions/25706216/what-does-a-cannot-find-symbol-or-cannot-resolve-symbol-error-mean

It will help explain the error in detail.

Adding this to your imports, should fix this though;

import org.osbot.rs07.api.ui.Message;
Edited by BravoTaco
  • Heart 1
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...