Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Graphics;
- import java.util.Map;
- import java.util.Random;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.Script;
- import org.rsbot.script.methods.Game;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- import org.rsbot.script.wrappers.RSArea;
- @ScriptManifest(authors = { "Juuna_" }, keywords = { "chopper" }, name = "VarrockWestOakChopper", version = 1.0, description = "Chops and banks oak logs at Varrock west")
- public class VWOakChopper extends Script implements PaintListener {
- private AntiBan antiBan;
- private boolean isActive;
- private boolean isPaused;
- class AntiBan extends Thread {
- private VWOakChopper parent;
- private Random randomGenerator;
- private int[] tabs = {Game.TAB_ATTACK, Game.TAB_CLAN, Game.TAB_EQUIPMENT, Game.TAB_MAGIC};
- AntiBan(VWOakChopper parent) {
- this.parent = parent;
- this.randomGenerator = new Random();
- }
- @Override
- public void run() {
- try {
- while(parent.isActive) {
- if(!parent.isPaused) {
- int rand = randomGenerator.nextInt(6);
- switch(rand) {
- case 0:
- parent.game.openTab(Game.TAB_INVENTORY);
- break;
- case 1:
- parent.mouse.moveSlightly();
- parent.game.openTab(tabs[randomGenerator.nextInt(tabs.length)]);
- break;
- case 2:
- parent.mouse.moveSlightly();
- break;
- case 3:
- parent.camera.moveRandomly(800);
- break;
- case 4:
- // do something
- break;
- case 5:
- // do something
- break;
- default:
- break;
- }
- }
- sleep(parent.random(2000, 5000));
- }
- }
- catch(InterruptedException e) {
- log(e.getMessage());
- }
- }
- }
- private int oakTree = 1281;
- private int[] hatchet = {1351, 1349, 1361, 1355, 1357, 1359};
- private RSTile[] walkingPath = {new RSTile(3166, 3420), new RSTile(3178, 3429), new RSTile(3184, 3436)};
- private RSArea bankArea = new RSArea (new RSTile(3182, 3436), new RSTile(3189, 3438));
- private RSArea oakArea = new RSArea (new RSTile(3170, 3423), new RSTile(3162, 3412));
- @Override
- public boolean onStart(Map<String, String> map){
- this.antiBan.start();
- log("This is my first script");
- mouse.setSpeed(random(5, 7));
- return true;
- }
- @Override
- public int loop(){
- if(inventory.isFull()){
- if(bankArea.contains(getMyPlayer().getLocation())){
- if(!bank.isOpen()){
- bank.open();
- return random(500, 700);
- }
- bank.depositAllExcept(hatchet);
- if(bank.isOpen()){
- bank.close();
- return random(500, 700);
- }
- }else{
- if(walking.getDestination() == null || calc.distanceTo(walking.getDestination()) < random(4, 6)){
- walking.walkPathMM(walkingPath);
- return random(300, 600);
- }
- }
- }else{
- if(oakArea.contains(getMyPlayer().getLocation())){
- if(getMyPlayer().getAnimation() != 867)
- if(getMyPlayer().getAnimation() != 877)
- if(getMyPlayer().getAnimation() != 879)
- if(getMyPlayer().getAnimation() != 875)
- if(getMyPlayer().getAnimation() != 871)
- if(getMyPlayer().getAnimation() != 877){
- RSObject tree= objects.getNearest(oakTree);
- if(tree != null){
- tree.doAction("Chop");
- sleep(500, 800);
- }
- }
- }else{
- if(walking.getDestination() == null || calc.distanceTo(walking.getDestination()) < random(4, 6)){
- walking.walkPathMM(walking.reversePath(walkingPath));
- return random(300, 600);
- }
- }
- }
- return random(100, 200);
- } @Override
- public void onRepaint(Graphics render) {
- }
- }
- public void onFinish(){
- log("Thanks for testing! TacticalNuke is happy :D");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement