Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //AIOWcer V0.1
- //by Indaface
- import java.awt.*;
- import java.util.Map;
- import org.rsbot.event.events.ServerMessageEvent;
- import org.rsbot.event.listeners.PaintListener;
- import org.rsbot.event.listeners.ServerMessageListener;
- import org.rsbot.script.Script;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- @org.rsbot.script.ScriptManifest(authors = { "Indaface" }, category = "Woodcutting", name = "aio Wcer", version = 0.1, description = "<html><head></head><body bgcolor='#222222'><center><table><tr><td width='350' valign='top'><center><div style='font-family:Calibri, Arial;color:#FF3300; font-size:36px'>aioWcer</div><div style='font-family:Calibri, Arial;color:#FFFFFF; font-size:16px'>v0.1 by Indaface <br /></a></div><div style='font-family:Calibri, Arial;color:#FF3300; font-size:16px'>Quick Select</div><div><table bordercolor='#FF3300' border='1' cellpadding='0' cellspacing='0' ><tr><td align='center' style='font-family:Calibri, Arial;color:#FFFFFF; font-size:12px'><b>Tree Locations</b> <br /><select name='trees'><option>WestVarrock RegularLogs<option>EastVarrock Oaks<option>Draynor Willows</select>")
- public class AIOWCer extends Script implements PaintListener, ServerMessageListener {
- public enum actions {WALKING_TO_TREES, CHOPPING, BANKING, WALKING_TO_BANK, WAIT} //add pickup nests and dropping in future update
- private static final actions WAIT = null;
- public String bankAt = "";
- public String chopAt = "";
- private String status = "";
- public long startTime = System.currentTimeMillis();
- public int[] axes = { 1349, 1351, 1353, 1355, 1357, 1359, 1361, 6739 };
- public int[] treeID;
- public int[] logsID = { 1511, 1521, 1519 };
- //public int[] NormalTree = { 5004, 5005, 5045, 3879, 3881, 3882, 3883,
- // 3885, 3886, 3887, 3888, 3889, 3890, 3891, 3892, 3893, 3928, 3967,
- //3968, 4048, 4049, 4050, 4051, 4052, 4053, 4054, 3033, 3034, 3035,
- //3036, 2409, 2447, 2448, 1330, 1331, 1332, 1310, 1305, 1304, 1303,
- //1301, 1276, 1277, 1278, 1279, 1280, 8742, 8743, 8973, 8974, 1315,
- //1316 };
- //public int[] OakTree = { 1281, 3037, 8462, 8463, 8464, 8465, 8466, 8467 };
- //public int[] WillowTree = { 1308, 5551, 5552, 5553, 8481, 8482, 8483,
- //8484, 8485, 8486, 8487, 8488 };
- public int startExp;
- public int Chopped;
- public int LevelsGained;
- public int ExpGained;
- public int[] bankBooths = {2213};
- public int[] nestIDs = { 5070, 5071, 5072, 5073, 5074, 5075, 7413 };
- public RSTile[] toBank, toTrees;
- RSTile banktile;
- public int price;
- public int profit;
- public int nestzFound;
- // /////////LOCATIONS///////////////
- public boolean onStart(Map<String, String> args) {
- log("aioWcer Initialized!");
- if (args.get("trees").equals("WestVarrock RegularLogs")) {
- price = 36;
- logsID = new int[] { 1511 };
- treeID = new int[] { 1278 };
- banktile = new RSTile(3182, 3444);
- toTrees = new RSTile[] { new RSTile(3184, 3444),
- new RSTile(3173, 3456), new RSTile(3157, 3459) };
- toBank = reversePath(toTrees);
- }
- if (args.get("trees").equals("EastVarrock Oaks")) {
- price = 48;
- logsID = new int[] { 1521 };
- treeID = new int[] { 1281 };
- banktile = new RSTile(3185, 3443);
- toTrees = new RSTile[] { new RSTile(3175, 3451),
- new RSTile(3160, 3455)};
- toBank = new RSTile[] { new RSTile(3160, 3455),
- new RSTile(3175, 3450), new RSTile(3185, 3443)};
- }
- if (args.get("trees").equals("Draynor Willows")) {
- price = 8;
- logsID = new int[] { 1519 };
- treeID = new int[] { 5551, 5552, 5553 };
- banktile = new RSTile(3094, 3243);
- toTrees = new RSTile[] { new RSTile(3087, 3243), new RSTile(3087, 3235)};
- toBank = new RSTile[] { new RSTile(3087, 3242), new RSTile(3094, 3243)};
- }
- return true;
- }
- public void serverMessageRecieved(ServerMessageEvent e) {
- String message = e.getMessage();
- if (message.contains("YOU GET SOME LOGS")) {
- Chopped++;
- if (message.contains("YOU HAVE JUST GAINED")) {
- LevelsGained++;
- }
- }
- }
- public void continueWalk(RSTile[] path) {
- if(!getMyPlayer().isMoving() && distanceTo(getDestination()) <= random(3, 6)) {
- walkPathMM(randomizePath(path, 1, 1));
- }
- }
- public actions getAction() {
- if(isInventoryFull() && distanceTo(banktile)>4) {
- WalkingToBank();
- return actions.WALKING_TO_BANK;
- } else if(isInventoryFull()) {
- Banking();
- return actions.BANKING;
- }
- if(isInventoryFull()) {
- Banking();
- return actions.BANKING;
- }
- if(WalkingToTrees()) {
- return actions.WALKING_TO_TREES;
- }
- if(Chopping()) {
- return actions.CHOPPING;
- }
- return WAIT;
- }
- boolean WalkingToTrees(){
- continueWalk(toTrees);
- RSObject tree = getNearestObjectByID(treeID);
- if(tree != null){
- if(distanceTo(tree.getLocation()) < 9){
- return false;
- }
- if(getMyPlayer().isMoving()) {
- wait(random(300, 600));
- return true;
- }
- }
- return true;
- }
- boolean WalkingToBank() {
- continueWalk(toBank);
- return true;
- }
- boolean Banking(){
- if(!bank.isOpen()) {
- RSObject bankBooth = getNearestObjectByID(bankBooths);
- if(bankBooth != null) {
- atObject(bankBooth, "Use-Quickly");
- return true;
- }
- if(bankBooth == null){
- return false;
- }
- if(getMyPlayer().isMoving()){
- return false;
- }
- }
- if(bank.isOpen()) {
- bank.depositAllExcept(axes);
- bank.close();
- }
- return true;
- }
- boolean Chopping(){
- while(getMyPlayer().getAnimation() != -1){
- wait(800);
- }
- if (getMyPlayer().getAnimation() == -1) {
- RSObject tree = getNearestObjectByID(treeID);
- if (tree == null) {
- log("tree = null");
- return false;
- }
- if(getMyPlayer().isMoving()){
- return false;
- }
- if(tree != null) {
- atTree(tree, "Chop down");
- if(getMyPlayer().getAnimation() != -1) {
- wait(random(500, 800));
- return(true);
- }
- }
- }
- return true;
- }
- ///////LOOP/////////
- public int loop(){
- if(getEnergy() > random(21, 100)) {
- setRun(true);
- }
- if(getMyPlayer().isMoving()){
- return(random(300, 600));
- }
- switch (getAction()){
- case WALKING_TO_TREES:
- log("walking to trees");
- WalkingToTrees();
- status = "WalkingToTrees";
- break;
- case CHOPPING:
- log("chopping");
- Chopping();
- status = "Chopping";
- break;
- case WALKING_TO_BANK:
- log("walking to bank");
- if(isInventoryFull()) {
- WalkingToBank();
- status = "WalkingToBank";
- break;
- }
- case BANKING:
- log("banking");
- if (isInventoryFull()) {
- Banking();
- status = "Banking";
- break;
- }
- }
- return(random(400, 600));
- }
- public void onFinish(){
- log("Script is stopping");
- }
- public void onRepaint(Graphics render) {
- if (isLoggedIn()) {
- Point m = getMouseLocation();
- render.setColor(Color.MAGENTA);
- render.drawLine(m.x, 1, m.x, 1500);
- render.drawLine(1, m.y, 1500, m.y);
- }
- }
- }
Add Comment
Please, Sign In to add comment