Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import javax.swing.JOptionPane;
- import org.powerbot.core.script.ActiveScript;
- import org.powerbot.core.script.job.Task;
- import org.powerbot.game.api.Manifest;
- import org.powerbot.game.api.methods.Walking;
- import org.powerbot.game.api.methods.interactive.NPCs;
- import org.powerbot.game.api.methods.interactive.Players;
- import org.powerbot.game.api.methods.node.GroundItems;
- import org.powerbot.game.api.methods.tab.Inventory;
- import org.powerbot.game.api.wrappers.Area;
- import org.powerbot.game.api.wrappers.Tile;
- import org.powerbot.game.api.wrappers.interactive.NPC;
- import org.powerbot.game.api.wrappers.node.GroundItem;
- import org.powerbot.game.api.wrappers.node.Item;
- @Manifest(authors = { "Shootinkill(Fixed by Blackstab1337)" }, name = "CowKiller HideBanker", description = "Starts from lumby Bank Grabs 10 Food Walks DownStairs Goes to CowGate Opens then kills Cows Picks Up Hides And Then Walks Back Up Stairs And Banks then Returns ", version = 0.1)
- public class KillerOfCows extends ActiveScript{
- // all Item IDS
- public static int CowGateID = 45212;
- public static int[] CowID = { 12362, 12363, 12364, 12365 };
- public static int AttackAnimation = 15074;
- public static int FoodID = 333;
- // FoodID Trout 333 or Salmon 329
- public static boolean run1, start;
- public static int HideID = 1739;
- public static int StairsID1 = 36775;
- public static int StairsID2 = 36774;
- public static int StairsID3 = 36773;
- public static int BoothID = 494;
- // all Area IDS
- public static Area BankArea = new Area(new Tile[] { new Tile(3208,
- 3220, 0) });
- public static Area StairAreaTop = new Area(new Tile[] {
- new Tile(3205, 3209, 0), new Tile(3205, 3209, 0),
- new Tile(3205, 3208, 0), new Tile(3204, 3208, 0) });
- public static Area CowArea = new Area(new Tile[] {
- new Tile(3252, 3268, 0), new Tile(3264, 3268, 0),
- new Tile(3264, 3255, 0), new Tile(3252, 3255, 0) });
- public static Area StairAreaBottom = new Area(new Tile[] {
- new Tile(3205, 3209, 0), new Tile(3205, 3209, 0),
- new Tile(3205, 3208, 0), new Tile(3204, 3208, 0) });
- public static Area GateArea = new Area(new Tile[] {
- new Tile(3252, 3266, 0), new Tile(3250, 3264, 0),
- new Tile(3252, 3264, 0), new Tile(3252, 3268, 0) });
- // all Walk IDS
- public static Tile[] pathToGate = new Tile[] {
- new Tile(3205, 3209, 0), new Tile(3209, 3210, 0),
- new Tile(3214, 3210, 0), new Tile(3214, 3215, 0),
- new Tile(3214, 3218, 0), new Tile(3219, 3218, 0),
- new Tile(3224, 3218, 0), new Tile(3229, 3218, 0),
- new Tile(3234, 3218, 0), new Tile(3234, 3223, 0),
- new Tile(3234, 3228, 0), new Tile(3229, 3231, 0),
- new Tile(3225, 3234, 0), new Tile(3222, 3238, 0),
- new Tile(3221, 3243, 0), new Tile(3219, 3248, 0),
- new Tile(3217, 3253, 0), new Tile(3217, 3258, 0),
- new Tile(3222, 3260, 0), new Tile(3227, 3261, 0),
- new Tile(3229, 3261, 0), new Tile(3234, 3261, 0),
- new Tile(3239, 3261, 0), new Tile(3244, 3261, 0),
- new Tile(3249, 3263, 0), new Tile(3252, 3266, 0) };
- public static Tile[] pathbankToTopStair = new Tile[] {
- new Tile(3208, 3220, 0), new Tile(3205, 3215, 0),
- new Tile(3205, 3209, 0) };
- @Override
- public int loop() {
- // TODO Auto-generated method stub
- if(foodId.validate())
- foodId.run();
- if(Attack.validate())
- Attack.run();
- if(Eat.validate())
- Eat.run();
- return 25;
- }
- public static class foodId{
- public static void run(){
- try{
- FoodID = Integer.parseInt(JOptionPane.showInputDialog("Enter food id you want to eat or leave it blank for no food(risk of dying)"));
- run1 = true;
- }catch(Exception e){
- FoodID = -1;
- run1 = true;
- }
- }
- public static boolean validate(){
- return run1 == false;
- }
- }
- public static class Attack{
- public static void run(){
- NPC cow = NPCs.getNearest(CowID);
- if(cow != null){
- if(cow.isOnScreen()){
- if(!cow.isInCombat()){
- cow.interact("Attack");
- Task.sleep(500,950);
- }
- }else{
- Walking.walk(cow);
- Task.sleep(500,550);
- }
- }
- }
- public static boolean validate(){
- return Players.getLocal().isIdle() && run1;
- }
- }
- public static class Eat{
- public static void run(){
- if(FoodID != -1){
- for(Item i : Inventory.getItems()){
- if(i.getId() == FoodID){
- i.getWidgetChild().interact("Eat");
- Task.sleep(500,1000);
- }
- }
- }else{
- Task.sleep(30000);
- }
- }
- public static boolean validate(){
- return Players.getLocal().getHpPercent() <= 30 && run1;
- }
- }
- }
Add Comment
Please, Sign In to add comment