Navigation

    CCBlueX Forum

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    hi I need help

    ScriptAPI
    5
    12
    135
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ?
      A Former User last edited by

      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?

      CzechHek Q skiddermaster412 3 Replies Last reply Reply Quote 1
      • CzechHek
        CzechHek @Guest last edited by

        @chocopiexd sendPacket() with Core

        ? 1 Reply Last reply Reply Quote 1
        • Q
          quadro @Guest last edited by

          @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

          1 Reply Last reply Reply Quote 1
          • ?
            A Former User @CzechHek last edited by

            @czechhek said in hi I need help:

            @chocopiexd sendPacket() with Core

            is there any other way cuz I don't really like using core

            CzechHek 1 Reply Last reply Reply Quote 1
            • CzechHek
              CzechHek @Guest last edited by CzechHek

              @chocopiexd L

              as if core wasn't open src

              ? 1 Reply Last reply Reply Quote 1
              • Q
                quadro last edited by

                scripts are automatically open source as there are no good public obfuscators

                1 Reply Last reply Reply Quote 2
                • ?
                  A Former User @CzechHek last edited by

                  @czechhek said in hi I need help:

                  @chocopiexd L

                  as if core wasn't open src

                  I guess skidding is the only way

                  1 Reply Last reply Reply Quote 1
                  • C
                    Co丶Dynamic last edited by

                    @chocopiexd you can try to "mark" the packet
                    example:
                    NoEvent=true;
                    Send some Packets
                    NoEvent=false;
                    on Packet event
                    if (NoEvent) return;

                    1 Reply Last reply Reply Quote 1
                    • skiddermaster412
                      skiddermaster412 Banned @Guest last edited by

                      @chocopiexd mc.thePlayer.sendQueue.addToSendQueue(epic packet);

                      ? 1 Reply Last reply Reply Quote 1
                      • ?
                        A Former User @skiddermaster412 last edited by

                        @skiddermaster412 said in hi I need help:

                        @chocopiexd mc.thePlayer.sendQueue.addToSendQueue(epic packet);

                        this triggers packet event

                        skiddermaster412 1 Reply Last reply Reply Quote 1
                        • skiddermaster412
                          skiddermaster412 Banned @Guest last edited by

                          @chocopiexd so you are trying to send a packet in packet event?
                          idk if this works

                          function 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

                          ? 1 Reply Last reply Reply Quote 1
                          • ?
                            A Former User @skiddermaster412 last edited by

                            @skiddermaster412 said in hi I need help:

                            @chocopiexd so you are trying to send a packet in packet event?
                            idk if this works

                            function 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

                            1 Reply Last reply Reply Quote 1
                            • First post
                              Last post