Skip to content

Bring variables into options #1140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Padlick opened this issue Mar 5, 2018 · 3 comments
Closed

Bring variables into options #1140

Padlick opened this issue Mar 5, 2018 · 3 comments

Comments

@Padlick
Copy link

Padlick commented Mar 5, 2018

Hey. It would be very nice if something like this

options:
>test.1: 20
>test.2: 40
command /test <number>:
>trigger:
>>message "{@test.%arg%}"

is going to work in the future. Because when I try my code there is this error:
"undefined option {@test.%arg%}"

It should, if I type 1 as a argument, print the data of the option test.1 out..``

@TheBentoBox TheBentoBox added priority: low Issues that are not harmful to the experience but are related to useful changes or additions. feature Pull request adding a new feature. enhancement Feature request, an issue about something that could be improved, or a PR improving something. and removed feature Pull request adding a new feature. labels Mar 5, 2018
@Nicofisi
Copy link
Member

Nicofisi commented Mar 5, 2018

Hmmm, I wrote this and then realised this issue is about the other thing, variables in option names not options in variable names, just leaving it here in case someone misunderstands too lol

>sk reload test
[19:52:31 INFO]: [Skript] Reloading test.sk...
[19:52:31 INFO]: [Skript] Successfully reloaded test.sk.
options:
  test.1: 20
  test.2: 40
command /test <number>:
  trigger:
    message "{{@test.1}.%arg%}"

@Nicofisi
Copy link
Member

Nicofisi commented Mar 5, 2018

To be fair I don't think it has a big chance of getting implemented, it would be easy to confuse with the syntax above IMO and not very popular probably, but who knows ;)

@bensku bensku added wontfix and removed enhancement Feature request, an issue about something that could be improved, or a PR improving something. priority: low Issues that are not harmful to the experience but are related to useful changes or additions. labels Mar 5, 2018
@bensku
Copy link
Member

bensku commented Mar 5, 2018

It is intended that options are replaced before script is parsed. This allows you to for example

options:
    foo: broadcast "Foo"

on right click:
    {@foo} # Executes broadcast "Foo"

If you need variables, use variables, not options. In case current variables block in scripts is not good enough, it would be better to improve that instead of touching options.

@bensku bensku closed this as completed Mar 5, 2018
@TPGamesNL TPGamesNL mentioned this issue Jun 6, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants