Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BirdHunter extends Script{
- private final int MOUSE_SPEED = 140;
- private final int BIRD_SNARE_INV = 10006;
- private final int BIRD_SNARE_GND = 9345;
- private final int FEATHERS_ID = 10087;
- private final int BONES = 526;
- private final int[] INVENT_ITEMS = {526,10006,10087,9978,10091};
- private final int[] SNARE_DOWN = {9344,9379,9346,9378,9348,9347};
- private RSTile startSpot;
- private RSObject[] birdSnares;
- private RSObject[] allSnares;
- private RSItem[] snares;
- private int trapAmount = 2;
- ABCUtil test = new ABCUtil();
- @Override
- public void run() {
- startScript();
- while(loop()){}
- }
- private boolean loop() {
- if(Inventory.getCount(INVENT_ITEMS) > 25){
- drop();
- } else if(shouldClickSnare()){
- collectSnare();
- } else if(snareIsOnGround()){
- waitForBird();
- } else{
- placeSnareOnGround();
- }
- return true;
- }
- private boolean shouldClickSnare(){
- allSnares = Objects.find(15,SNARE_DOWN);
- if(allSnares.length > 0)
- return true;
- return false;
- }
- private void placeSnareOnGround() {
- snares = Inventory.find(BIRD_SNARE_INV);
- if(Player.getPosition() != startSpot) {
- if (Walking.walkTo(startSpot)) {
- }
- }
- sleep(750,1000);
- for(int i = 0; i<trapAmount; i++) {
- snares[i].click();
- while (getAnimationContinuous(2000)) {
- if (test.shouldCheckTabs())
- test.checkTabs();
- if (test.shouldMoveMouse())
- test.moveMouse();
- if (test.shouldCheckXP())
- test.checkXP();
- if (test.shouldCheckTabs())
- test.checkTabs();
- if (test.shouldExamineEntity())
- test.examineEntity();
- if (test.shouldRotateCamera())
- test.rotateCamera();
- if (test.shouldPickupMouse())
- test.pickupMouse();
- if (test.shouldLeaveGame())
- test.leaveGame();
- if (test.shouldRightClick())
- test.rightClick();
- }
- }
- }
- private boolean getAnimationContinuous(int MSTime){
- for(int i = 0; i < MSTime; i++){
- sleep(1);
- if(Player.getAnimation() != -1){
- return true;
- }
- }
- return false;
- }
- private void waitForBird() {
- while(snareIsOnGround()){
- sleep(50,100);
- RSGroundItem[] groundSnares = GroundItems.find(BIRD_SNARE_INV);
- if(groundSnares.length > 0){
- groundSnares[0].click("Take");
- }
- if(test.shouldCheckTabs())
- test.checkTabs();
- if(test.shouldMoveMouse())
- test.moveMouse();
- if(test.shouldCheckXP())
- test.checkXP();
- if(test.shouldCheckTabs())
- test.checkTabs();
- if(test.shouldExamineEntity())
- test.examineEntity();
- if(test.shouldRotateCamera())
- test.rotateCamera();
- if(test.shouldPickupMouse())
- test.pickupMouse();
- if(test.shouldLeaveGame())
- test.leaveGame();
- if(test.shouldRightClick())
- test.rightClick();
- }
- }
- private boolean snareIsOnGround() {
- birdSnares = Objects.find(15,BIRD_SNARE_GND);
- if(birdSnares.length > 0)
- return true;
- return false;
- }
- private void collectSnare() {
- sleep(1000,2000);
- allSnares[0].click();
- while(getAnimationContinuous(500)){};
- }
- private void drop() {
- RSItem[] allBones = Inventory.find(BONES);
- while(allBones.length > 0){
- allBones[0].click();
- while(getAnimationContinuous(250)){}
- allBones = Inventory.find(BONES);
- }
- Inventory.dropAllExcept(BIRD_SNARE_INV,FEATHERS_ID);
- }
- private void startScript(){
- startSpot = Player.getPosition();
- Mouse.setSpeed(MOUSE_SPEED);
- JFrame frame = new JFrame();
- trapAmount = Integer.parseInt(JOptionPane.showInputDialog(frame, "How Many Traps Should We Place?", "How Many Traps Should we Place?", 1));
- General.useAntiBanCompliance(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement