I dont have ANY idea why this script is broken.
Unsolved
ScriptAPI
-
So, everytime i use MoveUtil & reload, it doesnt do anything. Heres the script:
var script = registerScript({ name: 'NCPSpeed', version: '1.3.3.7', authors: ["Kellohylly"] }); var MoveUtils = Java.type("net.ccbluex.liquidbounce.utils.MovementUtils"); script.registerModule({ name: 'NCPSpeed', category: 'Fun', description: '', tag: '' }, function (module) { module.on('disable', function() { mc.timer.timerSpeed = 1; }); module.on('motion', function(e) { if (mc.thePlayer.onGround) { MoveUtils.strafe(0.485); mc.thePlayer.jump(); } }); });
It would be nice if someone would know how to fix this.
-
@rthrthwtrhg
Ports to kotlin + removal of unnecessary @JvmStatic means that you have to access LB utils and fields with kotlin getters and static .INSTANCE.In this case MoveUtils.INSTANCE.strafe(), but its arguments have also changed, you have to put a few booleans as well, look at MovementUtils source.
ScriptAPI should get its own built-in utils to simplify stuff.
-
Ported it for you and added
- NoMoveStop -> makes you stop if you dont press any movement key
- OnlyOnMove -> requires you to press movement keys to speed up
///api_version=2 (script = registerScript({ name: "NCPSpeed", version: "1.3.3.7", authors: ["Kellohylly"] })); script.registerModule({ name: "NCPSpeed", category: "Fun", description: "NCP-Speed", settings: { nomovestop: Setting.boolean({ name: "NoMoveStop", default: false }), onlyonmove: Setting.boolean({ name: "OnlyOnMove", default: false }), }, }, function (module) { module.on("disable", function() { mc.timer.timerSpeed = 1; }); module.on("motion", function() { if (mc.thePlayer.onGround) { if ((module.settings.onlyonmove.get() && !isMoving()) || (module.settings.nomovestop.get() && !isMoving())) return; mc.thePlayer.jump(); //represents MovementUtils.strafe() var yaw = mc.thePlayer.rotationYaw * Math.PI / 180 //represents Math.rad(deg) mc.thePlayer.motionX = -Math.sin(yaw) * 0.485 mc.thePlayer.motionZ = Math.cos(yaw) * 0.485 } }); module.on("move", function(e) { if (module.settings.nomovestop.get() && !isMoving()) e.zeroXZ() }); }); //represents MovementUtils.isMoving() -> true/false function isMoving() { if (mc.thePlayer.movementInput.moveForward != 0 || mc.thePlayer.movementInput.moveStrafe != 0) return true; }