Hi, I'm trying to make my first script. It's a fishing script that just catches shrimp and drops them when invy is full.
Is there something I'm missing here? I stand next to the fishing spot in lumbridge with a fishing net and the bot does nothing.
Ignore the extra imports I just copy pasted more than I needed.
import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.model.Entity;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.constants.Banks;
import org.osbot.rs07.api.ui.RS2Widget;
import org.osbot.rs07.script.MethodProvider;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;
import org.osbot.rs07.api.Inventory;
import java.util.function.BooleanSupplier;
@ScriptManifest(author = "Gevo", name = "Fish", info = "idk", version = 0.1, logo = "")
public final class Fish extends Script {
@Override
public final int onLoop() throws InterruptedException {
int space = invCount();
if (space==0) {
drop();
}
else {
net();
}
return random(150, 200);
}
@Override
public final void onStart() {
log("Hi?");
}
//Checks closest fishing spot and clicks it (supposedly)
private void net() {
Entity spot = getNpcs().closest(1530);
spot.interact("Net");
}
//Counts empty slots in inventory
private int invCount() {
return getInventory().getEmptySlotCount();
}
//drops all shrimps
private void drop() {
getInventory().dropAll(317);
}
}
Thanks!