[SOLVED] skript-db output problem

Discussion in 'Skript' started by Taube, Jun 20, 2021.

  1. Hey,
    the connection to my database works perfectly, I can insert and create tables. But if I want to output data I always get this error/warn and nothing happens:

    Code (Text):

    [17:29:35 WARN]: [skript-db] Task #5377 for skript-db v1.3.1 generated an exception
    java.lang.NullPointerException: null at
    java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011) ~[?:1.8.0_211] at
    java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1006) ~[?:1.8.0_211] at ch.njol.skript.variables.Variables.setLocalVariables(Variables.java:275) ~[?:?] at com.btk5h.skriptdb.skript.EffExecuteStatement.lambda$null$4(EffExecuteStatement.java:133) ~
    [?:?] at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~
    [patched_1.16.5.jar:git-Paper-778] at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:468) ~[patched_1.16.5.jar:git-Paper-778] at net.minecraft.server.v1_16_R3.MinecraftServer.b(MinecraftServer.java:1427) ~
    [patched_1.16.5.jar:git-Paper-778] at net.minecraft.server.v1_16_R3.DedicatedServer.b(DedicatedServer.java:436) ~
    [patched_1.16.5.jar:git-Paper-778]at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1342) ~
    [patched_1.16.5.jar:git-Paper-778] at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1130) ~
    [patched_1.16.5.jar:git-Paper-778] at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:291) ~
    [patched_1.16.5.jar:git-Paper-778] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_211] >
     
    I use this Skript:

    Code (Text):

    on script load:
        set {sql} to the database "mysql://{@host}:{@port}/{@database}?user={@user}&password={@password}&useSSL={@usessl}"
        broadcast {sql}
    on join:
        wait 5 seconds
        execute unsafe "SELECT * FROM data WHERE uuid = '%uuid of player%'" on {sql} and store the results in {_output::*}
        if {_output::uuid::1} is not set:
            execute unsafe "INSERT INTO data(uuid, name) VALUES ('%uuid of player%', '%name of player%')" on {sql}
        else:
            execute unsafe "UPDATE data SET name = '%name of player%'" on {sql}
        execute unsafe "SELECT * FROM data WHERE uuid = '%uuid of player%'" on {sql} and store the results in {_output::*}
        broadcast {_output::uuid::1}
        broadcast {_output::name::1}
     
    Pleazze help me, thanks!
     
  2. And even this doesn't work:

    Code (Text):

    command /uuid:
        trigger:
            broadcast uuid of player
            execute unsafe "select * from data where uuid = '%uuid of player%'" in {sql} and store the result in {_output::*}
            broadcast {_output::uuid::1}
            broadcast {_output::name::1}
     
     
  3. Answer:

    The problem was the skript version. Skript 2.6 doesn't work, you have to use Skipt 2.5.3 otherwise the addon isn't supportet.
     
  4. I will add skript 2.6 support once I finish updating my server stuff from 1.12.2 to 1.16.5