should really be
import org.osbot.rs07.api.map.Area;
like the poster above me said.
also, if statements should be scoped, and its a common beginner mistake to add a semicolon to your if statement but you should avoid doing that.
and 1 more thing
if (inventory.isFull())
return State.GO_TO_COWS;
is the same as saying
if inventory is full, go to cows.
it should be
!inventory.isFull()
which translates to not inventory is full
package core;
import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.map.constants.Banks;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import java.awt.*;
import static org.osbot.rs07.api.map.constants.Banks.LUMBRIDGE_UPPER;
@ScriptManifest(name = "Skeleton", author = "Alek", version = 1.0, info = "", logo = "")
public class Skeleton extends Script {
@Override
public void onStart() {
}
private enum State {
GO_TO_BANK, WITHDRAW_FOOD, GO_TO_COWS, KILL_COW, WAIT
}
public static final Area BANK_AREA = Banks.LUMBRIDGE_UPPER;
Position CowPosition = (Position) myPosition();
private State getState() {
RS2Object cow = getObjects().closest("Cow");
if (inventory.isEmpty()) { //no food
return State.GO_TO_BANK;
}
if (LUMBRIDGE_UPPER.contains(myPosition())) {
return State.WITHDRAW_FOOD;
}
if (!inventory.isFull()) {
return State.GO_TO_COWS;
}
if (inventory.contains(329)) {
return State.KILL_COW;
}
return State.WAIT;
}
@Override
public void onExit() {
//Code here will execute after the script ends
}
@Override
public int onLoop() throws InterruptedException {
switch (getState()) {
case GO_TO_BANK:
getWalking().webWalk(BANK_AREA); //walk to lumby bank
break;
case WITHDRAW_FOOD:
npcs.closest("Banker").interact("Bank"); //withdraw food from lumbridge bank booth
break;
case GO_TO_COWS:
Position pos1 = new Position(3259, 3269, 0);
getWalking().walk(pos1); //walk to cows position
break;
case KILL_COW:
npcs.closest("Cow").interact("Attack");//get cow npc and kill, cow 2805-2809
break;
case WAIT:
break;
}
return random(210, 305); //The amount of time in milliseconds before the loop starts over
}
@Override
public void onPaint(Graphics2D g) {
//This is where you will put your code for paint(s)
}
}
This is what it probably was intended to be by you?