@asd-dsa
hmm actually in some cases (when the arrow is heading to the player's head/foot) it has a big possibility of not triggering it (should be able to fix it by checking intersection between 2 bbox).
Iirc it should have a horizontal speed mode, but it is annoying to lock the view.
The code is spaghetti, but I would try to improve it when I have time. (Probably in a few days)
commandblock2
Posts
-
[Request] Arrow avoidance script (like Enderman) -
[Request] Arrow avoidance script (like Enderman)@asd-dsa
Yes but the challenging part is to make it theblink
way. This is definitely fine and good work.blink
teleport is kind of holding the movement packets and sending them in a instant, but the currentsetPosition
is more like the clip thing (some ac may flag you for speed).
If you want to have it this way you might have to calculate the positions of the position packets in advance (and probably lower the timer(< 1) after dodging the arrow in case the ac flags you for timer).btw we can make the tp direction perpendicular to the velocity of the incoming arrow, and see left/right is closer. (This would be easier than
blink
and already inhorizontalSpeed
mode). Alsoleft
/right
variable in that part might not be reallyleft
/right
, it could be opposite.Anyway the scripts was originally for trolling only, never thought someone would need it but I am happy to see someone actually used it.
Also +1 for the effort. -
[Request] Arrow avoidance script (like Enderman)@asd-dsa
I see, the version you used is the cross version. The script was designed for none cross version 1.8. Quite surprising it was still working with other mode. If you want to use that you might need to have extra modification since the cross version has some changes in scriptAPI.
Edit: But according to this exception, it seemed to be the one in render3D which should cause the whole script (anymode and the prediction) to break
Edit: nvm I was dumb this exception shouldn't affect might be other exception -
[Request] Arrow avoidance script (like Enderman)@asd-dsa
it doesn't sound like some problem with your version, I think it's very much probably my fault. Will later look into it -
BlockBBEvent in scripts?@idk-my-name
Indeed there is noonBlockBB
provided.
Before this someone showed me the matrix fly (rewinside + jump, patched) made by aftery in scriptapi(obf), it would be almost impossible to implement without blockBB. I didn't figure out back then
It took me a long time to finally figured out a way to subscribe to arbitrary event in scriptAPI with reflection andJava.extend
.
Hint:Java.extend(Listenable, Consumer, { handleEvents: function() { return true}, accept: function(e) { } })
and this.
-
How to tell a module is on or off?@chodeman
What I have been trying to do is to changeScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight, this.framebufferMc)
to js.
Since it is in
net/minecraft/client/Minecraft.java
, the type ofthis
isMinecraft
(akanet.minecraft.client.Minecraft
). And the instance ofMinecraft
is exposed asmc
in scriptAPI.
So we change allthis
tomc
.
ButframebufferMc
is not public so you cannot access it from a script.
So we accessing a private variable using reflection.
However the name offramebufferMc
is notframebufferMc
.
See about obfuscation.
You will have to use the Searge name(field_147124_at
) to access variable and functions.
The filemcp-stable_22.srg
have the mappings from MCP name to Searge name.
The reason you can use MCP name to in normal scriptAPI is because they did this.But with Core.lib you don't have to do that anymore.
@CzechHek
THANK YOU BASED HEK. Don't have to look for srg name anymore.
And that should even solved the problem of using script in development environment, going to try it later. -
[Request] Arrow avoidance script (like Enderman)@asd-dsa
quite weird, works on my machine. But usually in this case you can look into the logs to see if the script is spamming exception. The log should be at .minecraft/logs/latest.log
Idk if it only works on my build.
Edit: the snippet I posted in the last post was only to tell you what the new code is for, still recommended to pull the full script from github. This what has been changed actually. -
BlockBBEvent in scripts?@idk-my-name
WhatJava.extend()
returns is something that behaves like a type (Forgot what it really is, probably a JSAdaptor or something).
Similar to what you will get from usingJava.type()
.ArrayList = Java.type("java.util.ArrayList") arrayList = new ArrayList()
BBConsumer = Java.extend(Listenable, Consumer, { handleEvents: function() { return true}, accept: function(e) { // onBlockBB here } }) consumer = new BBConsumer() registerListener(consumer) // not registerListener(BBConsumer) /* I am sure there would be a better name for BBConsumer And if you want to use it like a anonymous class in Java you could just read the BlockAnimations.js or better, nashorn document https://github.com/CzechHek/Core/blob/879f36d7e41ccc7868285b0a808866b360f30822/Scripts/BlockAnimations.js#L35 */
Not sure if the type from
Java.extend
would have other unexpected methods that only takes 1 parameters, you might want to check if the parameter's super class isEvent
.Or you could just explicitly specify the
accept
method in it.
method = consumer.class.getMethod("accept", java.lang.Object.class)
Edit:
Nvm, I forgot that this was scriptAPI, theConsumer
here is aConsumer<?>
, notConsumer<BlockBBEvent>
which means theaccepct()
takes anjava.lang.Object
, and it will register a Listener that listens to any event that is anjava.lang.Object
, which probably means all events.'Here is what I did
registry = getField(LiquidBounce.eventManager, "registry").get(LiquidBounce.eventManager) BBs = registry.getOrDefault(BlockBBEvent.class, new ArrayList()) BBs.add(new EventHook(consumer, consumer.class.getMethod("accept", java.lang.Object.class), LiquidBounce.moduleManager.class .getDeclaredMethod("onKey", KeyEvent.class) .getAnnotation(EventTarget.class))) registry[BlockBBEvent.class] = BBs
-
mc.thePlayer is undefined@cancernameu
Here on my machinemc.thePlayer EntityPlayerSP['commandblock2'/100, l='MpServer', x=539.17, y=4.00, z=-585.11]
If you want to get the class of
mc.thePlayer
mc.thePlayer.class class net.minecraft.client.entity.EntityPlayerSP mc.thePlayer.class.getSimpleName() EntityPlayerSP mc.thePlayer.class.getSimpleName() == "EntityPlayerSP" true typeof mc.thePlayer object
That's probably what you want
EntityPlayerSP = Java.type("net.minecraft.client.entity.EntityPlayerSP") [JavaClass net.minecraft.client.entity.EntityPlayerSP] mc.thePlayer instanceof EntityPlayerSP true
instanceof
can be used for java types, this is basically a nashorn thing.
https://www.oracle.com/technical-resources/articles/java/jf14-nashorn.html -
[Help]TeleportAura.ktThis is commandblock2
22infiniteaura or rechaura.kt
I want to use it But Iwon't use java to kotlinwant to rewrite this crap and port to cross_version (also 1 more feature to phase through wall)
Who can help meconvert this KT file-_-refactor it
[InfiniteAura or reachaura]https://wws.lanzous.com/iOk2wgm9l4h
InfiniteAura or reachaura
Hey ↑ LinkxDDDDDDDD
Jokes aside, I do plan to rewrite this when I have time, but won't rewrite in js. However there are some problems.
- the code is completely shit
- I want to add a customizable pathfinding thing, not only for reachaura, but also for scripting, and the rule of pathfinding could be customized (for example ground only or fly or phase-able ),
- improve the packet counter option. (simply adjust cps when sending too much)
-
[Request] Arrow avoidance script (like Enderman)@asd-dsa
now the script is updated with horizontaltp and horizontalmotion. The direction is perpendicular to arrow trajectory.But there is not yet a check for tp into blocks, and still sometimes you could get shot. Might just going to look into
FallingPlayer
/Projectiles
for reference.Edit: hmm the it should be same as Projectiles but still strange, maybe later then.
the related code is here, but that is spaghetti anyway. you might want to give time the sin/cos since I think it might be a bit long.
if (dodgeMode.get() == "HorizontalTp") { mc.thePlayer.setPosition(mc.thePlayer.posX + Math.sin(Math.toRadians(rot.yaw)), mc.thePlayer.posY, mc.thePlayer.posZ + Math.cos(Math.toRadians(rot.yaw))) dodging = null return } if (dodgeMode.get() == "HorizontalMotion") { mc.thePlayer.motionX = Math.sin(Math.toRadians(rot.yaw)) // * 0.5 // or something like that mc.thePlayer.motionZ = Math.cos(Math.toRadians(rot.yaw)) dodging = null return }
-
BlockBBEvent in scripts?@idk-my-name
Indeed something like that.val eventClass = method.parameterTypes[0] as Class<out Event> val eventTarget = method.getAnnotation(EventTarget::class.java)
Unfortunately, nashorn/reflection does not have any capability of adding annotations.
method.getAnnotation(EventTarget::class.java)
and we will have to make our ownregisterListener()
.The 3 lines actually does the work is here.
val invokableEventTargets = registry.getOrDefault(eventClass, ArrayList()) invokableEventTargets.add(EventHook(listener, method, eventTarget)) registry[eventClass] = invokableEventTargets
You only need to convert this 3 line to js and it would be fine.
Note the second line
EventHook(listener, method, eventTarget)
thelistener
is just the listener,
themethod
isaccept
acquired using reflection
but for theeventTarget
, I borrowed it with reflection from a function in other class thatextends Listener
already presented in LB.As for the performance issue, it's true, in my case, putting a print every time it is called makes the frame rate goes from 80(limited) to less than 1.
-
Help writing a custom prison mining scriptA way to path find from /mine to the mining location
This could be a bit much work to do. U might have to write a path finding algorithm like A*. However I do have a A* in my
reachaura
branch. Could be hell if u try to write it in js.A 'legit' mining mode (I know how to activate modules via script so I might just use nuker)
Look for
RotationUtils.faceBlock
method inNuker.kt
in LB's src (cross_version
here), it would be a bit different with/withoutcross_version
.Check if inventory is full
Maybe look at the inventory related module of LB and Hek's InventoryManger. Shouldn't be as hard as A*.
Interact/Right Click NPC
There is a packet for that and u can find the usage in
KillAura.kt
.Text related operation
https://github.com/CzechHek/Core/blob/master/Scripts/Deprecated/BasicLogin.js
-
[Help]TeleportAura.kt@yorik100 The phase that works smoothly (no S08) in vanilla is the mineplex mode. I now see how that works.
-
is it possible to use c++ as scripting language in liquidbounce?@idk-my-name Possible, but not doable. Use JNI, but too much work. Also itunes is botnet.
-
How to tell a module is on or off?@commandblock2
do this.minecraft/LiquidBounce-1.8 $ grep framebufferMc mcp-stable_22.srg FD: net/minecraft/client/Minecraft/framebufferMc net/minecraft/client/Minecraft/field_147124_at
and get
field_147124_at
.
then you have thisScreenShotHelper = Java.type("net.minecraft.util.ScreenShotHelper") function screenShot() { framebufferMcField = mc.class.getDeclaredField("field_147124_at") framebufferMcField.setAccessible(true) framebufferMc = framebufferMcField.get(mc) //with Core.lib you only need 1 line //framebufferMc = getField(mc, "field_147124_at").get(mc) ScreenShotHelper.saveScreenshot(mc.mcDataDir, mc.displayWidth, mc.displayHeight, framebufferMc); }
-
Help writing a custom prison mining script@paranoid_bres Indeed there is a builtin pathfinding for minecraft (
net.minecraft.pathfinding
), but it seemed that it only has the behavior for Climber/Ground/Swimmer things, mining might require a different one which can navigate through stones. But you do remind me that you can just inherit thenet.minecraft.pathfinding.PathNavigate
and might be less work. Btw it is generally recommended to have a copy of mcp or dogradlew setupDecompWorkspace
in LB's repo and attach the src to the project.
Edit: I didn't know it runs into blocks -
[Help]TeleportAura.kt@yorik100 is it able to phase through multiple blocks in one go or just better implementation?
-
How to tell a module is on or off?@ohno Or you use a dirty reflection.
-
How to tell a module is on or off?LiquidBounce/1.8.9-Forge/build/tmp/recompileMc/sources/net $ grep screenshot . -ir ... ./minecraft/client/Minecraft.java:import net.minecraft.util.ScreenShotHelper; ./minecraft/client/Minecraft.java: else if (i == this.gameSettings.keyBindScreenshot.getKeyCode()) ./minecraft/client/Minecraft.java: this.ingameGUI.getChatGUI().printChatMessage(ScreenShotHelper.saveScreenshot(this.mcDataDir, this.displayWidth, this.displayHeight, this.framebufferMc)); ...
beware that
this.framebufferMc
could be a private member.