Why I can't use commandManager or moduleManager in my script
-



-
@isnotpuppy Probably because of the kotlin ports, however this wasn't expected since:
I will look into this.
-
@isnotpuppy Probably because of the kotlin ports, however this wasn't expected since:
I will look into this.
@CzechHek ty
-
since everything is in kotlin now, you most likely have to do moduleManager.INSTANCE.getModule()
commandManager.INSTANCE....however this may be subject to change in the future because the documentation doesn't show this and it's not good
-
since everything is in kotlin now, you most likely have to do moduleManager.INSTANCE.getModule()
commandManager.INSTANCE....however this may be subject to change in the future because the documentation doesn't show this and it's not good
So I've been looking into this and I noticed following:
try { Chat.print(typeof(scriptManager)); // object Chat.print(JSON.stringify(scriptManager)); // undefined scriptManager.unloadScripts(); Chat.print("done"); // works }catch (e) { Chat.print(e); } try { Chat.print(typeof(commandManager)); // [object] Chat.print(JSON.stringify(commandManager)); // {} commandManager.registerCommands(); // not working -> TypeError: commandManager.registerCommands is not a function commandManager.executeCommands('killaura range 3.4'); // not working, stopped above }catch (e) { Chat.print(e); } try { Chat.print(typeof(moduleManager)); // [object] Chat.print(JSON.stringify(moduleManager)); // {} moduleManager.registerModules(); // not working -> TypeError: moduleManager.registerModules is not a function moduleManager.getModule('KillAura').setState(false); // not working, stopped above }catch (e) { Chat.print(e); }After changing the variable name of
commandManagerandmoduleManagertopickaxeandstoneit suddenly worked!scriptEngine.put("stone", moduleManager) scriptEngine.put("pickaxe", commandManager) scriptEngine.put("scriptManager", scriptManager)So it seems to be conflicting with something else.
Oh my god... I realized. It was caused by the ScriptAPI v1 legacy support script. >(
this.moduleManager = Java.type("net.ccbluex.liquidbounce.LiquidBounce").moduleManager; this.Module = Java.type("net.ccbluex.liquidbounce.features.module.Module"); this.ArrayList = Java.type("java.util.ArrayList"); -
@isnotpuppy Put this tag on the top of your script:
/// api_version=2 ... codeThis will fix the issue.
See: https://liquidbounce.net/docs/ScriptAPI/Getting StartedAlso fixed in future versions by removing support for ScriptAPI v1:
https://github.com/CCBlueX/LiquidBounce/commit/3e92903f1372e1c96225bca057f0f136928d3bd5
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login