Potbelly 1 Posted October 26, 2022 Hey! I've been trying to run a new script from another script. This line of code gives me an error: Client.getInstance().getScriptManager().start("Name"); Any clues to fixing it? I'm running this line of code in a private void.
Potbelly 1 Author Posted October 26, 2022 Okay, I got more info from this post My final code looks like this. Notice that the start function has to have a second parameter, even if you don't want to give any arguments ScriptManager sm = Client.getInstance().getScriptManager(); ExecutorService executor = Executors.newSingleThreadExecutor(); executor.submit(() -> { try{ TimeUnit.SECONDS.sleep(3); sm.start("Cow Tanner", ""); } catch(Exception e) { } }); this.stop(); Hope this helps someone! lowey1199 1
lowey1199 8 Posted September 22, 2023 On 10/26/2022 at 5:52 PM, Potbelly said: Okay, I got more info from this post My final code looks like this. Notice that the start function has to have a second parameter, even if you don't want to give any arguments ScriptManager sm = Client.getInstance().getScriptManager(); ExecutorService executor = Executors.newSingleThreadExecutor(); executor.submit(() -> { try{ TimeUnit.SECONDS.sleep(3); sm.start("Cow Tanner", ""); } catch(Exception e) { } }); this.stop(); Hope this helps someone! Thank you so much!!!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now