Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Graphics;
- import org.rsbuddy.tabs.Equipment;
- import org.rsbuddy.tabs.Inventory;
- import com.rsbuddy.event.events.MessageEvent;
- import com.rsbuddy.event.listeners.MessageListener;
- import com.rsbuddy.event.listeners.PaintListener;
- import com.rsbuddy.script.ActiveScript;
- import com.rsbuddy.script.Manifest;
- import com.rsbuddy.script.methods.Calculations;
- import com.rsbuddy.script.methods.Camera;
- import com.rsbuddy.script.methods.Game;
- import com.rsbuddy.script.methods.Mouse;
- import com.rsbuddy.script.methods.Objects;
- import com.rsbuddy.script.methods.Players;
- import com.rsbuddy.script.methods.Walking;
- import com.rsbuddy.script.util.Random;
- import com.rsbuddy.script.wrappers.GameObject;
- @Manifest(name = "Oak Woodcutter", description = "Description", authors = "me")
- public class OakWc extends ActiveScript implements MessageListener, PaintListener {
- int OakTree = 38732;
- int axeIds[] = {1359,1357,1355,1361,1349,1353,1351};
- public boolean onStart() {
- Game.isLoggedIn();
- CheckHatchet();
- return true;
- }
- @Override
- public int loop() {
- GameObject Tree = Objects.getNearest(OakTree);
- if( !Inventory.isFull()){
- if(Tree != null){
- if(!Tree.isOnScreen()){
- if(Calculations.distanceTo(Tree) > 7){
- if (!Players.getLocal().isMoving()){
- Walking.stepTowards(Tree.getLocation());
- }
- }
- }
- if(Tree != null){
- Camera.turnTo(Tree);
- if(Tree.isOnScreen()){
- if (!isChopping()) {
- Chop();
- }
- antiban();
- }
- }
- }
- }
- if( Inventory.isFull()){
- Inventory.dropAllExcept(axeIds);
- }
- return 590;
- }
- public boolean CheckHatchet() {
- if(!Inventory.containsOneOf(axeIds)){
- if(!Equipment.appearanceContainsOneOf(axeIds)){
- Game.logout(true);
- }
- }
- return false;
- }
- public void Chop() {
- GameObject Tree = Objects.getNearest(OakTree);
- Tree.interact("Chop down");
- sleep(1200, 1700);
- }
- private boolean isChopping(){
- if (Players.getLocal().getAnimation() != -1
- || Players.getLocal().isMoving()){
- return true;
- }
- return false;
- }
- private void antiban() {
- if (Random.nextInt(0, 5) > 3) {
- switch (Random.nextInt(1, 10)) {
- case 1:
- Camera.moveRandomly(Random.nextInt(300, 800));
- sleep(100,1000);
- break;
- case 2:
- Mouse.moveRandomly(500, 900);
- sleep(100,2870);
- break;
- case 3:
- Game.openTab(Game.TAB_STATS);
- sleep(1300,5000);
- Mouse.moveRandomly(200, 150);
- sleep(200,300);
- break;
- case 4:
- Game.openTab(Random.nextInt(0, 16));
- sleep(1300,5000);
- Mouse.moveRandomly(200, 500);
- sleep(100,300);
- if (Random.nextInt(0, 6) > 3) {
- Camera.moveRandomly(Random.nextInt(200, 500));
- }
- Game.openTab(Game.TAB_INVENTORY);
- break;
- case 5:
- if (Random.nextInt(0, 6) > 3) {
- Mouse.moveRandomly(130, 145);
- } else {
- Camera.moveRandomly(Random.nextInt(300, 800));
- }
- break;
- }
- }
- }
- @Override
- public void messageReceived(MessageEvent e) {
- }
- @Override
- public void onRepaint(Graphics g) {
- }
- }
Add Comment
Please, Sign In to add comment