- import java.awt.*;
- import javax.imageio.ImageIO;
- import java.io.IOException;
- import java.net.URL;
- import java.awt.Color;
- import java.awt.Graphics;
- import java.awt.Image;
- import java.awt.Point;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.Script;
- import org.rsbot.script.methods.Game;
- import org.rsbot.script.methods.Skills;
- import org.rsbot.script.util.Timer;
- import org.rsbot.script.wrappers.RSGroundItem;
- import org.rsbot.script.wrappers.RSItem;
- import org.rsbot.script.wrappers.RSNPC;
- import org.rsbot.script.wrappers.RSObject;
- @ScriptManifest(authors = { "Zachsta69" }, keywords = { "ankou, kill" }, name = "AnkouSlayerPro", version = 1.0, description = "kills Ankou and Picks up Good Drops!")
- public class AnkouPro extends Script implements PaintListener{
- //consumables
- private int[] sumpots = {12140, 12142, 12144, 12146};
- private int[] food = {385, 7946, 379, 373, 361};
- //familiars
- private int bunyip = 12029, pouchCost = 10;
- //npcs
- private int[] ankou = {4383, 4386};
- //drops
- private int[] drops = {448, 7937, 560, 563, 890, 5295, 565, 12158, 12159, 12160, 12163};
- //paint
- private int startStrengthExp;
- private int gainedStrengthExp;
- private int startAttackExp;
- private int gainedAttackExp;
- private int startDefenseExp;
- private int gainedDefenseExp;
- private int startHpExp;
- private int gainedHpExp;
- long startTime;
- Timer runTime;
- public boolean onStart(){
- log(Color.CYAN, "Welcome to AnkouPro");
- startStrengthExp = skills.getCurrentExp(Skills.STRENGTH);
- startAttackExp = skills.getCurrentExp(Skills.ATTACK);
- startDefenseExp = skills.getCurrentExp(Skills.DEFENSE);
- startHpExp = skills.getCurrentExp(Skills.CONSTITUTION);
- startTime = (int) System.currentTimeMillis();
- runTime = new Timer (0);
- return true;
- }
- public int loop(){
- mouse.setSpeed(random(4, 7));
- if(inventory.contains(bunyip)){
- }else{
- stopScript(true);
- }
- if (!summoning.isFamiliarSummoned() && skills.getCurrentLevel(Skills.SUMMONING) >= 10) {
- if (inventory.contains(12029)) {
- inventory.getItem(12029).doAction("Summon");
- sleep(random(3000, 3500));
- }
- antiban2();
- } else if (!summoning.isFamiliarSummoned() && inventory.containsOneOf(sumpots) && inventory.containsOneOf(12029)
- && skills.getCurrentLevel(Skills.SUMMONING) <= 10) {
- inventory.getItem(sumpots).doAction("Drink");
- sleep(random(1000, 1500));
- }
- if (combat.getLifePoints() <= 350) {
- inventory.getItem(food).doAction("Eat");
- sleep(800, 1000);
- antiban2();
- }else{
- if(getMyPlayer().isValid()){
- attack();
- pickup();
- antiban1();
- }
- }
- return random(500, 700);
- }
- public void attack() {
- if(getMyPlayer().isInCombat()){
- sleep(500);
- }else{
- RSNPC npc = npcs.getNearest(ankou);
- if (npc != null && !npc.isInCombat() && npc.getHPPercent() > 0) {
- npc.doAction("Attack");
- sleep(800, 1200);
- }
- }
- }
- public void pickup() {
- RSGroundItem drop = groundItems.getNearest(drops);
- if(drop != null){
- if(drop.isOnScreen()){
- drop.interact("Take");
- sleep(900);
- }
- }
- }
- public void antiban1() {
- int b = random(0, 5);
- switch (b) {
- case 1:
- if (random(0, 5) == 1) {
- mouse.moveSlightly();
- sleep(200, 600);
- mouse.moveRandomly(158, 506);
- }
- break;
- case 2:
- if (random(0, 5) == 2) {
- camera.setAngle(random(35, 97));
- sleep(400, 1200);
- }
- break;
- case 3:
- if (random(0, 5) == 3) {
- mouse.moveOffScreen();
- sleep(random(600, random(1200, 2000)));
- }
- break;
- case 4:
- if (random(0, 5) == 4) {
- camera.setAngle(random(20, 360));
- sleep(400, 1200);
- }
- break;
- case 5:
- if (random(0, 5) == 5) {
- mouse.moveSlightly();
- sleep(200, 600);
- mouse.moveRandomly(20, 420);
- }
- break;
- default:
- break;
- }
- }
- public void antiban2(){
- int b = random(0, 6);
- switch (b) {
- case 1:
- if (random(0,6) == 1){
- game.openTab(Game.TAB_STATS);
- skills.doHover(Skills.ATTACK);
- sleep(1000, 1400);
- game.openTab(Game.TAB_INVENTORY);
- }
- break;
- case 2:
- if (random(0,6) == 2){
- game.openTab(Game.TAB_STATS);
- skills.doHover(Skills.STRENGTH);
- sleep(1000, 1400);
- game.openTab(Game.TAB_INVENTORY);
- }
- break;
- case 3:
- if (random(0,6) == 3){
- game.openTab(Game.TAB_STATS);
- skills.doHover(Skills.DEFENSE);
- sleep(1000, 1400);
- game.openTab(Game.TAB_INVENTORY);
- }
- break;
- case 4:
- if (random(0,6) == 4){
- game.openTab(Game.TAB_STATS);
- skills.doHover(Skills.CONSTITUTION);
- sleep(1000, 1400);
- game.openTab(Game.TAB_INVENTORY);
- }
- break;
- case 5:
- if (random(0,6) == 5){
- game.openTab(Game.TAB_STATS);
- skills.doHover(Skills.RANGE);
- sleep(1000, 1400);
- game.openTab(Game.TAB_INVENTORY);
- }
- break;
- case 6:
- if (random(0,6) == 6){
- game.openTab(Game.TAB_STATS);
- skills.doHover(Skills.MAGIC);
- sleep(1000, 1400);
- game.openTab(Game.TAB_INVENTORY);
- }
- break;
- default:
- break;
- }
- }
- public void onFinish(){
- log(Color.CYAN, "Thanks for Using AnkouSlayerPro");
- }
- private Image getImage(String url) {
- try {
- return ImageIO.read(new URL(url));
- } catch(IOException e) {
- return null;
- }
- }
- private final Color color1 = new Color(0, 153, 153);
- private final Color color2 = new Color(255, 255, 255);
- private final Color color3 = new Color(0, 0, 0);
- private final Font font1 = new Font("Brush Script MT", 0, 32);
- private final Font font2 = new Font("Arial", 1, 16);
- private final Font font3 = new Font("Arial", 1, 14);
- private final Font font4 = new Font("Brush Script MT", 1, 16);
- private final Image img1 = getImage("http://runescapers132.com/images/monsters/ankou.gif");
- private final Image img2 = getImage("http://shiningpaladins.com/images/skillcape/strength_cape.gif");
- private final Image img3 = getImage("http://shiningpaladins.com/images/skillcape/attack_cape.gif");
- private final Image img4 = getImage("http://shiningpaladins.com/images/skillcape/defence_cape.gif");
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- gainedAttackExp = skills.getCurrentExp(Skills.ATTACK) - startAttackExp;
- gainedDefenseExp = skills.getCurrentExp(Skills.DEFENSE) - startDefenseExp;
- gainedStrengthExp = skills.getCurrentExp(Skills.STRENGTH) - startStrengthExp;
- gainedHpExp = skills.getCurrentExp(Skills.CONSTITUTION) - startHpExp;
- g.setColor(color1);
- g.fillRect(7, 345, 506, 128);
- g.setFont(font1);
- g.setColor(color2);
- g.drawString("Ankou Slayer Pro", 150, 29);
- g.setFont(font2);
- g.setColor(color3);
- g.drawString("Time Running:" + runTime.toElapsedString(), 12, 371);
- g.drawString("Attack EXP Gained:" + gainedAttackExp, 11, 395);
- g.drawString("Strength EXP Gained:" + gainedStrengthExp, 10, 418);
- g.drawString("Defense EXP Gained:" + gainedDefenseExp, 10, 441);
- g.drawString("HP EXP Gained:" + gainedHpExp, 10, 464);
- g.drawImage(img1, 454, 319, null);
- g.drawImage(img2, 345, 355, null);
- g.drawImage(img3, 288, 355, null);
- g.drawImage(img4, 233, 355, null);
- g.setFont(font3);
- g.setColor(color2);
- g.drawString("Script and Paint By:", 241, 467);
- g.setFont(font4);
- g.drawString("Zachsta69", 385, 465);
- g.drawLine(mouse.getLocation().x - 6, mouse.getLocation().y,
- mouse.getLocation().x + 6, mouse.getLocation().y);
- g.drawLine(mouse.getLocation
- ().x, mouse.getLocation().y - 6,
- mouse.getLocation().x, mouse.getLocation().y + 6);
- }
- }