Jump to content

yfoo

Lifetime Sponsor
  • Posts

    230
  • Joined

  • Last visited

  • Days Won

    1
  • Feedback

    100%

yfoo last won the day on April 30

yfoo had the most liked content!

1 Follower

About yfoo

Profile Information

  • Gender
    Male
  • Location:
    SW U.S

Recent Profile Visitors

3305 profile views

yfoo's Achievements

Steel Poster

Steel Poster (4/10)

95

Reputation

  1. Mirror lags behind a day or 2 unfortunately.
  2. Wow really nice. Mind adding a random gaussian sleep after all bars have been smelted before banking?
  3. Use ```inventory.interact(13,"Use"))``` To select slot 13. followed by ```inventory.interact(14, USE)```. Here is how I dod mine private boolean combineComponents() throws InterruptedException { int[] slotPair = getInvSlotPair(); Item item1 = inventory.getItemInSlot(slotPair[0]); Item item2 = inventory.getItemInSlot(slotPair[1]); boolean notNull = item1 != null && item2 != null; boolean notSameItem = notNull && item1.getId() != item2.getId(); // Assert Item1 and 2 are the equivalent items determined at script start (ItemA and B). // Not foolproof, but a simple method boolean sumTo0 = notNull && (item1.getId() + item2.getId() - itemA.getId() - itemB.getId() == 0); boolean canUseSlotPair = notSameItem && sumTo0; if (canUseSlotPair && inventory.interact(slotPair[0], USE)) { ScriptPaint.setStatus("ItemA -> ItemB"); sleep(randomGaussian(300, 100)); return inventory.isItemSelected() && inventory.interact(slotPair[1], USE); } else { ScriptPaint.setStatus("ItemA -> ItemB w/ backup interaction"); if (inventory.interact(USE, itemA.getId())) { sleep(randomGaussian(300, 100)); return inventory.isItemSelected() && inventory.interact(USE, itemB.getId()); } } return false; }
  4. When I wrote it like 2 weeks ago it worked. You need to override the break manager with an instance of the class Put this in onStart bot.getRandomExecutor().overrideOSBotRandom(BreakManagerHook.initInstance(bot)); Then use this to start a break early. BreakManagerHook.getInstance().startBreakEarly();
  5. yfoo

    Speedrun Quester

    Gets stuck on black knights fortress, It attempts to enter through the wrong door, it should go through the single doors next to the guards. https://ibb.co/t3Ghqqb
  6. That works sure, but why not just rwt gold then buy bonds. Cheaper than using pesos probably. Buy from a private seller rather than a major site, less chance of being rwt flagged. .
  7. This was the end result I settled with. I also happened to need a hook to know when the break ended to potentially check if my position was crashed while I was away. The OnExit() allows me to know that. For now I'm not doing anything with it just logging (log("Return from break!");) package Util; import org.osbot.rs07.Bot; import org.osbot.rs07.randoms.BreakManager; public class BreakManagerHook extends BreakManager { private volatile boolean breakEarly; private volatile boolean shouldActivateCalled; private static BreakManagerHook instance; public static BreakManagerHook getInstance() { if(instance == null) { throw new NullPointerException("ExcavatePlantIgnite is null"); } return instance; } public static BreakManagerHook initInstance(Bot bot) { instance = new BreakManagerHook(bot); return instance; } private BreakManagerHook(Bot IiIiiiIiiII) { super(IiIiiiIiiII); } @Override public synchronized boolean shouldActivate() { if(breakEarly && !shouldActivateCalled) { log(String.format("Thread %d notifying...", Thread.currentThread().getId())); shouldActivateCalled = true; this.notify(); } if(super.shouldActivate() && breakEarly) { breakEarly = false; log("breakEarly -> false"); } return super.shouldActivate() || breakEarly; } @Override public void onExit() { super.onExit(); log("Return from break!"); } public synchronized void startBreakEarly() throws InterruptedException { breakEarly = true; shouldActivateCalled = false; while (!shouldActivateCalled) { log(String.format("Thread %d waiting until shouldActivate() called...", Thread.currentThread().getId())); this.wait(); } log("Exited startBreakEarly"); } }
  8. Yes, I do not want a break to happen at a certain time. I was working on a blast mining script If there was not enough time remaining before break to do cycle then start the break early.
  9. Ok this seems to work. shouldActivate() gets called multiple times, so I have to "short circuit" it. @Override public boolean shouldActivate() { if(breakNow) log("Early breaking"); return super.shouldActivate() || breakNow; }
  10. I want to start a break early. This doesn't work. OSB logs "Started random solver : " then immediately calls onExit, skipping BreakManager's onloop. package Util; import org.osbot.rs07.Bot; import org.osbot.rs07.randoms.BreakManager; public class BreakManagerHook extends BreakManager { private static boolean breakNow = false; public BreakManagerHook(Bot IiIiiiIiiII) { super(IiIiiiIiiII); } @Override public boolean shouldActivate() { if(super.shouldActivate() || breakNow) { breakNow = false; return true; } return false; } @Override public void onExit() { super.onExit(); log("Return from break hook!"); } public static void startBreakNow() { breakNow = true; } }
  11. Wow, I didn't even know this was a thing in the game.
  12. Path is wrong. its in /res, and getScriptResourceAsStream("img.png") does not have /res in it.
  13. yfoo

    Khal Utilities

    For the time being, you can use one of the GE NPCs to "decant" your rings just like how potions work.
×
×
  • Create New...