Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import org.dreambot.api.methods.Calculations;
- import org.dreambot.api.methods.event.EventHandler;
- import org.dreambot.api.methods.event.PaintEvent;
- import org.dreambot.api.methods.container.impl.bank.BankLocation;
- 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.walking.path.impl.LocalPath;
- import org.dreambot.api.script.AbstractScript;
- import org.dreambot.api.script.Category;
- import org.dreambot.api.script.ScriptManifest;
- import org.dreambot.api.utilities.impl.Condition;
- import org.dreambot.api.wrappers.interactive.GameObject;
- import org.dreambot.api.wrappers.items.GroundItem;
- import org.dreambot.api.methods.Calculations;
- import org.dreambot.api.methods.event.EventHandler;
- import org.dreambot.api.methods.event.PaintEvent;
- import org.dreambot.api.methods.skills.Skill;
- import org.dreambot.api.methods.tabs.Tab;
- import org.dreambot.api.methods.widget.Widget;
- import org.dreambot.api.script.AbstractScript;
- import org.dreambot.api.script.Category;
- import org.dreambot.api.script.ScriptManifest;
- import org.dreambot.api.utilities.impl.Condition;
- import org.dreambot.api.utilities.impl.Filter;
- import org.dreambot.api.wrappers.interactive.NPC;
- import org.dreambot.api.wrappers.widgets.WidgetChild;
- import org.dreambot.api.methods.Calculations;
- import org.dreambot.api.methods.container.impl.bank.BankLocation;
- 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.walking.path.impl.LocalPath;
- import org.dreambot.api.script.AbstractScript;
- import org.dreambot.api.script.Category;
- import org.dreambot.api.script.ScriptManifest;
- import org.dreambot.api.utilities.impl.Condition;
- import org.dreambot.api.wrappers.interactive.GameObject;
- import org.dreambot.api.wrappers.items.GroundItem;
- import org.dreambot.api.methods.event.EventHandler;
- import org.dreambot.api.methods.event.PaintEvent;
- @ScriptManifest(author="BZmake", category= Category.COMBAT, name="Slaying Cows", version=0.1, description="Slays cows and banks hides")
- public class BZcows extends AbstractScript{
- @Override
- public int onLoop() throws InterruptedException {
- getClient().disableIdleMouse();
- // Click away level up messages
- getDialogues().clickContinue();
- }
- // Area's //
- private final Area BANK_AREA = new Area();
- private final Area COW_AREA = new Area ();
- //Tiles
- private final Tile IN_FRONT_OF_GATE = new Tile ();// tile in front of gate
- // Path //
- private final localPath pathFromBank = new localPath();
- public void onStart(){
- pathFromBank = new localPath(getClient().getMethodContext());
- log("Lets Start!"); //Use log to print to the console
- }
- //States
- private State state;
- //Declaring States
- private enum state() {
- BANK,
- WALK_TO_BANK,
- WALK_TO_COWS,
- ATTACK,
- PICK_UP,
- IDLE,
- DIALOGUE
- }
- //state currently in
- private State getState() {
- //if inv full, bank
- if(getInventory().isFull()){
- if(BANK_AREA.contains(getLocalPlayer())){
- return State.BANK;
- }
- else{
- return State.WALK_TO_BANK
- }
- }
- else{
- //if not full, attack and collect
- if(COW_AREA.contains(getLocalPlayer())){
- return State.ATTACK;
- if (getLocalPlayer().myPlayer().isInCombat()) {
- NPC cow = getNpcs().getClosest(Cow);
- //checks if cow isnt null and cow is on screen
- if(cow!=null && cow.isOnScreen())
- {
- cow.interact("Attack");
- }
- }
- else{
- return State.PICK_UP;
- }
- else{
- return State.WALK_TO_COWS;
- }
- }
- }
- public void onPaint(Graphics g){
- g.setColor(new Color(247, 148, 230));
- g.drawString("DreamBot is awesome!", 100, 100);
- g.drawString("IsInCombat: " + getLocalPlayer().isInCombat(), 100, 120);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement