Jump to content

Script Manager issues


yeldarb

Recommended Posts

Hello everyone this is my first post! So thank you for sharing this experience with me! Start off, big shout out to all the devs at OSBot keeping this thing stable!!

 

Im currently working on a AIO Script. It incorporates each script ive wrote basically into one. I want to beable to have a fresh account and start the bot and have it go from tut island, to maxed main. Currently im running into issues creating a setup to call each script. Id really rather prefer not to use OSBots built in methods to queue scripts. Id like to use my RunnerScript as a "main hub", and execute from that while maintaining it in the background until the "Task" is complete and ready for another script. Im trying to have RunnerScript do the following:

public RunnerScript extends Script {
    Miner miner;
    Script currentScript;
  
    @Override
    public void onStart(){
      	miner = new Miner();
        currentScript = miner;
    }
  
    @Override	
    public int onLoop() throws InterruptedException {
        currentScript.onLoop();
        return 100;
    }
}

public Miner extends RunnerScript {
    public int onLoop(){ //Not Override method
        ...
    }

    public void onStart(){ //Not Override method
        ...
    }
}

Currently I have each script extending my RunnerScript, as a sort of MethodProvider. Although I keep getting ScriptExecutor, and ThreadPoolExecutor errors everytime it calls onLoop(), onStart(), etc...

 

        at com.yeldarb.Script.AIOScript.onStart(RunnerScript.java:40) //getMinerScript().onStart();

        at org.osbot.rs07.event.ScriptExecutor.IiiIIiiiIiI(jl:531)

        at org.osbot.rs07.event.ScriptExecutor.start(jl:463)

        at org.osbot.LPT5.IiiIiiIIIIi(iw:176)

        at org.osbot.LPT1.IiiIiiIIIIi(su:519)

        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)

        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)

        at java.base/java.lang.Thread.run(Thread.java:833)

 

Thank you so much!!

 

Sincerely,

   Yeldard

Edited by yeldarb
Fixing indentation in code blocks
Link to comment
Share on other sites

On 7/6/2023 at 8:54 AM, Gunman said:

@yeldarb Need to exchange context

miner.exchangeContext(getBot());

Thank you so much! That plus overriding exchangeContext to provide my TaskManager with the bot instance made it work like a charm! Thank you so much. Ill have to post a writeup shortly on my "setup". Im so excited to start adding scripts into this AIO!

  • Boge 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...