Hello
This is probably just a dumb error on my part, but for some reason, this NPC object isn't working correctly. Here's my code:
package nodes;
import core.Node;
import org.osbot.rs07.api.filter.Filter;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.script.Script;
/**
* Created by ___ on 3/28/2016.
*/
public class Finding extends Node {
NPC npc;
NPC previous_npc;
public Finding(Script script) {
super(script);
}
public String status() {
return "Finding new NPC to chat with...";
}
/**
* This method checks to make sure the conditions are true, if they are, it will start
* the Finding node. (Located in the execute() method.
* @return if the conditions are met or not.
* @throws InterruptedException
*/
public boolean validate() throws InterruptedException {
if (!script.getDialogues().inDialogue()) return true;
return false;
}
public boolean execute() throws InterruptedException {
npc = npcs.closest(new Filter<NPC>() {
@Override
public boolean match(NPC npc){
return npc != previous_npc && npc.hasAction("Talk-to");
}
});
if(npc != null){
npc.interact("Talk-to");
}
return true;
}
}
I get an error on this line:
npc = npcs.closest(new Filter<NPC>() {
With "npcs" saying: Cannot resolve symbol: 'npcs'.
I'm not sure why it isn't working, it has worked for me all other times.
Any help would be appreciated.
Thanks.