Solved %player% variables question

  • 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.

KrswtkhrSK

Member
Jan 28, 2017
27
2
1
104
I'm making a script to return the contents of yaml

code_language.skript:
command /yml:
    trigger:
        send "%YML(""stats.%%player%%"", ""joinedDate"", -1)%"

code_language.skript:
Invalid brackets/variables/text in 'stats'
(api\0_yaml.sk, line 25: send "%YML(""stats.%%player%%"", ""joinedDate"", -1)%"')

What should I put in place of %%player%%?

(If you enter a specific player name in %%player%%, it work without problems...)
 
I'm making a script to return the contents of yaml

code_language.skript:
command /yml:
    trigger:
        send "%YML(""stats.%%player%%"", ""joinedDate"", -1)%"

code_language.skript:
Invalid brackets/variables/text in 'stats'
(api\0_yaml.sk, line 25: send "%YML(""stats.%%player%%"", ""joinedDate"", -1)%"')

What should I put in place of %%player%%?

(If you enter a specific player name in %%player%%, it work without problems...)
Try using
code_language.skript:
command /yml:
    trigger:
        send "%YML(""stats.%player%"", ""joinedDate"", -1)%"
 
I'm sure it's a bug on some level but things get really messy when you nest things so deep. You have an expression inside of a string inside of a function call being parsed as a value within a string. Why not just split it onto two lines instead of making something so confusing for the parser? It'd probably look nicer too:
code_language.skript:
set {_yml} to YML("stats.%player%", "joinedDate", -1)
send "%{_yml}%"

There, no need for some nutty looking expression just for the sake of doing it in one line.
 
I'm sure it's a bug on some level but things get really messy when you nest things so deep. You have an expression inside of a string inside of a function call being parsed as a value within a string. Why not just split it onto two lines instead of making something so confusing for the parser? It'd probably look nicer too:
code_language.skript:
set {_yml} to YML("stats.%player%", "joinedDate", -1)
send "%{_yml}%"

There, no need for some nutty looking expression just for the sake of doing it in one line.
Thanks dude!
When I encounter a bug in the future, I will think about expressing it in another way.
 
Status
Not open for further replies.