I seem to have to errors in my code however when I add my .jar file to the scripts folder I am unable to run it from the client. I know its an issue with my code but can't seem to figure out what the problem is. I am new to this whole thing but would appreciate any help I can get!
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
@ScriptManifest(version = 1.0, logo = "", info = "Combat", author = "P", name = "bot")
public class Main extends Script{
public long maxSleep = 1234;
@Override
public void onStart() throws InterruptedException {
super.onStart();
log("Script Started");
}
@Override
public int onLoop() throws InterruptedException {
combat combat = new combat();
combat.findMonster();
Eat eat = new Eat();
eat.eat();
eat.dropInv();
return 432;
}
@Override
public void onExit() throws InterruptedException {
super.onExit();
log("Script Ended");
}
}
import org.osbot.rs07.api.model.Entity;
public class combat extends Main {
public void findMonster() throws InterruptedException {
Entity monster = getNpcs().closest("Cow", "Chicken");
if(monster != null){
monster.interact("Attack");
if((monster == null) && !myPlayer().isAttackable()){
sleep(343);
}
} else {
sleep(maxSleep);
}
}
}
import org.osbot.rs07.api.GroundItems;
import org.osbot.rs07.api.Inventory;
import org.osbot.rs07.api.model.Character;
public class Eat {
private Inventory inventory;
private Character myChar;
private GroundItems pickUp;
public void eat() {
int health = myChar.getHealthPercent();
if(health < 20){
inventory.getItem("Beef").interact("Eat");
if(!inventory.contains("Beef") && !inventory.isFull()){
pickUp.closest("Raw Beef").interact("Pick Up");
}
}
}
public void dropInv(){
if(inventory.isFull()){
inventory.dropAll("Bones", "Cow Hide");
}
}
}