Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Graphics;
- import com.rarebot.event.listeners.PaintListener;
- import com.rarebot.script.Script;
- import com.rarebot.script.ScriptManifest;
- import com.rarebot.script.wrappers.RSArea;
- import com.rarebot.script.wrappers.RSObject;
- import com.rarebot.script.wrappers.RSTile;
- import com.rarebot.script.wrappers.RSWeb;
- @ScriptManifest(name="CloudyWoods", authors={""}, keywords={""}, version= 1.0, description="")
- public class CloudyWoods extends Script implements PaintListener {
- //Areas
- RSArea DraynorBankArea = new RSArea(3092,3246,3095,3240);
- RSArea DraynorTreeArea = new RSArea(3057,3255,3064,3251);
- //Tiles
- RSTile DraynorBankTile = new RSTile(3093,3244);
- RSTile DraynorTreeTile = new RSTile(3060,3253);
- //Info
- int status = 0;
- String[] statusText = { };
- //Vars
- RSWeb WalkPath;
- int chopCD = 0;
- int anim = 867;
- @Override
- public int loop() {
- log("wtF");
- if(players.getMyPlayer().getAnimation() == anim) {
- chopCD = 50;
- } else {
- chopCD--;
- }
- if(chopCD == 0) {
- switch(getStatus()) {
- case 1: //in bank
- {
- if(inventory.isFull()) {
- if(bank.isOpen()) {
- bank.depositAll();
- } else {
- bank.open();
- }
- } else {
- WalkPath = web.getWeb(getMyPlayer().getLocation(),DraynorTreeTile);
- walkProcedure();
- }
- } break;
- case 2: //walking
- {
- if(inventory.isFull()) {
- WalkPath = web.getWeb(getMyPlayer().getLocation(),DraynorTreeTile);
- } else {
- WalkPath = web.getWeb(getMyPlayer().getLocation(),DraynorBankTile);
- }
- walkProcedure();
- } break;
- case 3: //chopping
- {
- if(!inventory.isFull()) {
- RSObject tree = objects.getNearest("Willow");
- if(tree != null) {
- tree.interact("Chop");
- }
- } else {
- WalkPath = web.getWeb(getMyPlayer().getLocation(),DraynorBankTile);
- walkProcedure();
- }
- } break;
- }
- }
- return calc.random(200, 800);
- }
- public void walkProcedure() {
- if(WalkPath != null) {
- if(calc.distanceTo(walking.getDestination()) <= 7 || walking.getDestination() == null) {
- try {
- WalkPath.step();
- sleep(200,500);
- } catch (Exception e) {
- log("borked");
- }
- }
- }
- }
- public int getStatus() {
- if(DraynorBankArea.contains(players.getMyPlayer().getLocation())) {
- return 1;
- }
- if(DraynorTreeArea.contains(players.getMyPlayer().getLocation())) {
- return 3;
- }
- return 2;
- }
- @Override
- public void onRepaint(Graphics g) {
- g.drawString("Status: " + statusText[status], 10, 10);
- g.drawString("Cooldown: " + chopCD, 10, 20);
- g.drawString("Inventory: ", 10, 30);
- g.drawString("Object: ", 10, 40);
- g.drawString("NPC: ", 10, 50);
- }
- }
Add Comment
Please, Sign In to add comment