Jump to content

ThatOneTqnk

Member
  • Content Count

    15
  • Joined

  • Last visited

Community Reputation

5 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Looking at the source, the 'where' filter loops anyway, it just is not evident to the Skripter. https://github.com/SkriptLang/Skript/blob/ec1e8d88bcd28f65c5a7613f63c0812332072256/src/main/java/ch/njol/skript/expressions/ExprFilter.java#L89-L109 So there shouldn't be a difference in performance actually. You have to iterate, a server cannot do multiple operations at once.
  2. What?: ThatPacketAddon - Skript Addon that lets you send packets to client. Requires ProtocolLib 4.4.0+. Where?: https://forums.skunity.com/resources/thatpacketaddon.847/ Why?: Packets allow us to interact to directly interact with the minecraft protocol. This used to be on Minehut (not this specific addon, but sending packets). At some point, Minehut did not want outgoing HTTP requests or something, so they removed all of the addons that had that feature: that included MundoSK, since MundoSK had websocket client. Issue was that MundoSK also had the packet functionality, so that was a shame. However, the same author made an addon (quite recently too), ThatPacketAddon, that is strictly for packets. So I do not see a reason for it not to be added unless the addon has other features I am unaware of. Also, we can already LISTEN to incoming and outgoing packets, we just cannot send arbitrary packets to clients.
  3. what is up with double pointers

    1. ThatOneTqnk

      ThatOneTqnk

      Yeah, so for double pointers what I like doing now is referring to an array of strings. It is a good example for double pointers.

      Take this scenario:

      spacer.png

      In that example I have an array of char pointers, since that is what an array of strings is. I simply place the pointers of the char arrays defined in lines 5 and 6, in lines 7 and 8. Notice that I have marked line 9 as a breakpoint so we can take a look at memory whilst in the debugger.

      So conceptually, here's how it should be:

      spacer.png

      Each string is a char array. And when a char array is created, the array is assigned the memory address of the first element. But to create a pointer to that memory address, we have to store that pointer somewhere too. So when those two independent strings were created, it created two char arrays, but also two pointers that contain memory addresses of the first character in each of the words. So, there is a pointer for 'h' in hello and a pointer for 't' in there. But then, we want to create an array of those pointers. So we need to store the memory addresses of those pointers, so we need to create pointers for those pointers. Those are allocated orderly, but since this is an array, we need the memory address of that first pointer.

      So effectively, we have a byte in memory that contains a memory address. At that memory address, are two memory addresses. Those two memory addresses contain memory addresses of the memory address of the first characters.

       

      lemme also try to show it in text

       pointy boi -->  0x012ff85c

                                (pointy boi,        pointy boi)

                                       |                        |

                                       |                        |

                                      V                       V

                              0x012ff850          0x012ff844

                              pointy boi             pointy boi    (NOT NECESSARILY TOGETHER)

                                     |                            |

                                     |                            |

                                    V                           V

                            0x002deb30         0x012ff844

                                'hello'                     'there'         (NOT NECESSARILY TOGETHER)                 

       

      To show this is what happens,  first let's took a look at the values of our locals

      spacer.png

       

      We see that the memory address of `yike` is 0x012ff85c 

      The memory addresses for the char pointers as shown in the image are:

      0x012ff850 (this memory address has the memory address that has the memory address of the first character in 'hello')

      0x012ff844 (this memory address has the memory address that has the memory address of the first character in 'there')

      IT also shows us the memory address for the 'h' in hello and 't' in there

      'h' in hello - 0x002deb30

      't' in there - 0x002deb44

       

      Let's start from the beginning, the double pointer.

      The memory address of that is 0x012ff85c:

      And at that memory address, we see the expected two memory addressesspacer.png

      Those are

      0x012ff850

      0x012ff844

       

      Those two point to the pointers of the first character of their respective words

      So let's yeet 0x012ff850 into the memory window.

      spacer.png

      And so we get 0x002deb30 for the memory address of 'h'

      So if we go to 0x002deb30 we get:

      spacer.png

      And so we have 68 65 6c 6c 6f

      If we convert 68 hex to dec we get:

      spacer.png

      And 104 dec in ASCII is our 'h'!

      spacer.png

       

      We can do the same for 0x012ff844 (pointer to pointer for 't')

      Then we get 0x002deb44 for the memory address of 't'

      spacer.png

      spacer.png

       

      And that's a good example of a practical usage of double pointers

    2. Jorge
  4. I cant seem to get my op to work. I've tried using console and it wont work, if anyone can help me with this please do. Thank You!

     

  5. Bukkit refers to the Bukkit API, how plugins tell the server to do stuff. CraftBukkit and Spigot are the actual modified server software, we are on Spigot 1.14.3
  6. you also may want to consider looking into loops and list variables to save you from hardcoding all of that command /yikes: trigger: open virtual chest inventory with 4 rows named "&6Demo" for player set {_full} to "ABCDEFGHIJKLMNOPQRSTUVWXYZ" set {_len} to length of {_full} set {_start} to 0 loop {_len} times: set {_a} to the first character of {_full} format gui slot {_start} of player with gold block named "&6%{_a}%" to close then execute console command "warp %player% %{_a}%" add 1 to {_start} set {_full} to (subtext of {_full} from characters 2 to (the length of {_full})) format gui slot {_start} of player with emerald block named "&6FREE" to close then execute console command "warp %player% FREE"
  7. https://github.com/Tuke-Nuke/TuSKe/wiki/Documentation#effformatgui
  8. im pro skrrptr function getBestSkrrptr() :: text: return "ThatOneTqnk" :O
  9. Looking at the source, the 'where' filter loops anyway, it just is not evident to the Skripter. https://github.com/SkriptLang/Skript/blob/ec1e8d88bcd28f65c5a7613f63c0812332072256/src/main/java/ch/njol/skript/expressions/ExprFilter.java#L89-L109
×
×
  • Create New...