Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import org.dreambot.api.methods.Calculations;
- 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.methods.walking.pathfinding.impl.obstacle.impl.PassableObstacle;
- import org.dreambot.api.script.AbstractScript;
- import org.dreambot.api.script.Category;
- import org.dreambot.api.script.ScriptManifest;
- import org.dreambot.api.utilities.Timer;
- import org.dreambot.api.wrappers.interactive.NPC;
- import org.dreambot.api.wrappers.items.Item;
- @ScriptManifest(author = "Messiah", category = Category.COMBAT, name = "ACBT", version = 1.0)
- public class ACBT extends AbstractScript {
- // Mage Area
- // Area Cows = new Area(new Tile(3198, 3305, 0), new Tile(3201, 3303, 0));
- // Close combat area
- Area War1 = new Area(new Tile(3282, 3176, 0), new Tile(3286, 3168, 0));
- Timer t;
- Tile WDoor = new Tile(3287, 3172, 0);
- // Now in the onPaint do this:
- public static final String FOOD = "Lobster";
- public static final String WAR = "Al-Kharid warrior";
- public static final Filter<NPC> WAR_FILTER = npc -> {
- if (npc == null) {
- return false;
- }
- return npc.getName().equals(WAR) && !npc.isHealthBarVisible();
- };
- /*
- *
- * public static final Filter<NPC> COW_AREA = npc -> {
- *
- * @Override public boolean match(NPC COW) {
- *
- * return COW != null && Cows1.contains(Cow) && npc.getName().equals(Cow) &&
- * !npc.isHealthBarVisible(); };
- *
- * }
- */
- @Override
- public void onStart() {
- t = new Timer();
- log("haxor initiated");
- }
- @Override
- public int onLoop() {
- getDialogues().clickContinue();
- // TODO
- if (getLocalPlayer().isInCombat()) {
- // do nothing
- log("Checking Combat");
- }
- if (War1.contains(getLocalPlayer())) {
- NPC war = getNpcs().closest(WAR_FILTER);
- if (war != null) {
- war.interact("Attack");
- if(getSkills().getBoostedLevels(Skill.HITPOINTS) < 40){
- Item food = getInventory().get(fz -> fz != null
- && fz.getName() != null
- && fz.getName().contains("Lobster"));
- interact(food, "Eat");
- sleep(+Calculations.random(500,800));
- }
- sleep(Calculations.random(25000, 55000));
- }
- log("Attacking Warriors");
- } else {
- getWalking().getAStarPathFinder().addObstacle(new PassableObstacle("Large door", "Open", null, null, null));
- getWalking().walk(War1.getRandomTile());
- log("Walking to Warriors");
- }
- return Calculations.random(500, 1000);
- }
- private void interact(Item food2, String string) {
- // TODO Auto-generated method stub
- }
- public void onPaint(Graphics g1) {
- Graphics2D g = (Graphics2D) g1;
- g.drawString("Time Running: " + t.formatTime(), 330, 260);
- }
- /*
- * public long expPerHour(long t, int points){ long time = (int) ((t /
- * (1000*60*60)) % 24); long answer = exp/time; return answer; }
- */
- @Override
- public void onExit() {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement