Solved Different variables are seemingly the same

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.
Jan 19, 2018
18
1
3
Skript Version: 2.6.1
Skript Authors: Njol, Mirreski, SkriptLang Team and Contributors
Minecraft Version: 1.16.5 (Paper version git-Paper-794)

Full Code:
Code:
# set a and b
set {a} to "00000000110101101010101011010110100000101101011010000010101110101010101010101010101110101000001011010110100000101000001010000010"
set {b} to "00000000000000000000000000110000001100000011000000110000001100000011000000110000000000000011000000110000000000000000000000000000"
# confirm that a != b
broadcast "%true if {a} = {b} else false%"
# list vars
set {var::%{a}%::*} to 1, 2, 3
set {var::%{b}%::*} to 4, 5, 6
# now why is {var::%{a}%::*} = 4, 5, 6 ?
broadcast "a: %{var::%{a}%::*}%"
broadcast "b: %{var::%{b}%::*}%"
# (presumably because they are the same variable, but that can't be!)

Code output:
upload_2022-4-13_18-28-21.png


Expected output:
Code:
a: 1, 2, 3
b: 4, 5, 6

(No errors, no addon syntax used)
 
Skript Version: 2.6.1
Skript Authors: Njol, Mirreski, SkriptLang Team and Contributors
Minecraft Version: 1.16.5 (Paper version git-Paper-794)

Full Code:
Code:
# set a and b
set {a} to "00000000110101101010101011010110100000101101011010000010101110101010101010101010101110101000001011010110100000101000001010000010"
set {b} to "00000000000000000000000000110000001100000011000000110000001100000011000000110000000000000011000000110000000000000000000000000000"
# confirm that a != b
broadcast "%true if {a} = {b} else false%"
# list vars
set {var::%{a}%::*} to 1, 2, 3
set {var::%{b}%::*} to 4, 5, 6
# now why is {var::%{a}%::*} = 4, 5, 6 ?
broadcast "a: %{var::%{a}%::*}%"
broadcast "b: %{var::%{b}%::*}%"
# (presumably because they are the same variable, but that can't be!)

Code output:
View attachment 6798

Expected output:
Code:
a: 1, 2, 3
b: 4, 5, 6

(No errors, no addon syntax used)
Try {var %{a}%::*} and {var %{b}%::*} to see if the problem is the variable
[doublepost=1649944957,1649944918][/doublepost]
Try {var %{a}%::*} and {var %{b}%::*} to see if the problem is the variable
You can also try {var::%{a}%}
 
I managed to fix this, although not sure about exactly what is happening with the {a} and {b} indexes.
I tried this with long strings of other characters (like UUIDs), and they seemed to work, so the problem is that the index contains a very large number. The fix was splitting up the numbers with some character, such as putting a hyphen "-" every 16 characters in the index.
TL;DR Big indexes are OK, just not numbers.
 
Try {var %{a}%::*} and {var %{b}%::*} to see if the problem is the variable
[doublepost=1649944957,1649944918][/doublepost]
You can also try {var::%{a}%}
I dint know that
 
Status
Not open for further replies.