[Script] Cool AutoGapple [Core]
-
This script is nice on servers that allow instanteat like Redesky
Credits to commandblock2, A Former User and LoLMC
This script requires Core.lib//Copyright 2020 commandblock2 distributed under AGPL-3.0-or-later Potion = Java.type('net.minecraft.potion.Potion') var LiquidBounce = Java.type("net.ccbluex.liquidbounce.LiquidBounce"); var KillAura = Java.type("net.ccbluex.liquidbounce.features.module.modules.combat.KillAura"); var killAuraModule = moduleManager.getModule("KillAura"); var MSTimer = Java.type('net.ccbluex.liquidbounce.utils.timer.MSTimer'); var timer = new MSTimer(), Potion = Java.type('net.minecraft.potion.Potion'); module = { name: "AutoGappleV2", description: "Eat gapple when your health is low", author: "Lolmc", category: "Player", values: [ health = value.createFloat("Health", 10, 1, 20), itemswitchdelay = value.createInteger("Delay", 100, 0, 1000), regencheck = value.createBoolean("RegenCheck", false), absorptioncheck = value.createBoolean("AbsorptionCheck", false), chestcheck = value.createBoolean("ChestCheck", false), inventorycheck = value.createBoolean("InventoryCheck", false), changeonetick = value.createBoolean("ChangeOneTick", false) ], onEnable: function () { isChanging = gAppleIndex = null; changeTicks = 0; }, onUpdate: function () { if (changeTicks > 0) changeTicks++; if (isChanging && changeTicks > 3) { isChanging = !!(changeTicks = 0); mc.thePlayer.sendQueue.addToSendQueue(new C08PacketPlayerBlockPlacement(BlockPos.ORIGIN, 255, mc.thePlayer.inventory.mainInventory[gAppleIndex - 36], 0, 0, 0)); for (i = -1; ++i < 32;) mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer(mc.thePlayer.onGround)); if (mc.thePlayer.inventory.currentItem != gAppleIndex) mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem)); if (KillAuraModule.blockingStatus || mc.thePlayer.isBlocking()) mc.thePlayer.sendQueue.addToSendQueue(new C08PacketPlayerBlockPlacement(BlockPos.ORIGIN, 255, mc.thePlayer.inventory.getCurrentItem(), 0, 0, 0)); } if (mc.thePlayer.getHealth() > 0 && mc.thePlayer.getHealth() <= health.get()) { gAppleIndex = InventoryUtils.findItem(36, 45, Items.golden_apple) gAppleIndex = gAppleIndex == -1 ? InventoryUtils.findItem(9, 36, Items.golden_apple) : gAppleIndex if (~gAppleIndex && (gAppleIndex - 36 | 44 - gAppleIndex) >= 0 && timer.hasTimePassed(itemswitchdelay.get()) && (!(mc.currentScreen instanceof GuiChest) || !chestcheck.get()) && (!(mc.currentScreen instanceof GuiInventory) || !inventorycheck.get()) && (mc.thePlayer.getAbsorptionAmount() <= 0 || !absorptioncheck.get()) && (!mc.thePlayer.isPotionActive(Potion.regeneration) || !regencheck.get())) { if (mc.thePlayer.inventory.currentItem != gAppleIndex) mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(gAppleIndex - 36)); if (!changeonetick.get()) { mc.thePlayer.sendQueue.addToSendQueue(new C08PacketPlayerBlockPlacement(BlockPos.ORIGIN, 255, mc.thePlayer.inventory.mainInventory[gAppleIndex - 36], 0, 0, 0)); for (i = -1; ++i < 32;) mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer(mc.thePlayer.onGround)); if (mc.thePlayer.inventory.currentItem != gAppleIndex && !changeonetick.get()) mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem)); if (KillAuraModule.blockingStatus || mc.thePlayer.isBlocking()) mc.thePlayer.sendQueue.addToSendQueue(new C08PacketPlayerBlockPlacement(BlockPos.ORIGIN, 255, mc.thePlayer.inventory.getCurrentItem(), 0, 0, 0)); } else isChanging = !!(changeTicks = 1); timer.reset(); } else if ((gAppleIndex - 9 | 35 - gAppleIndex) >= 0 && InventoryUtils.hasSpaceHotbar()) { if (!(mc.currentScreen instanceof GuiInventory)) mc.thePlayer.sendQueue.addToSendQueue(new C16PacketClientStatus(C16PacketClientStatus.EnumState.OPEN_INVENTORY_ACHIEVEMENT)); mc.playerController.windowClick(0, gAppleIndex, 0, 1, mc.thePlayer); if (!(mc.currentScreen instanceof GuiInventory)) mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow()); } } }, onPacket: function (e) { if (isChanging && e.getPacket() instanceof C09PacketHeldItemChange) e.cancelEvent(); }, onDisable: function () { if (isChanging) { isChanging = false; mc.thePlayer.sendQueue.addToSendQueue(new C08PacketPlayerBlockPlacement(BlockPos.ORIGIN, 255, mc.thePlayer.inventory.mainInventory[gAppleIndex - 36], 0, 0, 0)); for (i = -1; ++i < 32;) mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer(mc.thePlayer.onGround)); if (mc.thePlayer.inventory.currentItem != gAppleIndex) mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(mc.thePlayer.inventory.currentItem)); if (KillAuraModule.blockingStatus || mc.thePlayer.isBlocking()) mc.thePlayer.sendQueue.addToSendQueue(new C08PacketPlayerBlockPlacement(BlockPos.ORIGIN, 255, mc.thePlayer.inventory.getCurrentItem(), 0, 0, 0)); } } } script.import("Core.lib")
-
@czechhek said in [Script] Cool AutoGapple:
Here's a normal AutoGapple based on this, on ScriptAPI v2 I guess:
https://github.com/commandblock2/scripts/blob/master/combat/AutoGapple.jsImagine changing inventory slots, the delay is broken too
-
silent sex (allows you to sex without showing your penis!!)
-
@yorik100 This code is messy as hell. Fixed it and added it onto Core github. It has autoupdates now, feel free to update it there.
https://github.com/CzechHek/Core/commit/bf601022a7939cd3b37842b940d23d86e679440b
(shouldn't mess with this version since it doesn't have V2 in the name)
-
@czechhek said in [Script] Cool AutoGapple [Core]:
@yorik100 This code is messy as hell. Fixed it and added it onto Core github. It has autoupdates now, feel free to update it there.
https://github.com/CzechHek/Core/commit/bf601022a7939cd3b37842b940d23d86e679440b
(shouldn't mess with this version since it doesn't have V2 in the name)
"print(i)"
-
convert to java when
-
@czechhek said in [Script] Cool AutoGapple [Core]:
@yorik100 This code is messy as hell. Fixed it and added it onto Core github. It has autoupdates now, feel free to update it there.
https://github.com/CzechHek/Core/commit/bf601022a7939cd3b37842b940d23d86e679440b
(shouldn't mess with this version since it doesn't have V2 in the name)
It errors ReferenceError: "value" is not defined in <eval> at line number 14
Edit : Found the issue, scriptAPI v2 fucking sucks dicks
Edit 2 : Ye, everything is broken, even when porting what you did to real ScriptAPI, it still doesn't work properly at all
Edit 3 : Fixed everything -
@czechhek said in [Script] Cool AutoGapple [Core]:
@yorik100 No, I've tested it before putting it onto Github.
Ye it was my bad XD, now everything is fixed and I made a pull request, the version that is on your github doesn't load just like every scriptapi v2 Core scripts (my LB version supports v2 and I downloaded the latest Core.lib)
-
@czechhek said in [Script] Cool AutoGapple [Core]:
@yorik100 wdym, script api v2 works normally and there are many people using Core scripts, no reported problems
legacy script api is pointless since it converts itself into api v2 anyway
ReferenceError: "value" is not defined in <eval> at line number 14
ReferenceError: "value" is not defined in <eval> at line number 14
ReferenceError: "value" is not defined in <eval> at line number 14
ReferenceError: "value" is not defined in <eval> at line number 14
ReferenceError: "value" is not defined in <eval> at line number 14
ReferenceError: "value" is not defined in <eval> at line number 14
ReferenceError: "value" is not defined in <eval> at line number 14
ReferenceError: "value" is not defined in <eval> at line number 14
ReferenceError: "value" is not defined in <eval> at line number 14
ReferenceError: "value" is not defined in <eval> at line number 14
ReferenceError: "value" is not defined in <eval> at line number 14
ReferenceError: "value" is not defined in <eval> at line number 14 -
@czechhek said in [Script] Cool AutoGapple [Core]:
@yorik100 Cannot fix something that isn't broken.
[15:43:01] [Client thread/ERROR] [LiquidBounce/]: [ScriptAPI] Failed to load script 'AutoGapple.js'.
javax.script.ScriptException: ReferenceError: "value" is not defined in <eval> at line number 14
at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException(NashornScriptEngine.java:470) ~[NashornScriptEngine.class:?]
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:454) ~[NashornScriptEngine.class:?]
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:406) ~[NashornScriptEngine.class:?]
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptEngine.java:402) ~[NashornScriptEngine.class:?]
at jdk.nashorn.api.scripting.NashornScriptEngine.eval(NashornScriptEngine.java:155) ~[NashornScriptEngine.class:?]
at javax.script.AbstractScriptEngine.eval(Unknown Source) ~[?:1.8.0_271]
at net.ccbluex.liquidbounce.script.Script.<init>(Script.kt:56) ~[Script.class:?]
at net.ccbluex.liquidbounce.script.ScriptManager.loadScript(ScriptManager.kt:42) [ScriptManager.class:?]
at net.ccbluex.liquidbounce.script.ScriptManager.loadScripts(ScriptManager.kt:27) [ScriptManager.class:?]
at net.ccbluex.liquidbounce.LiquidBounce.startClient(LiquidBounce.kt:107) [LiquidBounce.class:?]
at net.minecraft.client.Minecraft.handler$startGame$zzf000(Minecraft.java:3178) [ave.class:?]
at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:496) [ave.class:?]
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:329) [ave.class:?]
at net.minecraft.client.main.Main.main(SourceFile:124) [Main.class:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_271]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_271]
at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196) [NewLaunch.jar:?]
at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231) [NewLaunch.jar:?]
at org.multimc.EntryPoint.listen(EntryPoint.java:143) [NewLaunch.jar:?]
at org.multimc.EntryPoint.main(EntryPoint.java:34) [NewLaunch.jar:?] -
Uncool AutoGapple