Skip to content
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

Local variables cannot be used #12

Open
TrademarkTM opened this issue Jan 9, 2019 · 5 comments
Open

Local variables cannot be used #12

TrademarkTM opened this issue Jan 9, 2019 · 5 comments

Comments

@TrademarkTM
Copy link

SkriptLang/Skript@048ce29
SkriptLang/Skript@237b3dd

This is the same bug report I did in skript-mirror.
The variables are now deleted in asynceffects, so you're unable to use them in skript-db.

@andrei923
Copy link

still persists

function test(p: player):
    set {_uuid} to uuid of {_p}
    execute unsafe "select * from test WHERE uuid = '%{_uuid}%'" in {test} and store the result in {_output::*}
    broadcast "%{_uuid}%"

command test:
    trigger:
        test(player)

skript 2.4-alpha4
skript-db-0.2.1

@Diamax10
Copy link

Use custom syntax of skript-mirror instead of Skript function, like:

function sayPlayerExperience(p: player):
  set {_uuid} to UUID of {_p}
  execute "SELECT * FROM players WHERE uuid = %{_uuid}%" in {sql} and store the result in {_databasePlayer::*}
  broadcast "1: %{_databasePlayer::experience::1}%"

effect say %player% experience:
  trigger:
    execute "SELECT * FROM players WHERE uuid = %UUID of expression-1%" in {sql} and store the result in {_databasePlayer::*}
    broadcast "2: %{_databasePlayer::experience::1}%"

command /testEffect:
  trigger:
    sayPlayerExperience(player) #1: <none>
    say player experience #2: 140 <-- example

@ghost
Copy link

ghost commented Dec 7, 2019

Skript-mirror syntax doesn't solve the problem.
Both of your exemples are working.
The problem is not to display the query's result but to use the other local variables after the query.

@bloggy
Copy link

bloggy commented Nov 24, 2020

I still hope for a fix ... it would help so much

I was using 0.1.1 on 1.15.2 and local variables worked fine.
But when updating to 1.16.4 this version won't work anymore. So you have to use the latest 0.2.1 version which will disable the use of local variables

@juradev
Copy link

juradev commented Nov 24, 2020

But you can try this fork which seems to work: https://github.com/Govindass/skript-db/releases/tag/1.2.0

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

5 participants