Jump to content

Zoubiey

Members
  • Posts

    10
  • Joined

  • Last visited

  • Feedback

    0%

Everything posted by Zoubiey

  1. Seen alot of people on another forum recommending this one. http://www.headfirstlabs.com/books/hfjava/
  2. Thanks for that, trying to do my own chicken killer. This will come in handy!
  3. The combat is working great now! Gonna see now if I can get the looting to be as I want it now. Thanks for your help!
  4. Changed some stuff but still acts a bit wierd. From time to time it's clicking works great but sometimes it starts attacking another chicken while already in a fight. I think I used the right check, but can be wrong. (!player.isInteracting(chicken)) Also the looting part doesn't work at all, not sure what the problem is on that part. Mind explaining how the filter works? Sounds interesting.
  5. Thanks, gonna try everything you just said!
  6. Hey, kinda new to this bot but thought I could give scripting a try. Started with a chicken killer and it works pretty good, some minor tweaks for attacking and finding "free" chickens is still needed tho. My biggest issue is that it doesn't loot at all and also clicks the chicken while attacking, can also click another chicken even if the first one isnt dead yet, been searching a few threads for some answers and stuff I could try to fix it but with no success. My code so far. private enum State { PICK_UP, KILL, WAIT }; private State getState() { GroundItem feathers = groundItems.closest("Feathers"); if ((feathers !=null && !myPlayer().isUnderAttack())) return State.PICK_UP; if (!inventory.isFull()) return State.KILL; return State.WAIT; } @Override public int onLoop() throws InterruptedException { switch (getState()) { case PICK_UP: GroundItem feathers = groundItems.closest("Feathers"); if ((!inventory.isFull() && !myPlayer().isUnderAttack())) { feathers.interact("Take"); wait(100,300); } break; case KILL: Player player = myPlayer(); NPC chicken = npcs.closest("Chicken"); if((!player.isMoving()) && (!player.isUnderAttack()) && (chicken.isAttackable()) && (chicken.isVisible()) && (chicken.getHealth()>0) && (chicken.getName().contains("Chicken")) && (chicken != null)) { chicken.interact("Attack"); sleep(random(200, 350)); } else { camera.toEntity(chicken); } break; case WAIT: sleep(random(500, 700)); break; } return random(200,300); //The amount of time in milliseconds before the loop starts over } What I'm trying to do is a chicken killer which loots feathers from only those I kill. That's my first goal, will be going for bury bones and such when I get this to work. So please tell me if you see something that's need to be changed/removed/added. Zoubiey
×
×
  • Create New...