Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package woodcutter;
- import java.awt.Graphics;
- import org.osbot.rs07.api.Bank;
- import org.osbot.rs07.api.Inventory;
- import org.osbot.rs07.api.map.Area;
- import org.osbot.rs07.api.model.Entity;
- import org.osbot.rs07.script.Script;
- import org.osbot.rs07.script.ScriptManifest;
- @ScriptManifest(author = "Em0re", info = "WoodCuts Logs at G.E", logo = "", name = "WoodCutter", version = 0.1)
- public class Woodcutter extends Script {
- final Area BANK_AREA = new Area(3170, 3485, 3160, 3494);
- final Area YEW_AREA = new Area(3202, 3506, 3224, 3499);
- final int BANKER_ID = 5455;
- // code used at start.
- public void onStart() {
- }
- // Code to be excuted at the end
- public void onExit() {
- }
- // code in loop
- public int onLoop() throws InterruptedException {
- Inventory inven = getInventory();
- Bank bank = getBank();
- if (!inven.isFull()) {
- // chop
- if(YEW_AREA.contains(myPlayer())){
- Entity yew = getObjects().closest("Yew");
- if (yew != null) {
- if (yew.isVisible()) {
- log("Yew is visible");
- if (!myPlayer().isAnimating()) {
- if (!myPlayer().isMoving()) {
- yew.interact("Chop down");
- sleep(random(700, 800));
- }
- }
- } else {
- getCamera().toEntity(yew);
- log("camera moving to yew");
- }
- }
- }else{
- // walk yew area
- }
- } else {
- // bank
- if (BANK_AREA.contains(myPlayer())) {
- Entity banker = getObjects().closest(BANKER_ID);
- if (bank.isOpen()) {
- bank.depositAll();
- } else {
- }
- if (banker != null) {
- if (banker.isVisible()) {
- banker.interact("Bank");
- sleep(random(700, 800));
- }else{
- getCamera().toEntity(banker);
- }
- }
- } else {
- //walk to the bank area
- }
- }
- return 50;
- }
- // Paint
- public void onPaint(Graphics g) {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement