Cant find the problem in my code
-
this is my script and i dont know where the problem is ._. pls help
var scriptName = "InvSort";
var scriptAuthor = "ByGraf";
var scriptVersion = 1.0;
var x = 0;
var y = 0;
var bridge = value.createBoolean("bridge", false);
var bw = value.createBoolean("bw", false);function Sort() {
this.addValues = function(values) { values.add(bridge); values.add(bw); } this.onEnable = function() { x = 0; y = 0; }; this.onDisable = function() { x = 0; y = 0; }; this.getName = function() { return "InvSort"; } this.getCategory = function() { return "Player"; } this.getDescription = function() { return "Inventorycleaner addon"; } this.onUpdate = function(){ if(!bridge.get()){ x = 0; } if (!bw.get()){ y = 0; } if (bridge.get() && x == 0){ commandManager.executeCommand(.inventorycleaner throwgarbage false); commandManager.executeCommand(.inventorycleaner sortslot-1 Sword); commandManager.executeCommand(.inventorycleaner sortslot-2 Pickaxe); commandManager.executeCommand(.inventorycleaner sortslot-3 Gapple); commandManager.executeCommand(.inventorycleaner sortslot-4 Bow); commandManager.executeCommand(.inventorycleaner sortslot-5 Ignore); commandManager.executeCommand(.inventorycleaner sortslot-6 Ignore); commandManager.executeCommand(.inventorycleaner sortslot-7 Ignore); commandManager.executeCommand(.inventorycleaner sortslot-8 Ignore); commandManager.executeCommand(.inventorycleaner sortslot-9 Block); x = 1; } if(bw.get() && y == 0){ commandManager.executeCommand(.inventorycleaner throwgarbage false); commandManager.executeCommand(.inventorycleaner sortslot-1 Sword); commandManager.executeCommand(.inventorycleaner sortslot-2 Ignore); commandManager.executeCommand(.inventorycleaner sortslot-3 Ignore); commandManager.executeCommand(.inventorycleaner sortslot-4 Gapple); commandManager.executeCommand(.inventorycleaner sortslot-5 Ignore); commandManager.executeCommand(.inventorycleaner sortslot-6 Ignore); commandManager.executeCommand(.inventorycleaner sortslot-7 Ignore); commandManager.executeCommand(.inventorycleaner sortslot-8 Ignore); commandManager.executeCommand(.inventorycleaner sortslot-9 Block); y = 1; } }
}
var module = new Sort();
var Client;function onEnable() {
Client = moduleManager.registerModule(module);}
function onDisable() {
moduleManager.unregisterModule(Client);}
-
@bygraf all commands must be placed inside quotation marks.
e.g.commandManager.executeCommand(.inventorycleaner throwgarbage false);
to
commandManager.executeCommand(".inventorycleaner throwgarbage false");
and the same for others.
-
@exit-scammed ahh lol thx
-
-
@exit-scammed I think that's supposed to be like this
var LB = Java.type("net.ccbluex.liquidbounce.LiquidBounce"); LB.commandManager.executeCommands(".inventorycleaner throwgarbage false");
-
@stfwissue LiquidBounce automatically imports its
commandManager
variable while loading the script. Take a look at line 58 ofScript.kt
:scriptEngine.put("commandManager", LiquidBounce.commandManager)
P/s: I didn't notice the typo, it's actually
executeCommands
instead ofexecuteCommand
.fun executeCommands(input: String) {
-
@exit-scammed It's ok