Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //AIOWcer V0.1
- 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
- }
- public String bankAt = "";
- public String chopAt = "";
- 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 StartingExp;
- public int ExpGained;
- public int[] bankBooths = {2213};
- public int[] nestIDs = { 5070, 5071, 5072, 5073, 5074, 5075, 7413 };
- public RSTile[] toBank, toTrees;
- public int price;
- public int profit;
- public int nestzFound;
- public int cut;
- public int startExp;
- 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[] YewTree = { 1309, 8503, 8504, 8505, 8506, 8507, 8508, 8509,
- 8510, 8511, 8512, 8513 };
- // /////////LOCATIONS///////////////
- public boolean onStart(Map<String, String> args) {
- log("aioWcer Initialized!");
- log("I hope you Enjoy the script");
- log("Check my thread to make sure that your version of this script is up to date..");
- if (args.get("trees").equals("WestVarrock RegularLogs")) {
- price = 36;
- treeID = new int[] { 1278 };
- 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;
- treeID = new int[] { 1281 };
- toTrees = new RSTile[] { new RSTile(3253, 3420),
- new RSTile(3265, 3428), new RSTile(3279, 3429) };
- toBank = reversePath(toTrees);
- }
- if (args.get("trees").equals("Draynor Willows")) {
- bankAt = "Draynor Bank";
- chopAt = "Draynor Willows";
- price = 8;
- logsID = new int[] {1519};
- treeID = new int[] { 5553, 5551, 5552 };
- 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")) {
- cut += 1;
- }
- }
- public actions getAction() {
- if(inArea(bankAt) && !inventoryContains(logsID) && !bank.isOpen()) {
- return actions.WALKING_TO_TREES;
- }
- if(inArea(bankAt) && isInventoryFull()) {
- return actions.BANKING;
- }
- if(inArea(chopAt) && isInventoryFull() && !inArea(bankAt)) {
- return actions.WALKING_TO_BANK;
- }
- if(inArea(chopAt) && !getMyPlayer().isMoving() && !isInventoryFull()) {
- return actions.CHOPPING;
- }
- return actions.WAIT;
- }
- ///////LOOP/////////
- public int loop() {
- actions act = getAction();
- switch (act) {
- case WALKING_TO_TREES:
- continueWalk(toTrees);
- break;
- case WALKING_TO_BANK:
- walkPathMM(toBank);
- break;
- case BANKING:
- walkPathMM(toBank);
- if(!bank.isOpen()) {
- RSObject bankBooth = getNearestObjectByID(bankBooths);
- if(bankBooth != null) {
- atObject(bankBooth, "se-Quickly");
- return random(500, 1000);
- }
- }
- if(bank.isOpen()) {
- bank.depositAllExcept(axes);
- bank.close();
- return random(400, 600);
- }
- break;
- case CHOPPING:
- if (getMyPlayer().getAnimation() != 867) {
- RSObject tree = getNearestObjectByID(treeID);
- if(tree != null) {
- atObject(tree, "chop");
- if(treeID == null){
- return (random(500,1000));
- }
- if (treeID == null) {
- log("Tree is null");
- return 500;
- }
- }
- }
- }
- return(random(500, 1000));
- }
- public void continueWalk(RSTile[] path) {
- if(!getMyPlayer().isMoving() && distanceTo(getDestination()) <= random(3, 6)) {
- walkPathMM(randomizePath(path, 2, 2));
- }
- }
- public boolean inArea(String area) {
- int x = getMyPlayer().getLocation().getX();
- int y = getMyPlayer().getLocation().getY();
- if(area.equals("Draynor Bank")) {
- return x >= 3092 && x <= 3097 && y >= 3240 && y <= 3245;
- }
- if(area.equals("Draynor Willows")) {
- return x >= 3081 && x <= 3091 && y >= 3226 && y <= 3238;
- }
- return x >= 1 && x <= 1 && y >= 1 && y <= 1;
- }
- public void onRepaint(Graphics render) {
- if (isLoggedIn()) {
- render.setColor(new Color(128, 0, 128));
- long millis = System.currentTimeMillis() - startTime;
- long hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- long minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- long seconds = millis / 1000;
- render.drawString("Time Running: " + hours + ":" + minutes + ":"
- + seconds, 240, 356);
- if (StartingExp == 0) {
- StartingExp = skills.getCurrentSkillExp(STAT_WOODCUTTING);
- ExpGained = skills.getCurrentSkillExp(STAT_WOODCUTTING);
- }
- render.setColor(new Color(255, 0, 0));
- render.drawString("Exp Gained: ", ExpGained, ExpGained);
- }
- }
- }
Add Comment
Please, Sign In to add comment