Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Yews;
- import java.awt.Graphics2D;
- import java.util.Timer;
- import org.osbot.rs07.api.Bank;
- import org.osbot.rs07.api.map.PolygonArea;
- import org.osbot.rs07.api.map.Position;
- import org.osbot.rs07.api.map.constants.Banks;
- import org.osbot.rs07.api.model.Entity;
- import org.osbot.rs07.api.model.Vector3D;
- import org.osbot.rs07.api.ui.Skill;
- import org.osbot.rs07.event.WalkingEvent;
- import org.osbot.rs07.script.Script;
- import org.osbot.rs07.script.ScriptManifest;
- import org.osbot.rs07.utility.Area;
- @ScriptManifest(author = "Malachi", info = "", logo = "", name = "Yews", version = 0.1)
- public class Yews extends Script{
- Position destination = Banks.VARROCK_WEST.getClosest(myPosition());
- String[] ids = {"Bronze axe", "Iron axe", "Steel axe", "Black axe", "Mithril axe", "Adamant axe", "Rune axe", "Dragon axe"};
- boolean flag = false;
- WalkingEvent we = new WalkingEvent(destination);
- final Area YEW_AREA_VARROCK = new Area(3202, 3506,3224, 3499);
- final Area GE_AREA = new Area(3160, 3493, 3169, 3486);
- int logsChopped = 0;
- static Timer runTime;
- private int beginningXP, currentXP, xpGained;
- final String YEW_NAME = "Yew";
- final int BANK_BOOTH_ID = 10060;
- String currentAxe;
- public void onStart(){
- Timer time = new Timer();
- beginningXP = skills.getExperience(Skill.WOODCUTTING);
- }
- public void onExit(){
- }
- @Override
- public int onLoop() throws InterruptedException {
- // TODO Auto-generated method stub
- if(getInventory().isFull()){
- //bank
- if(YEW_AREA_VARROCK.contains(myPlayer())){
- this.execute(we);
- if(getBank().open()){
- Entity bankbooth = getObjects().closest(BANK_BOOTH_ID);
- if(bank.isOpen()){
- sleep(random(62, 103));
- bank.depositAll();
- }
- else{
- if(getBank().open()){
- bankbooth.interact("Bank");
- sleep(random(700,801));
- }
- else{
- camera.toEntity(bankbooth);
- }
- }
- }
- }
- else{
- this.localWalker.walk(GE_AREA, true);
- if(getBank().open()){
- Entity bankbooth = getObjects().closest(BANK_BOOTH_ID);
- if(bank.isOpen()){
- sleep(random(62, 103));
- bank.depositAll();
- }
- else{
- if(getBank().open()){
- bankbooth.interact("Bank");
- sleep(random(700,801));
- }
- else{
- camera.toEntity(bankbooth);
- }
- }
- }
- }
- }
- else{
- for(int i = 0; i<ids.length-1; i++){
- if(inventory.contains(ids[i])){
- flag = true;
- currentAxe = ids[i];
- }
- //else if(this.isWieldingItem(2));
- }
- //if(flag == true){
- if(YEW_AREA_VARROCK.contains(myPlayer())){
- Entity yew = getObjects().closest(YEW_NAME);
- if(yew!= null){
- if(yew.isVisible()){
- if(!myPlayer().isAnimating()){
- yew.interact("Chop down");
- sleep(random(503, 775));
- }
- else{
- sleep(random(400, 533));
- }
- }
- else{
- camera.toEntity(yew);
- }
- }
- }
- else{
- this.localWalker.walk(YEW_AREA_VARROCK, true);
- }
- //}
- }
- return 0;
- }
- public void onPaint(Graphics2D g){
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement