Jump to content

What is wrong with this line? It works for others but not me!


Recommended Posts

Posted
package Looter;
 
import org.osbot.rs07.api.filter.Filter;
import org.osbot.rs07.api.model.GroundItem;
import org.osbot.rs07.script.Script;
 
import org.osbot.rs07.script.ScriptManifest;
 
import java.awt.*;
 
@ScriptManifest(name = "Looter", author = "First script...", version = 1.0, info = "Looter", logo = "")
 
public class main extends Script {
	
    private Filter<GroundItem> exists = a --> exists();
 
    @Override
 
    public void onStart() {
    }
    @Override
 
    public void onExit() {
    }
 
    @Override
 
    public int onLoop() throws InterruptedException {
 
        GroundItem a = groundItems.closest(exists);
        if (a != null && a.exists()) {
            a.interact("Take");
            sleep(2000);
        }
 
        return 100;
 
    }
 
    @Override
 
    public void onPaint(Graphics2D g) {
 
    }
 
}

Gives me the error below, but works for other people and compiles just fine. I thought it was written properly, and it is, but this script isn't compiling for me...

Error:

https://gyazo.com/fa635ed256c8cc8c74d2dd4d7b375285

Posted (edited)

Any reason the line you posted in the source is 

private Filter<GroundItem> exists = a --> exists();

And the line you posted in the gyazo is 

private Filter<GroundItem> exists = a --> a.exists();

Im still learning about scripting but if you have one version with "exists();" and another with "a.exists();" 

You might be sending the working code to your friends and trying the compile to broken one on your computer?

 

EDIT** Yeah iv been looking at this trying to fix for a half hour but my experience is very low. I hope someone can come here and give a solution. It would be nice to know what the issue is as a fellow beginner.

Edited by thedevilhacker

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