Jump to content

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


Recommended Posts

Posted

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());
    }


}
Posted (edited)

@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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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