Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.rsbot.script.Script;
- import org.rsbot.script.ScriptManifest;
- import org.rsbot.script.wrappers.RSObject;
- import org.rsbot.script.wrappers.RSTile;
- @ScriptManifest(authors = { "Vlad K" }, name = "RedBerry", version = 1.0, description = "Picks berries")
- public class tutorial extends Script {
- int rockID[] = { 23628, 23628 };
- int ore = 1951;
- RSTile bankTile = new RSTile(3254, 3420);
- RSTile mineTile = new RSTile(3272, 3374);
- RSTile toBank[] = new RSTile[] { new RSTile(3272, 3374),
- new RSTile(3276, 3372), new RSTile(3291, 3375),
- new RSTile(3292, 3391), new RSTile(3282, 3428),
- new RSTile(3254, 3420) };
- RSTile toMine[] = walking.reversePath(toBank);
- public boolean bank() {
- if (bank.isOpen()) {
- bank.deposit(1951, 28);
- sleep(random(300, 700));
- }
- else {
- bank.open();
- sleep(500);
- while (players.getMyPlayer().isMoving()) {
- sleep(50);
- }
- sleep(700);
- }
- return true;
- }
- public boolean walkToBank() {
- walking.walkPathMM(toMine);
- sleep(700);
- while (players.getMyPlayer().isMoving()) {
- sleep(50);
- }
- return true;
- }
- public boolean walkToBerry() {
- return true;
- }
- public boolean Berry() {
- RSObject rock = objects.getNearest(rockID);
- if (rock != null) {
- rock.doClick();
- sleep(1300);
- while (players.getMyPlayer().getAnimation() != -1) {
- sleep(50);
- }
- }
- return true;
- }
- public boolean onStart() {
- log("Welcome");
- return true;
- }
- @Override
- public int loop() {
- // If inventory full --> bank
- if (inventory.isFull()) {
- if (calc.distanceTo(bankTile) < 5) {
- bank();
- return 10;
- }
- else {
- walkToBank();
- return 10;
- }
- }
- // If not at bank --> go to bank
- // If at bank --> deposit ores
- // If inventory not full --> mine
- if (!inventory.isFull()) {
- if (calc.distanceTo(mineTile) < 5) {
- mine();
- return 10;
- }
- else {
- walkToMine();
- return 10;
- }
- }
- // If not at mine --> go to mine
- // If at mine --> mine ores
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement