Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Loading a GZIP compressed resource file

Featured Replies

G'day guys,

 

I'm using a trained Markov Chain to create random user names for an upcoming tutorial island script, however, when trying to load the saved markov_chain.dat file I'm getting the following exception:

 

I have verified that the file is found, of note the bytes available on the input stream are zero and the type of the InputStream is java.util.zip.ZipFile.ZipFileInflaterInputStream, is OSBot trying to do some magic for me or is it slapping my wrists for not following a convention?

 

Begin stack trace for Exception: [java.io.IOException: Stream closed]
java.util.zip.InflaterInputStream.ensureOpen(InflaterInputStream.java:67)
java.util.zip.InflaterInputStream.read(InflaterInputStream.java:142)
java.io.ObjectInputStream$PeekInputStream.read(ObjectInputStream.java:2781)
java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2797)
java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3274)
java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:934)
java.io.ObjectInputStream.<init>(ObjectInputStream.java:396)
org.sxam.osrs.bots.GarboIslando.utils.NameGenerator.MarkovChainGenerator.loadFromFile(MarkovChainGenerator.java:42)
org.sxam.osrs.bots.GarboIslando.utils.NameGenerator.NameGenerator.generateName(NameGenerator.java:21)
org.sxam.osrs.bots.GarboIslando.tasks.HandleGielinorGuideTask.sxamExecute(HandleGielinorGuideTask.java:77)
org.sxam.osrs.bot.structure.SXAMStateTask.executeCurrentTask(SXAMStateTask.java:116)
org.sxam.osrs.bot.structure.SXAMHarness.performStateWork(SXAMHarness.java:271)
org.sxam.osrs.bot.structure.SXAMHarness.TICK(SXAMHarness.java:255)
org.sxam.osrs.bot.structure.SXAMInterfaces$SXAMBotBaseInterface.sxamOnLoop(SXAMInterfaces.java:108)
org.sxam.osrs.bot.structure.osbot.looping.OSBotLoopRunner.onLoop(OSBotLoopRunner.java:69)
org.osbot.rs07.event.ScriptExecutor$InternalExecutor.run(ip:52)
java.lang.Thread.run(Thread.java:748)

 

The code:

Reading from getScriptResourceAsStream:

  public InputStream getResourceStream(String fileName) {
    return getPlatformMethodProvider().getScriptResourceAsStream(fileName);
  }

Loading from InputStream:

        NameGenerator.generator =
            MarkovChainGenerator.loadFromFile(
                SXAMExecutionEnvironment.Core.getResourceStream("markov_chain.dat"));

The Uber jar structure:

image.png.288de689152771835efc265125c0e61e.png

 

Any ideas guys? Am I barking up the wrong tree here?

 

Cheers,

Mitch.

  • Author
16 hours ago, Muffins said:

I believe any external files that you want loaded into your script need to be in

 

C:\Users\YOURNAME\OSBot\Data

 

Legend!

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.