hi I need help
-
@chocopiexd said in hi I need help:
So im trying to send a packet in scriptapi without triggering the packet event, but seems like there's no function to do this. Anyway to do this?
why
-
@czechhek said in hi I need help:
@chocopiexd sendPacket() with Core
is there any other way cuz I don't really like using core
-
@chocopiexd L
as if core wasn't open src
-
@czechhek said in hi I need help:
@chocopiexd L
as if core wasn't open src
I guess skidding is the only way
-
@chocopiexd you can try to "mark" the packet
example:
NoEvent=true;
Send some Packets
NoEvent=false;
on Packet event
if (NoEvent) return; -
@chocopiexd mc.thePlayer.sendQueue.addToSendQueue(epic packet);
-
@skiddermaster412 said in hi I need help:
@chocopiexd mc.thePlayer.sendQueue.addToSendQueue(epic packet);
this triggers packet event
-
@chocopiexd so you are trying to send a packet in packet event?
idk if this worksfunction sendPacket(packet) { var Class = Java.type("java.lang.Class"); Object.defineProperty(Array.prototype, "find", { value: function (func, returnIndex) { for (i in this) if (func(this[i], i, this)) return returnIndex ? +i : this[i]; return returnIndex ? -1 : null; } }); function getMethod(clazz, methodName) ((_method = Java.from((clazz instanceof Class ? clazz : clazz.class).getDeclaredMethods()).find(function (m) m.getName() == methodName)) && _method.setAccessible(true), _method); function getField(clazz, fieldName) ((_field = getFields(clazz instanceof Class ? clazz : clazz.class).find(function (f) f.getName() == fieldName)) && _field.setAccessible(true), _field); function getFields(clazz) {_fields = Java.from((clazz = clazz instanceof Class ? clazz : clazz.class).getDeclaredFields());while (clazz = clazz.superclass) _fields = _fields.concat(Java.from(clazz.getDeclaredFields()));return _fields;} var networkManager = mc.getNetHandler().getNetworkManager(); var flushOutboundQueueMethod = getMethod(NetworkManager, "func_150733_h") var dispatchPacketMethod = getMethod(NetworkManager, "func_150732_b"); var readWriteLockField = getField(NetworkManager, "field_181680_j"); var outboundPacketsQueueField = getField(NetworkManager, "field_150745_j"); if (networkManager.isChannelOpen()) { flushOutboundQueueMethod.invoke(networkManager); dispatchPacketMethod.invoke(networkManager, packet, null); } else { readWriteLockField.get(networkManager).writeLock().lock(); try { outboundPackets = outboundPacketsQueueField.get(networkManager); outboundPackets.add(new NetworkManager.InboundHandlerTuplePacketListener(packet, null)); outboundPacketsQueueField.set(networkManager, _outboundPackets); } finally { readWriteLockField.get(networkManager).writeLock().unlock(); } } }
skidded from core
-
@skiddermaster412 said in hi I need help:
@chocopiexd so you are trying to send a packet in packet event?
idk if this worksfunction sendPacket(packet) { var Class = Java.type("java.lang.Class"); Object.defineProperty(Array.prototype, "find", { value: function (func, returnIndex) { for (i in this) if (func(this[i], i, this)) return returnIndex ? +i : this[i]; return returnIndex ? -1 : null; } }); function getMethod(clazz, methodName) ((_method = Java.from((clazz instanceof Class ? clazz : clazz.class).getDeclaredMethods()).find(function (m) m.getName() == methodName)) && _method.setAccessible(true), _method); function getField(clazz, fieldName) ((_field = getFields(clazz instanceof Class ? clazz : clazz.class).find(function (f) f.getName() == fieldName)) && _field.setAccessible(true), _field); function getFields(clazz) {_fields = Java.from((clazz = clazz instanceof Class ? clazz : clazz.class).getDeclaredFields());while (clazz = clazz.superclass) _fields = _fields.concat(Java.from(clazz.getDeclaredFields()));return _fields;} var networkManager = mc.getNetHandler().getNetworkManager(); var flushOutboundQueueMethod = getMethod(NetworkManager, "func_150733_h") var dispatchPacketMethod = getMethod(NetworkManager, "func_150732_b"); var readWriteLockField = getField(NetworkManager, "field_181680_j"); var outboundPacketsQueueField = getField(NetworkManager, "field_150745_j"); if (networkManager.isChannelOpen()) { flushOutboundQueueMethod.invoke(networkManager); dispatchPacketMethod.invoke(networkManager, packet, null); } else { readWriteLockField.get(networkManager).writeLock().lock(); try { outboundPackets = outboundPacketsQueueField.get(networkManager); outboundPackets.add(new NetworkManager.InboundHandlerTuplePacketListener(packet, null)); outboundPacketsQueueField.set(networkManager, _outboundPackets); } finally { readWriteLockField.get(networkManager).writeLock().unlock(); } } }
skidded from core
probably it should work since it's skidded from core