Jump to content

MattyMurph

Members
  • Posts

    3
  • Joined

  • Last visited

  • Feedback

    0%

Profile Information

  • Gender
    Male

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

MattyMurph's Achievements

Newbie

Newbie (1/10)

0

Reputation

  1. It does show 'BANK' but doesn't progress from there. & Thanks for the advice mate, will do EDIT: Also just to note, it only shows 'BANK' when I start with a full inventory. If I let the script buy & hop until a full invent, it gets stuck at 'Buying 10' [INFO][Bot #1][01/23 04:54:38 PM]: Started script : GRAPE BUYER [INFO][Bot #1][01/23 04:54:38 PM]: BUYING [INFO][Bot #1][01/23 04:54:38 PM]: BUYING GRAPES NOW [INFO][Bot #1][01/23 04:54:40 PM]: Changing state to buying [INFO][Bot #1][01/23 04:54:40 PM]: BUYING [INFO][Bot #1][01/23 04:54:40 PM]: BUYING GRAPES NOW [INFO][Bot #1][01/23 04:54:40 PM]: store is open [INFO][Bot #1][01/23 04:54:41 PM]: buying 10
  2. Hi all, I had this code working a few years ago, but I can't seem to get it working for the life of me. Been out of coding for a while so it's probably a noob error. Buys & hops fine. But when inventory is full it doesn't bank. Any ideas? Thanks! import org.osbot.rs07.api.model.RS2Object; import org.osbot.rs07.api.ui.RS2Widget; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import java.awt.*; import javax.swing.text.html.parser.Entity; @ScriptManifest(info = "GRAPE BUYER", version = 1.0, logo = "", author = "MATT", name = "GRAPE BUYER") public class main extends Script { enum State { OPENCHEST, BUYGRAPES, BANK, HOP; } public State state; public void onStart(){ if(getInventory().isFull()) { state = State.BANK; log("BANK"); } if (!getInventory().isFull()) { state = State.BUYGRAPES; } if (getInventory().onlyContains("Coins")) { state = State.OPENCHEST; log("OPEN CHEST"); } if(getStore().isOpen() && getStore().getAmount("Grapes") > 0) { state = State.BUYGRAPES; } if(getStore().isOpen() && getStore().getAmount("Grapes") == 0) { state = State.HOP; } } public int onLoop() throws InterruptedException{ switch (state){ case OPENCHEST: return openChest(); case BUYGRAPES: return buyGrapes(); case BANK: return bank(); case HOP: return hopWorlds(); } return random(100, 220); } int openChest() throws InterruptedException { objects.closest("Chest").interact("Buy-food"); sleep(900); if (getInventory().contains("Coins") && !getInventory().isFull()) { if (!getStore().contains("Grapes")) { state = State.HOP; log("HOPPING"); } else if (getStore().contains("Grapes") && !getInventory().isFull()) { log("Changing state to buying"); state = State.BUYGRAPES; } else if (getStore().contains("Grapes") && getInventory().isFull()) { state = State.BANK; } } return 0; } int buyGrapes() throws InterruptedException { log("BUYING"); if (!store.isOpen()) { state = state.OPENCHEST; } log("BUYING GRAPES NOW"); if ((store.isOpen()) && !getInventory().isFull()){ log("store is open"); sleep(300); RS2Widget grapeWidget = getWidgets().get(300, 16, 5); if (grapeWidget != null && grapeWidget.interact("Buy 10")) { log("buying 10"); sleep(1000); } if (store.isOpen()) { store.close(); } if (getInventory().isFull()) { state = State.BANK; } else { log("Hopping"); state = State.HOP; } } else if (getInventory().isFull()) { getBank().depositAllExcept("Coins"); sleep(300); } sleep(300); sleep(300); return 0; } int bank() throws InterruptedException{ if (getBank().isOpen()) { getBank().depositAllExcept("Coins"); } else if (!getBank().isOpen()) { getBank().open(); sleep(300); getBank().depositAllExcept("Coins"); } sleep(300); return 0; } int hopWorlds() throws InterruptedException { getWorlds().hopToP2PWorld(); sleep(300); return 0; } }
  3. Hi all, I've made scripts in the past and I'm used to setting it up with Eclipse. However, when I put the osbot.jar in the external library, none of my code is recognised. I've tried both Eclipse (the way I've done it for years) and IntelliJ but I just get red lines and the errors shown below: package org.osbot.rs07.api.model does not exist package org.osbot.rs07.api.model does not exist package org.osbot.rs07.api.ui does not exist package org.osbot.rs07.api.ui does not exist package org.osbot.rs07.api.ui does not exist package org.osbot.rs07.script does not exist I then followed a set up guide as I thought I may have missed something, but nope, I just can't get it to work. Am I being a dumbass? haha
×
×
  • Create New...