sxammy Posted March 20, 2023 Share Posted March 20, 2023 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: Any ideas guys? Am I barking up the wrong tree here? Cheers, Mitch. Quote Link to comment Share on other sites More sharing options...
Muffins Posted March 20, 2023 Share Posted March 20, 2023 I believe any external files that you want loaded into your script need to be in C:\Users\YOURNAME\OSBot\Data 1 Quote Link to comment Share on other sites More sharing options...
sxammy Posted March 21, 2023 Author Share Posted March 21, 2023 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! 1 Quote Link to comment Share on other sites More sharing options...