Jump to content

Malcolm

Global Moderator
  • Posts

    137704
  • Joined

  • Last visited

  • Days Won

    21
  • Feedback

    100%

Everything posted by Malcolm

  1. Yeah I'm not waiting that long. I'll have to see what I can do to actually have that going for that long.
  2. Am I not able to use any sort of NPC as a break condition? I've been having a problem getting this to work. Maybe I'm just being a dummy xD walkEvent.setBreakCondition(new Condition() { @Override public boolean evaluate() { return mage != null && mage.isVisible(); } });
  3. is this not osbuddy prices anyways? So you could actually use this instead of importing osbuddy?
  4. That can't be as I've tested it and it returns something different than that. keyboard.typeString(""+getGrandExchange().getOverallPrice(2353));
  5. getGrandExchange().getOverallPrice(int ID); What does this actually return? @Patrick If I am correct (and what I've used it for) I think this returns the overall value of the item in the GE (not the actual listed price) but I'm not 100% sure. If this is the case it would make any OSBuddy import prices redundant.
  6. I looked but I couldn’t find one so let’s just pretend it is. I wouldn’t be surprised if it’s not
  7. Just give this Diamond rings and watch how many girlfriends you can get! Bot spams "Buying gf" and waits for a trade. I told you @Juggles , I'd come up with a good meme to compete with your bot reporting bot. import java.awt.event.KeyEvent; import org.osbot.rs07.api.map.constants.Banks; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; import org.osbot.rs07.utility.ConditionalSleep; @ScriptManifest(author = "Malcolm", info = "Buys GF", name = "BF Buyer", version = 1.0, logo = "") public class Main extends Script { long tradeTime; public int onLoop() throws InterruptedException { if (getInventory().contains("Diamond ring")) { if (!Banks.GRAND_EXCHANGE.contains(myPlayer())) { getWalking().webWalk(Banks.GRAND_EXCHANGE.getRandomPosition()); } else { if (!getTrade().isCurrentlyTrading()) { typeStringInstant("cyan: Buying gf!"); sleep(random(3000, 4000)); if (getTrade().getRequestListener() != null) { if (getTrade().getLastRequestingPlayer() != null) { if (getTrade().getLastRequestingPlayer().interact("Trade with")) { tradeTime = System.currentTimeMillis(); new ConditionalSleep(10000) { @Override public boolean condition() throws InterruptedException { return getTrade().isCurrentlyTrading(); } }.sleep(); } } } } else { if (getWidgets().getTrade().isFirstInterfaceOpen()) { if (System.currentTimeMillis() > (tradeTime + 30000)) { if (getTrade().declineTrade()) { new ConditionalSleep(10000) { @Override public boolean condition() throws InterruptedException { return !getTrade().isCurrentlyTrading(); } }.sleep(); } } else { long dringAmount = getInventory().getAmount("Diamond ring"); if (getTrade().offer("Diamond ring", 1)) { new ConditionalSleep(40000) { @Override public boolean condition() throws InterruptedException { return dringAmount != getInventory().getAmount("Diamong ring"); } }.sleep(); if (getTrade().acceptTrade()) { new ConditionalSleep(40000) { @Override public boolean condition() throws InterruptedException { return getTrade().isSecondInterfaceOpen(); } }.sleep(); } } } } else if (getTrade().isSecondInterfaceOpen()) { if (getTrade().didOtherAcceptTrade()) { mouse.move(220, 300); sleep(random(300, 600)); mouse.click(false); new ConditionalSleep(40000) { @Override public boolean condition() throws InterruptedException { return !getTrade().isSecondInterfaceOpen(); } }.sleep(); typeStringInstant("cyan: We are now married! Love you!"); } } } } } else { log("No more rings! Stopping script"); stop(); } return 1000; } private void typeStringInstant(String output) { for (int i = 0; i < output.length(); i++) { char c = output.charAt(i); int code = KeyEvent.getExtendedKeyCodeForChar(c); getBot().getKeyEventHandler().generateBotKeyEvent(400, System.currentTimeMillis(), 0, code, c); } getBot().getKeyEventHandler().generateBotKeyEvent(401, System.currentTimeMillis(), 0, 10, '\u0000'); getBot().getKeyEventHandler().generateBotKeyEvent(402, System.currentTimeMillis(), 0, 10, '\u0000'); } } NOTE: at the time of writing there was an issue with the API and it did not wan't to accept the second screen. This section: mouse.move(220, 300); sleep(random(300, 600)); mouse.click(false); Should be: if (getTrade().acceptTrade()) {
×
×
  • Create New...