Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Color; // SealthChickenAIO 0.2 by Stealth
- import java.awt.Font;
- import java.awt.Graphics;
- import java.awt.Graphics2D;
- import java.awt.Image;
- import java.awt.Point;
- import java.awt.Rectangle;
- import java.awt.RenderingHints;
- import java.awt.event.MouseEvent;
- import java.awt.event.MouseListener;
- import java.io.IOException;
- import java.net.URL;
- import java.util.ArrayList;
- import java.util.Iterator;
- import java.awt.*;
- import java.awt.event.*;
- import javax.swing.*;
- import javax.imageio.ImageIO;
- import com.rarebot.event.listeners.PaintListener;
- import com.rarebot.script.Script;
- import com.rarebot.script.ScriptManifest;
- import com.rarebot.script.methods.Game.Tab;
- import com.rarebot.script.methods.Methods;
- import com.rarebot.script.methods.Skills;
- import com.rarebot.script.util.Filter;
- import com.rarebot.script.wrappers.RSArea;
- import com.rarebot.script.wrappers.RSGroundItem;
- import com.rarebot.script.wrappers.RSItem;
- import com.rarebot.script.wrappers.RSNPC;
- import com.rarebot.script.wrappers.RSObject;
- import com.rarebot.script.wrappers.RSTile;
- import com.rarebot.script.wrappers.RSWeb;
- @ScriptManifest(authors = { "Stealth" }, keywords = {"combat"}, name = "StealthChickenAIO", description =
- "Kills Chickens!", version = 0.2)
- public class StealthChickenAIO extends Script implements PaintListener, MouseListener
- {
- private int[] junkID = {2138, 526};
- final Object lock = new Object();
- boolean pressed = false;
- String status;
- public int featherID = 314;
- private long startTime = 0;
- public int[] ChickenID = {41, 1017, 2314, 2315, 2313}, foodID = {373}; // adding more food
- RSNPC curChicken = null;
- private enum State {
- UNKNOWN, ANTIBAN, ATTACK, EAT, CAMERATOChicken, SPEC
- }
- public State getState() {
- RSNPC Chicken = npcs.getNearest(ChickenID);
- try {
- if (players.getMyPlayer().getHPPercent() >= 30) {
- if (!players.getMyPlayer().isInCombat()) {
- if (Chicken != null) {
- if (Chicken.isOnScreen()) {
- return State.ATTACK;
- } else {
- return State.CAMERATOChicken;
- }
- }
- }
- } else {
- if (inventory.containsOneOf(foodID)) {
- return State.EAT;
- }
- }
- } catch (Exception e) {
- return State.UNKNOWN;
- }
- return State.ANTIBAN;
- }
- public boolean onStart() {
- startTime = System.currentTimeMillis();
- return true;
- }
- private void drawMouse1(Graphics g) {
- Point p = mouse.getLocation();
- ((Graphics2D) g).setRenderingHints(new RenderingHints
- (RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON));
- Graphics2D line1 = (Graphics2D) g.create();
- Graphics2D line2 = (Graphics2D) g.create();
- Graphics2D arc1 = (Graphics2D) g.create();
- Graphics2D arc2 = (Graphics2D) g.create();
- final int outerSize = 20;
- final int innerSize = 20;
- line1.rotate(System.currentTimeMillis() % 2000d / 2000d * (360d) * 2
- * Math.PI / 180.0, p.x, p.y);
- line2.rotate(System.currentTimeMillis() % 2000d / 2000d * (-360d)
- * 2 * Math.PI / 180.0, p.x, p.y);
- arc1.rotate(System.currentTimeMillis() % 2000d / 2000d * (360d) * 2
- * Math.PI / 180.0, p.x, p.y);
- arc2.rotate(System.currentTimeMillis() % 2000d / 2000d * (-360d)
- * 2 * Math.PI / 180.0, p.x, p.y);
- line1.setColor(Color.WHITE);
- line1.drawLine(p.x, p.y, p.x, p.y + 7);
- line1.drawLine(p.x, p.y, p.x, p.y - 7);
- line2.setColor(Color.WHITE);
- line2.drawLine(p.x, p.y, p.x - 7, p.y);
- line2.drawLine(p.x, p.y, p.x + 7, p.y);
- arc1.setColor(Color.BLACK);
- arc1.drawArc(p.x - (outerSize / 2), p.y - (outerSize / 2), outerSize, outerSize, 100, 75);
- arc2.setColor(Color.RED);
- arc2.drawArc(p.x - (outerSize / 2), p.y - (outerSize / 2), outerSize, outerSize, -100, 75);
- arc2.drawArc(p.x - (innerSize / 2), p.y - (innerSize / 2), innerSize, innerSize, 100, 75);
- arc1.drawArc(p.x - (innerSize / 2), p.y - (innerSize / 2), innerSize, innerSize, -100, 75);
- }
- @Override
- public int loop() {
- if(walking.getEnergy() > random(65,100)) {
- if(!walking.isRunEnabled()) {
- status = "Enabling Running";
- walking.setRun(true);
- }else if (walking.getEnergy() > random(10,25)) {
- }
- }
- RSNPC Chicken = npcs.getNearest(ChickenID);
- mouse.setSpeed(5);
- if (inventory.containsOneOf(junkID)) {
- inventory.dropAllExcept(featherID);
- status = "Dropping junk";
- }
- switch(getState()) {
- case ATTACK:
- fightChickens();
- break;
- case CAMERATOChicken:
- status = " Camera to Chicken";
- camera.turnTo(Chicken);
- Methods.sleep(Methods.random(500, 750));
- break;
- case EAT:
- status = "Eating Food";
- inventory.getItem(foodID).interact("Eat");
- break;
- case ANTIBAN:
- int b = random(1, 43);
- switch (b) {
- case 1:
- status = "Moving mouse";
- mouse.moveSlightly();
- sleep(200, 600);
- mouse.moveRandomly(150, 350);
- break;
- case 2:
- status = " Camera";
- camera.setAngle(random(30, 70));
- sleep(400, 1200);
- break;
- case 3:
- status = " Mouse AFK";
- mouse.moveOffScreen();
- sleep(random(600, random(1200, 2000)));
- break;
- case 4:
- status = "Checking Exp";
- game.openTab(Tab.STATS);
- skills.doHover(Skills.INTERFACE_COOKING);
- sleep(random(1250, 2000));
- game.openTab(Tab.INVENTORY);
- break;
- case 5:
- status = " Opening CC";
- clanChat.openInformation();
- Methods.sleep(1500);
- clanChat.closeInformation();
- Methods.sleep(300);
- game.openTab(Tab.INVENTORY);
- break;
- case 6:
- status = " Camera";
- camera.setAngle(random(20, 90));
- sleep(400, 800);
- break;
- case 7:
- status = " Pitch";
- camera.setPitch(1250);
- Methods.sleep(Methods.random(300, 1000));
- camera.setCompass('n');
- break;
- case 8:
- status = "Randomly";
- mouse.moveRandomly(Methods.random(1500, 2000));
- break;
- case 9:
- status = " Moving Camera";
- camera.moveRandomly(Methods.random(800, 1200));
- break;
- case 10:
- status = " Randomly";
- camera.moveRandomly(Methods.random(1000, 2000));
- status = "Pitch";
- camera.setPitch(true);
- case 11:
- status = "Moving Mouse";
- mouse.moveSlightly();
- mouse.moveRandomly(1500);
- break;
- case 12:
- if (inventory.containsOneOf(foodID)) {
- inventory.getItem(foodID).interact("Examine");
- }
- break;
- case 13:
- quests.openTab();
- Methods.sleep(450);
- break;
- case 14:
- camera.moveRandomly(1500);
- break;
- }
- default:
- break;
- }
- return 1000;
- }
- private int fightChickens() {
- RSNPC newChicken = npcs.getNearest(new Filter<RSNPC>(){
- public boolean accept(RSNPC in) {
- if (in == null)
- return false;
- if (!in.getName().contains("Chicken"))
- return false;
- if (in.isDead())
- return false;
- pickUpfeather();
- if (in.getInteracting() != null && !in.getInteracting().equals
- (getMyPlayer()))
- return false;
- return true;
- }
- });
- if (newChicken != null) {
- if (combat.getSpecialBarEnergy() == 155 && !combat.isSpecialEnabled()) {
- game.openTab(Tab.ATTACK);
- Methods.sleep(300);
- status = "Enabling Special";
- combat.setSpecialAttack(true);
- Methods.sleep(500);
- game.openTab(Tab.INVENTORY);
- }
- if (!players.getMyPlayer().isInCombat()) {
- if (newChicken.isOnScreen()) {
- status = "Attacking";
- newChicken.interact("Attack "+newChicken.getName());
- curChicken = newChicken;
- } else {
- status = "Walking to Chicken";
- walking.walkTileMM(newChicken.getLocation());
- }
- }
- }
- return 1;
- }
- public void onFinish() {
- }
- //START: Code generated using Enfilade's Easel
- private Image getImage(String url) {
- try {
- return ImageIO.read(new URL(url));
- } catch(IOException e) {
- return null;
- }
- }
- private final Color color1 = new Color(255, 255, 255);
- private final Color color2 = new Color(0, 0, 0);
- private final Image logo = getImage("http://i.imgur.com/zax3P.png");
- private final Image background = getImage("http://i.imgur.com/aZgmj.png");
- private final BasicStroke stroke1 = new BasicStroke(1);
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- long millis = System.currentTimeMillis() - startTime;
- long hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- long minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- long seconds = millis / 1000;
- g.setColor(color1);
- g.fillOval(510, 361, 0, 0);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawOval(510, 361, 0, 0);
- g.drawImage(background, 160, 206, null);
- g.drawImage(logo, 265, 226, null);
- g.drawString("Time Running: "+ hours + ":" + minutes + ":" + seconds, 200, 315);
- g.drawString("Created by Stealth", 200, 280);
- g.drawString("Status: " +status, 361, 314);
- }
- //END: Code generated using Enfilade's Easel
- public void pickUpfeather() {
- RSGroundItem feather = groundItems.getNearest(featherID);
- if (feather != null) {
- if (feather.isOnScreen()) {
- if (feather.interact("Take " + feather.getItem().getName())) {
- sleep(random(500, 800));
- status = "Looting Feathers";
- }
- } else {
- walking.walkTileMM(feather.getLocation());
- camera.moveRandomly(200);
- }
- }
- sleep(random(800, 1000));
- }
- @Override
- public void mouseClicked(MouseEvent e) {
- // TODO Auto-generated method stub
- }
- @Override
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
- }
- @Override
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
- }
- @Override
- public void mousePressed(MouseEvent e) {
- }
- @Override
- public void mouseReleased(MouseEvent e) {
- }
- public void mouseDragged(MouseEvent e) {
- // TODO Auto-generated method stub
- }
- public void mouseMoved(MouseEvent e) {
- // TODO Auto-generated method stub
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment