Skript Papi placeholders

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

mrxqware

Member
Apr 19, 2017
17
0
0
23
Hey guys and girls,

I'm running a spigot 1.8.8 server and I would like to use Clips placeholde api to load BattleLevel placeholders in Skript. I didn't find a way so far to handle this. I saw that an old Umbaska version should do the job (Umbaska 1.5? Something like that).

It doesn't seem to work and that version doesn't match the stuff I need for my other skript resources/plugins. Is there a way to do it?
 
You have to enable it in the Skellett config.

Example:
code_language.skript:
set {_OnlinePlayers} to placeholder "%%server_online%%" from player
 
Thank you, it works. The only Problem I have now is that when I do the following:
Code:
       set {_Level} to placeholder "%%battlelevels_level%%" from player
       message "%{_Level}%"

That it outputs:
Code:
%18%

It keeps the percentage symbols in every output. Do you know how to fix this?
 
Thank you, it works. The only Problem I have now is that when I do the following:
Code:
       set {_Level} to placeholder "%%battlelevels_level%%" from player
       message "%{_Level}%"

That it outputs:
Code:
%18%

It keeps the percentage symbols in every output. Do you know how to fix this?
Because you're already in parsing it in the first line. Remove one set of the %'S around the line where you set the placeholder.
 
I already tried that, that gives the following error:

Code:
[21:08:15] [Client thread/INFO]: [CHAT] Can't understand this expression: battlelevels_level (custom.sk, line 124: set {_Level} to placeholder "%battlelevels_level%" from player')

I feel like it's the same problem as someone has here: https://github.com/bensku/Skript/issues/545
Oh. Then undo what I told you do I think and remove the % at the bottom in the message.
 
I also tried the replace trick:
Code:
replace "%" with "" in {_message}

but then Skript complains about the use of the % symbol, that if I want to have a '%' that I should add two of them '%%', but then it doesn't work anymore, since it will search for 2 symbols.

Code:
[21:17:38] [Client thread/INFO]: [CHAT] The percent sign is used for expressions (e.g. %player%). To insert a '%' type it twice: %%. (custom.sk, line 125: replace "%" with "" in {_message}')
 
set {_message} to message
replace "%%25" with "" in {_message}

This should work.

https://en.m.wikipedia.org/wiki/Percent-encoding
Tried it and RIP xD

Code:
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Server thread/ERROR]: #!#! [Skript] Severe Error:
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Server thread/ERROR]: #!#! If you're developing an add-on for Skript this likely means that you have done something wrong.
[21:33:03] [Server thread/ERROR]: #!#! If you're a server admin however please go to https://github.com/bensku/Skript/issues/
[21:33:03] [Server thread/ERROR]: #!#! and check whether this error has already been reported.
[21:33:03] [Server thread/ERROR]: #!#! If not please create a new ticket with a meaningful title, copy & paste this whole error into it (or use paste service),
[21:33:03] [Server thread/ERROR]: #!#! and describe what you did before it happened and/or what you think caused the error.
[21:33:03] [Server thread/ERROR]: #!#! If you think that it's a trigger that's causing the error please post the trigger as well.
[21:33:03] [Server thread/ERROR]: #!#! By following this guide fixing the error should be easy and done fast.
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Server thread/ERROR]: #!#! Stack trace:
[21:33:03] [Server thread/ERROR]: #!#! java.lang.NullPointerException
[21:33:03] [Server thread/ERROR]: #!#!     at me.robin.battlelevels.d.a.onPlaceholderRequest(a.java:6)
[21:33:03] [Server thread/ERROR]: #!#!     at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:352)
[21:33:03] [Server thread/ERROR]: #!#!     at com.gmail.thelimeglass.Expressions.ExprPlaceholderAPI.get(ExprPlaceholderAPI.java:53)
[21:33:03] [Server thread/ERROR]: #!#!     at com.gmail.thelimeglass.Expressions.ExprPlaceholderAPI.get(ExprPlaceholderAPI.java:1)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:103)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.effects.EffChange.execute(EffChange.java:268)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Effect.run(Effect.java:52)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Trigger.execute(Trigger.java:55)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.ScriptCommand.execute2(ScriptCommand.java:220)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.ScriptCommand.execute(ScriptCommand.java:182)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.Commands.handleCommand(Commands.java:268)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.Commands$1.onServerCommand(Commands.java:179)
[21:33:03] [Server thread/ERROR]: #!#!     at sun.reflect.GeneratedMethodAccessor148.invoke(Unknown Source)
[21:33:03] [Server thread/ERROR]: #!#!     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[21:33:03] [Server thread/ERROR]: #!#!     at java.lang.reflect.Method.invoke(Method.java:498)
[21:33:03] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306)
[21:33:03] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[21:33:03] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502)
[21:33:03] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487)
[21:33:03] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.DedicatedServer.aO(DedicatedServer.java:407)
[21:33:03] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:375)
[21:33:03] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
[21:33:03] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
[21:33:03] [Server thread/ERROR]: #!#!     at java.lang.Thread.run(Thread.java:745)
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Server thread/ERROR]: #!#! Version Information:
[21:33:03] [Server thread/ERROR]: #!#!   Skript: 2.2-dev26f
[21:33:03] [Server thread/ERROR]: #!#!   Bukkit: 1.8.8-R0.1-SNAPSHOT
[21:33:03] [Server thread/ERROR]: #!#!   Minecraft: 1.8.8
[21:33:03] [Server thread/ERROR]: #!#!   Java: 1.8.0_121 (OpenJDK 64-Bit Server VM 25.121-b13)
[21:33:03] [Server thread/ERROR]: #!#!   OS: Linux amd64 3.14.32-xxxx-grs-ipv6-64
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Server thread/ERROR]: #!#! Running CraftBukkit: false
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Server thread/ERROR]: #!#! Current node: null
[21:33:03] [Server thread/ERROR]: #!#! Current item: set {_Level}(as java.lang.Object) to [parse[d]] place[ ]holder [(from|with)] %string% [[(from|for)] %-player%]
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Server thread/ERROR]: #!#! Thread: Server thread
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Server thread/ERROR]: #!#! End of Error.
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Thread-98/INFO]: An internal error occurred while attempting to perform this command.[m

I noticed I'm using the skript 2.2-dev26f version, I'm making a backup and I'll try dev27
 
I also tried the replace trick:
Code:
replace "%" with "" in {_message}

but then Skript complains about the use of the % symbol, that if I want to have a '%' that I should add two of them '%%', but then it doesn't work anymore, since it will search for 2 symbols.

Code:
[21:17:38] [Client thread/INFO]: [CHAT] The percent sign is used for expressions (e.g. %player%). To insert a '%' type it twice: %%. (custom.sk, line 125: replace "%" with "" in {_message}')
It should be:
Tried it and RIP xD

Code:
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Server thread/ERROR]: #!#! [Skript] Severe Error:
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Server thread/ERROR]: #!#! If you're developing an add-on for Skript this likely means that you have done something wrong.
[21:33:03] [Server thread/ERROR]: #!#! If you're a server admin however please go to https://github.com/bensku/Skript/issues/
[21:33:03] [Server thread/ERROR]: #!#! and check whether this error has already been reported.
[21:33:03] [Server thread/ERROR]: #!#! If not please create a new ticket with a meaningful title, copy & paste this whole error into it (or use paste service),
[21:33:03] [Server thread/ERROR]: #!#! and describe what you did before it happened and/or what you think caused the error.
[21:33:03] [Server thread/ERROR]: #!#! If you think that it's a trigger that's causing the error please post the trigger as well.
[21:33:03] [Server thread/ERROR]: #!#! By following this guide fixing the error should be easy and done fast.
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Server thread/ERROR]: #!#! Stack trace:
[21:33:03] [Server thread/ERROR]: #!#! java.lang.NullPointerException
[21:33:03] [Server thread/ERROR]: #!#!     at me.robin.battlelevels.d.a.onPlaceholderRequest(a.java:6)
[21:33:03] [Server thread/ERROR]: #!#!     at me.clip.placeholderapi.PlaceholderAPI.setPlaceholders(PlaceholderAPI.java:352)
[21:33:03] [Server thread/ERROR]: #!#!     at com.gmail.thelimeglass.Expressions.ExprPlaceholderAPI.get(ExprPlaceholderAPI.java:53)
[21:33:03] [Server thread/ERROR]: #!#!     at com.gmail.thelimeglass.Expressions.ExprPlaceholderAPI.get(ExprPlaceholderAPI.java:1)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:103)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.effects.EffChange.execute(EffChange.java:268)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Effect.run(Effect.java:52)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Trigger.execute(Trigger.java:55)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.ScriptCommand.execute2(ScriptCommand.java:220)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.ScriptCommand.execute(ScriptCommand.java:182)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.Commands.handleCommand(Commands.java:268)
[21:33:03] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.Commands$1.onServerCommand(Commands.java:179)
[21:33:03] [Server thread/ERROR]: #!#!     at sun.reflect.GeneratedMethodAccessor148.invoke(Unknown Source)
[21:33:03] [Server thread/ERROR]: #!#!     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[21:33:03] [Server thread/ERROR]: #!#!     at java.lang.reflect.Method.invoke(Method.java:498)
[21:33:03] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306)
[21:33:03] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
[21:33:03] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502)
[21:33:03] [Server thread/ERROR]: #!#!     at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487)
[21:33:03] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.DedicatedServer.aO(DedicatedServer.java:407)
[21:33:03] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:375)
[21:33:03] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
[21:33:03] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
[21:33:03] [Server thread/ERROR]: #!#!     at java.lang.Thread.run(Thread.java:745)
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Server thread/ERROR]: #!#! Version Information:
[21:33:03] [Server thread/ERROR]: #!#!   Skript: 2.2-dev26f
[21:33:03] [Server thread/ERROR]: #!#!   Bukkit: 1.8.8-R0.1-SNAPSHOT
[21:33:03] [Server thread/ERROR]: #!#!   Minecraft: 1.8.8
[21:33:03] [Server thread/ERROR]: #!#!   Java: 1.8.0_121 (OpenJDK 64-Bit Server VM 25.121-b13)
[21:33:03] [Server thread/ERROR]: #!#!   OS: Linux amd64 3.14.32-xxxx-grs-ipv6-64
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Server thread/ERROR]: #!#! Running CraftBukkit: false
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Server thread/ERROR]: #!#! Current node: null
[21:33:03] [Server thread/ERROR]: #!#! Current item: set {_Level}(as java.lang.Object) to [parse[d]] place[ ]holder [(from|with)] %string% [[(from|for)] %-player%]
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Server thread/ERROR]: #!#! Thread: Server thread
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Server thread/ERROR]: #!#! End of Error.
[21:33:03] [Server thread/ERROR]: #!#!
[21:33:03] [Thread-98/INFO]: An internal error occurred while attempting to perform this command.[m

I noticed I'm using the skript 2.2-dev26f version, I'm making a backup and I'll try dev27
Try with the dev25, I think it's a bug of the JSON implementation. See my issue here:
https://github.com/bensku/Skript/issues/600
 
Tried it and RIP xD

Code:
[21:33:03] [Server thread/ERROR]: #!#! Current item: set {_Level}(as java.lang.Object) to [parse[d]] place[ ]holder [(from|with)] %string%

I noticed I'm using the skript 2.2-dev26f version, I'm making a backup and I'll try dev27

Why did you change the %'s in the {_level}? This is wrong.
You should replace it in the message.

code_language.skript:
       set {_Level} to placeholder "%%battlelevels_level%%" from player
       set {_message} to "%{_Level}%"
       replace "%%25" with "" in {_message}
       message "{_message}"
 
Why did you change the %'s in the {_level}? This is wrong.
You should replace it in the message.

code_language.skript:
       set {_Level} to placeholder "%%battlelevels_level%%" from player
       set {_message} to "%{_Level}%"
       replace "%%25" with "" in {_message}
       message "{_message}"

You're right, I made it replace the string in the wrong variable. I tried it your way, but then it doesn't work neither.

With your example the output of {_message} was literally:

Code:
{_message}

so I changed it into this:

Code:
message "%{_message}%"

But then my output was again the level with 2 '%' symbols:

Code:
%18%

So I tried skript dev25, and it works! So I would like to thank you guys for helping me out!

Dev27 doesn't fix the problem neither, so I hope that it will get fixed in the future.
 
Status
Not open for further replies.