[Abandoned] json.sk

API [Abandoned] json.sk 2.3

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

So, instead of doing:
and:
I recommend creating a folder and moving json.sk into it. Folders are also loaded in alphabetical order, so I always put json.sk inside a directory called "__lib".


Periods in front of filenames will hide the file on Linux hosts, though. :emoji_stuck_out_tongue:
Didn't even know Skript loaded scripts in folders.
 
I got this error when I tried using this on 1.11.2 server using bensku's fork of the Skript. What could cause this?
code_language.skript:
03.03 14:35:45 [Server] ERROR #!#!
03.03 14:35:45 [Server] ERROR #!#! [Skript] Severe Error:
03.03 14:35:45 [Server] ERROR #!#! Exception occurred in Skript's main command
03.03 14:35:45 [Server] ERROR #!#! Used command: /sk reload json
03.03 14:35:45 [Server] ERROR #!#!
03.03 14:35:45 [Server] ERROR #!#! If you're developing an add-on for Skript this likely means that you have done something wrong.
03.03 14:35:45 [Server] ERROR #!#! If you're a server admin however please go to https://github.com/bensku/Skript/issues/
03.03 14:35:45 [Server] ERROR #!#! and check whether this error has already been reported.
03.03 14:35:45 [Server] ERROR #!#! If not please create a new ticket with a meaningful title, copy & paste this whole error into it (or use paste service),
03.03 14:35:45 [Server] ERROR #!#! and describe what you did before it happened and/or what you think caused the error.
03.03 14:35:45 [Server] ERROR #!#! If you think that it's a trigger that's causing the error please post the trigger as well.
03.03 14:35:45 [Server] ERROR #!#! By following this guide fixing the error should be easy and done fast.
03.03 14:35:45 [Server] ERROR #!#!
03.03 14:35:45 [Server] ERROR #!#! Stack trace:
03.03 14:35:45 [Server] ERROR #!#! java.lang.NullPointerException
03.03 14:35:45 [Server] ERROR #!#!     at ch.njol.skript.lang.function.Functions.clearFunctions(Functions.java:264)
03.03 14:35:45 [Server] ERROR #!#!     at ch.njol.skript.SkriptEventHandler.removeTriggers(SkriptEventHandler.java:255)
03.03 14:35:45 [Server] ERROR #!#!     at ch.njol.skript.ScriptLoader.unloadScript_(ScriptLoader.java:713)
03.03 14:35:45 [Server] ERROR #!#!     at ch.njol.skript.ScriptLoader.unloadScript(ScriptLoader.java:706)
03.03 14:35:45 [Server] ERROR #!#!     at ch.njol.skript.SkriptCommand.onCommand(SkriptCommand.java:165)
03.03 14:35:45 [Server] ERROR #!#!     at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
03.03 14:35:45 [Server] ERROR #!#!     at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141)
03.03 14:35:45 [Server] ERROR #!#!     at org.bukkit.craftbukkit.v1_11_R1.CraftServer.dispatchCommand(CraftServer.java:650)
03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.PlayerConnection.handleCommand(PlayerConnection.java:1344)
03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1179)
03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.java:45)
03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.PacketPlayInChat.a(PacketPlayInChat.java:1)
03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile:13)
03.03 14:35:45 [Server] ERROR #!#!     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
03.03 14:35:45 [Server] ERROR #!#!     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46)
03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:739)
03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:399)
03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:675)
03.03 14:35:45 [Server] ERROR #!#!     at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:574)
03.03 14:35:45 [Server] ERROR #!#!     at java.lang.Thread.run(Thread.java:745)
03.03 14:35:45 [Server] ERROR #!#!
03.03 14:35:45 [Server] ERROR #!#! Version Information:
03.03 14:35:45 [Server] ERROR #!#!   Skript: 2.2-dev24b
03.03 14:35:45 [Server] ERROR #!#!   Bukkit: 1.11.2-R0.1-SNAPSHOT
03.03 14:35:45 [Server] ERROR #!#!   Minecraft: 1.11.2
03.03 14:35:45 [Server] ERROR #!#!   Java: 1.8.0_121 (Java HotSpot(TM) 64-Bit Server VM 25.121-b13)
03.03 14:35:45 [Server] ERROR #!#!   OS: Linux amd64 4.8.13-xxxx-grs-ipv6-64
03.03 14:35:45 [Server] ERROR #!#!
03.03 14:35:45 [Server] ERROR #!#! Running CraftBukkit: false
03.03 14:35:45 [Server] ERROR #!#!
03.03 14:35:45 [Server] ERROR #!#! Current node: null
03.03 14:35:45 [Server] ERROR #!#! Current item: null
03.03 14:35:45 [Server] ERROR #!#!
03.03 14:35:45 [Server] ERROR #!#! Thread: Server thread
03.03 14:35:45 [Server] ERROR #!#!
03.03 14:35:45 [Server] ERROR #!#! End of Error.
03.03 14:35:45 [Server] ERROR #!#!
 
Trying to use json.sk, and I get this error randomly. No idea why it's happening at all.

To reproduce it, what I do is:
  1. Reload `!json.sk` (/sk reload !json.sk) No Errors
  2. Reload skript that uses json.sk (/sk reload chatbot) No Errors
  3. None of the json.sk stuff works
  4. Reload `!json.sk` (/sk reload !json.sk) Errors
eg2ml.png
 
Trying to use json.sk, and I get this error randomly. No idea why it's happening at all.

To reproduce it, what I do is:
  1. Reload `!json.sk` (/sk reload !json.sk) No Errors
  2. Reload skript that uses json.sk (/sk reload chatbot) No Errors
  3. None of the json.sk stuff works
  4. Reload `!json.sk` (/sk reload !json.sk) Errors
eg2ml.png
That isn't a real error, so to say. Skript is just warning you that you're using the json.sk's functions in other scripts. It's also notifying you that Skript (currently) is incapable of updating json.sk's functions in those other scripts, so they'll use old versions of the functions until they're also reloaded.
 
That isn't a real error, so to say. Skript is just warning you that you're using the json.sk's functions in other scripts. It's also notifying you that Skript (currently) is incapable of updating json.sk's functions in those other scripts, so they'll use old versions of the functions until they're also reloaded.

I found out my error. But I don't know how to fix it.

The players recieving the json message are in a list variable, {helpops::*} to be exact. The players are added to the variable, not "set {helpops::%player%} to true" style.
Is there a way around this? Would I `loop {helpops::*}` then send the json to loop-value?
 
The latest bensku release did something that breaks this... obviously they've been adding json stuff built-in making this kind of irrelevant but json.sk has insertion, plus i'd have to rewrite lots of json() calls in all my scripts if i wanted to use it. I'd look into fixing the function myself but I figured I'd ask here first. Any plans on updating it?
 
The latest bensku release did something that breaks this... obviously they've been adding json stuff built-in making this kind of irrelevant but json.sk has insertion, plus i'd have to rewrite lots of json() calls in all my scripts if i wanted to use it. I'd look into fixing the function myself but I figured I'd ask here first. Any plans on updating it?
What's broken?
 
For the new update, added on json.sk the possibility of functions. Example :
json("%player%" , "Hello, its just json message||fct: Hellojson(player)")
|_________| |___________________________| |_____________________|
Recipient Average Text Run Function

function Hellojson (p: player):
send "Your &b%{_p}% &rand me &bJson !" to {_p}
 
For the new update, added on json.sk the possibility of functions. Example :
json("%player%" , "Hello, its just json message||fct: Hellojson(player)")
|_________| |___________________________| |_____________________|
Recipient Average Text Run Function

function Hellojson (p: player):
send "Your &b%{_p}% &rand me &bJson !" to {_p}
That's not how functions nor json messages work. If you want a player to execute something, it must be a command.