Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package miner;
- import java.awt.Graphics;
- import org.osbot.rs07.script.*;
- import org.osbot.rs07.api.Inventory;
- import org.osbot.rs07.api.map.Area;
- import org.osbot.rs07.api.model.Entity;
- import org.osbot.rs07.api.model.Player;
- import org.osbot.rs07.api.model.RS2Object;
- import org.osbot.rs07.event.*;
- @ScriptManifest(author = "daylanzz", info = "mines coal at mining guild", name = "mining guild miner", version = 1.00, logo="")
- public class miner extends Script {
- final String ROCKS_NAME = "Rocks";
- final String LADDER_NAME = "ladder";
- final Area BANK_AREA = new Area(3009, 3355, 3018, 3358);
- final Area WALK_AREA1 = new Area(3023, 3353, 3025, 3356);
- final Area WALK_AREA2 = new Area(3028,3345, 3031, 3348);
- final Area WALK_AREA4 = new Area(3016, 3337, 3022, 3341);
- final Area WALK_AREA5 = new Area(3017, 9737, 3021, 9741);
- final Area WALK_AREA6 = new Area(3038, 9736, 3040, 9738);
- final Area MINING_AREA = new Area(3028, 9732, 3055, 9747);
- final int BANK_BOOTH_ID = 24101;
- final int ladder = 12653;
- // code used at start
- public void onStart() {
- }
- // code to be executted at the end
- public void onExit() {
- }
- // code in loop
- public int onLoop() throws InterruptedException {
- Inventory inven = client.getInventory();
- Player player = client.getMyPlayer();
- Entity Rocks = closestObject (6759 , 6758);
- if (!inven.isFull()) {
- {
- if (BANK_AREA.contains(player))
- walk(WALK_AREA1);
- if (WALK_AREA1.contains(player))
- walk(WALK_AREA2);
- if (WALK_AREA2.contains(player))
- walk(WALK_AREA4);
- if (WALK_AREA4.contains(player))
- if (player.isInArea(WALK_AREA4))
- closestObject(ladder).interact("Climb-down");
- sleep (random(2000-2500));
- if (WALK_AREA5.contains(player))
- walk(WALK_AREA6);
- if (WALK_AREA6.contains(player))
- walk(MINING_AREA);
- }
- if (MINING_AREA.contains(player)) {
- if (Rocks.isVisible()) {
- if (!player.isAnimating()) {
- if (!player.isMoving()) {
- Rocks.interact("Mine");
- sleep(random(700, 800));
- } else {
- client.moveCameraToEntity(Rocks);
- }
- }
- } else {
- walk(MINING_AREA);
- }
- }
- }else{
- if (inven.isFull()) {
- if (MINING_AREA.contains(player))
- walk(WALK_AREA6);
- if (WALK_AREA6.contains(player))
- walk(WALK_AREA5);
- if (WALK_AREA5.contains(player))
- if ((closestObject(2120) != null))
- if(closestObject(2120).isVisible())
- { closestObject(2120).interact("Climb-up");}
- sleep (random(2000-2500));
- walk(WALK_AREA5);
- if (WALK_AREA5.contains(player))
- walk(WALK_AREA4);
- if (WALK_AREA4.contains(player))
- walk(WALK_AREA2);
- if (WALK_AREA2.contains(player))
- walk(WALK_AREA1);
- if (WALK_AREA1.contains(player))
- walk(BANK_AREA);
- if (BANK_AREA.contains(player)) {
- bankDeposit();
- } else {
- walk(BANK_AREA);
- }
- }
- }
- return 50;
- }
- // paint
- public void onPaint(Graphics g) {
- }
- public void bankDeposit() throws InterruptedException {
- RS2Object booth = closestObjectForName("Bank booth");
- if ((booth != null) && (booth.interact("Bank"))) {
- booth.interact("Bank");
- sleep(1000);
- }
- while (this.client.getMyPlayer().isMoving()) {
- sleep(1500);
- }
- if (this.client.getBank().isOpen()) {
- this.client.getBank().depositAllExcept(1271, 1275);
- sleep(1000);
- }
- if (this.client.getInventory().isEmpty()) {
- this.client.getBank().close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement