Hello
Made a little script for farming the tokens at the warriors guild for getting my dragon defender.
It's currently hardcoded to lobster and mithril armour but you can edit source...:)
Setup:
Have lobster in inventory
Have mithril platelegs, body and full helm in inventory
Jar file here
import org.osbot.rs07.api.model.GroundItem;
import org.osbot.rs07.api.model.NPC;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
import org.osbot.rs07.utility.ConditionalSleep;
import javax.swing.*;
import java.awt.*;
@ScriptManifest(name = "Animator by RickyD", author = "RickyD", version = 1.0, info = "Animates your armour to farm warrior guild tokens", logo = "")
public class Animated extends Script {
String[] foodName = {"Lobster"};
NPC anim;
GroundItem lootables;
String [] lootNames = {"Mithril platebody", "Warrior guild token", "Mithril full helm", "Mithril platelegs"};
@Override
public void onStart() {}
@Override
public void onExit() {}
public boolean hasArmour(){
if(getInventory().contains("Mithril platebody")){
if(getInventory().contains("Mithril platelegs")){
if(getInventory().contains("Mithril full helm")){
return true;
}else{
return false;
}
}else{
return false;
}
}else{
return false;
}
}
@Override
public int onLoop() throws InterruptedException{
anim = getNpcs().closest(2454);
lootables = getGroundItems().closest(lootNames);
if(getInventory().contains(foodName) && getInventory().getAmount("Warrior guild token") < 1000){
if(anim != null && anim.isInteracting(myPlayer())){
if(myPlayer().getHealthPercent() < 50){
getInventory().interact("Eat", foodName);
//DTiming.waitCondition(() -> myPlayer().getAnimation() == 829, 2000);
new ConditionalSleep(2000){
@ Override
public boolean condition() throws InterruptedException
{
return myPlayer().getAnimation() == 829;
}
}.sleep();
}else{
if(myPlayer().getInteracting() == null){
anim.interact("Attack");
}
}
}else{
if(lootables != null){
lootables.interact("Take");
}else{
if(hasArmour()){
getObjects().closest("Magical Animator").interact("Animate armour");
}
}
}
}else{
JOptionPane.showMessageDialog(null,
"NO FOOD or 1k Tokens",
"Alert",
JOptionPane.WARNING_MESSAGE);
stop(false);
}
return 100; //The amount of time in milliseconds before the loop starts over
}
@Override
public void onPaint(Graphics2D g) {}
}