Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.dreambot.api.methods.container.impl.bank.BankLocation;
- import org.dreambot.api.methods.container.impl.equipment.EquipmentSlot;
- import org.dreambot.api.methods.filter.Filter;
- import org.dreambot.api.methods.map.Area;
- import org.dreambot.api.methods.map.Tile;
- import org.dreambot.api.methods.skills.Skill;
- import org.dreambot.api.script.AbstractScript;
- import org.dreambot.api.script.Category;
- import org.dreambot.api.script.ScriptManifest;
- import org.dreambot.api.wrappers.interactive.GameObject;
- import org.dreambot.api.wrappers.interactive.NPC;
- import org.dreambot.api.wrappers.items.GroundItem;
- import org.dreambot.api.wrappers.widgets.WidgetChild;
- import java.awt.event.KeyEvent;
- @ScriptManifest(
- author = "ZeddyBoi",
- description = "Kills Cows, burys bones, will bank when inv full",
- category = Category.COMBAT,
- version = 1.0,
- name = "FallyCowKiller"
- )
- public class Main extends AbstractScript {
- Area KillArea = new Area(3024, 3310, 3041, 3298 );
- public static int cowhide = 1739;
- public static int bonesid = 526;
- public static final String COW = "Cow";
- public static final Filter<NPC> COW_FILTER = new Filter<NPC>() {
- @Override
- public boolean match(NPC npc) {
- if (npc == null ){
- return false;
- }
- return npc.getName().equals(COW) && !npc.isHealthBarVisible();
- }
- };
- @Override
- public int onLoop() {
- //Check if the user has a full inventory
- if (getInventory().isFull()){
- if (getBank().isOpen()){
- getBank().depositAll("cowhide");
- }
- else {
- sleep(2000);
- getBank().open(BankLocation.FALADOR_EAST);
- }
- }
- //Check is user is in cow pen, then check if there's loot on the floor already
- else{
- //Check if the user is in the kill areas
- if (KillArea.contains(getLocalPlayer())){
- //check if there is bones and cowhide near
- GroundItem groundItemsToLoot = getGroundItems().closest("Cowhide", "Bones");
- if(!getInventory().contains(cowhide)) {
- if (groundItemsToLoot != null)
- groundItemsToLoot.interact("Take");
- }
- else{
- NPC cow = getNpcs().closest(COW_FILTER);
- if (cow != null) {
- cow.interact("Attack");
- sleep(10000);
- }
- }
- }
- else{
- getWalking().walk(KillArea.getRandomTile());
- }
- }
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement