1. 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!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Addon skUtilities 0.9.2

[Conversions|Files|& More] [Java 8+, Sk 2.2+]

  1. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    @tim740 how do you parse a JSON object in Skript?

    I'm trying to parse the /stats/uuid.json player object so I can display simple stuff like stat.walkOneCm for people.
     
  2. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Use Reqn https://forums.skunity.com/resources/reqn.95/ for json stuff.
     
  3. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Does this add-on support 1.8 to 1.12.1?
     
  4. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    It supports anything from Sk v2.2 and above so yes.
     
  5. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Okey, so if I use Skript bensku's edit, it should support 1.8 to 1.12.x?
     
  6. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Yes since Bensku's fork is above 2.2.
     
  7. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    How can I download the latest version of my skript from spigot using the download expression?
     
    #27 ShaneBee, Aug 22, 2017
    Last edited by a moderator: Aug 22, 2017
  8. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Using the Spiget API it should be easy:
    Code (Skript):
    1. download file from "https://api.spiget.org/v2/resources/<Resource ID>/download" to file "plugins\Skript\scripts"
    The resource ID is the one that is after your script name in the resource URL.
     
  9. ELROX

    ELROX Member

    Joined:
    Jan 26, 2017
    Messages:
    30
    Likes Received:
    1
    I think the expression "parsed as date formatted as..." is wrong.

    I have the date with the time of an "event" stored in a yml file. When I add it to the expression, one hour is added to the time of the event.

    Code (Skript):
    1. set {_LastUsed} to skUtil "09.11.2017 13:45:04" parsed as date formatted as "dd.MM.yyyy HH:mm:ss"
    2. send "%{_LastUsed}%"
    Result:
    Code (Skript):
    1. 09.11.2017 14:45:04
    The correct result should be:
    Code (Skript):
    1. 09.11.2017 13:45:04
    The result should be the same data that I entered but parsed as date. What it does is that another data with the hour changed, parsed as data. The result is that if I do a cooldown system, it is always going to say that the waiting time is 1 hour now, because the parsed date increases 1 hour.

    Only the "hour" number is changed, no other data.

    I have created a small patch in my script that subtracts one hour from the date I have saved. By subtracting an hour, the cooldown works correctly.
     
    #29 ELROX, Nov 9, 2017
    Last edited: Nov 9, 2017
  10. Uzumaki

    Uzumaki Well-Known Member

    Joined:
    Feb 20, 2017
    Messages:
    310
    Likes Received:
    10
    Code (Skript):
    1.  
    2. #
    3. # \\ YML/CONFIG //
    4. #
    5.  
    6.  
    7.  
    8. on load:
    9.     file "plugins\LeafSkyWars\config.yml" doesn't exist:
    10.         set {&} to "&"
    11.         create file "plugins/LeafSkyWars/config.yml"
    12.         set skutil yaml value "DefaultGlass" from file "plugins\LeafSkyWars\config.yml" to "95:5"
    13.         set skutil yaml value "WinnerHologram" from file "plugins\LeafSkyWars\config.yml" to "true"  
    14.         set skutil yaml value "ExplosionEffect" from file "plugins\LeafSkyWars\config.yml" to "true"  
    15.         set skutil yaml value "UseBowDamageIndicator" from file "plugins\LeafSkyWars\config.yml" to "true"
    16.         set skutil yaml value "InGameCMDS" from file "plugins\LeafSkyWars\config.yml" to ""      
    17.         add "sw" to skutil yaml list "InGameCMDS" from file "plugins\SuperBans\config.yml"
    18.        
    19.     file "plugins\LeafSkyWars\customization.yml" doesn't exist:  
    20.         set skutil yaml value "Prefix" from file "plugins\LeafSkyWars\customization.yml" to "%{&}%2%{&}%lLeaf %{&}%6%{&}%lSKYWARS %{&}%e%{&}%l» %{&}%7"  
    21.        
    22.        
    23.        
    24.        
    25.     #Settings
    26.     wait 0.5 seconds
    27.     set {Leaf.SW.OPTION::WinnerHologram} to yml value "WinnerHologram" of file "plugins\LeafSkyWars\config.yml"
    28.     set {Leaf.SW.OPTION::DefaultGlass} to yml value "DefaultGlass" of file "plugins\LeafSkyWars\config.yml"
    29.     set {Leaf.SW.OPTION::ExplosionEffect} to yml value "ExplosionEffect" of file "plugins\LeafSkyWars\config.yml"  
    30.     set {Leaf.SW.OPTION::UseBowDamageIndicator} to yml value "UseBowDamageIndicator" of file "plugins\LeafSkyWars\config.yml"
    31.    
    32.     set {Leaf.SW.OPTION::InGameCMDS::*} to yml list "InGameCMDS" of file "plugins\LeafSkyWars\config.yml"  
    33.    
    34.    
    35.     #messages
    36.    
    37.     set {Leaf.SW.MSG::Prefix} to yml value "Prefix" of file "plugins\LeafSkyWars\customization.yml"      
    38.    
    39.    
    40.    
    41.    
    42.    
    43.    
    Code (Skript):
    1. 22:14:31 ERROR]: #!#!
    2. [22:14:31 ERROR]: #!#! [Skript] Severe Error:
    3. [22:14:31 ERROR]: #!#!
    4. [22:14:31 ERROR]: #!#! If you're developing an add-on for Skript this likely means that you have done something wrong.
    5. [22:14:31 ERROR]: #!#! If you're a server admin however please go to https://github.com/bensku/Skript/issues/
    6. [22:14:31 ERROR]: #!#! and check whether this error has already been reported.
    7. [22:14:31 ERROR]: #!#! If not please create a new ticket with a meaningful title, copy & paste this whole error into it (or use paste service),
    8. [22:14:31 ERROR]: #!#! and describe what you did before it happened and/or what you think caused the error.
    9. [22:14:31 ERROR]: #!#! If you think that it's a trigger that's causing the error please post the trigger as well.
    10. [22:14:31 ERROR]: #!#! By following this guide fixing the error should be easy and done fast.
    11. [22:14:31 ERROR]: #!#!
    12. [22:14:31 ERROR]: #!#! Stack trace:
    13. [22:14:31 ERROR]: #!#! java.lang.NullPointerException
    14. [22:14:31 ERROR]: #!#!     at uk.tim740.skUtilities.files.SExprYaml.get(SExprYaml.java:45)
    15. [22:14:31 ERROR]: #!#!     at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:103)
    16. [22:14:31 ERROR]: #!#!     at ch.njol.skript.effects.EffChange.execute(EffChange.java:268)
    17. [22:14:31 ERROR]: #!#!     at ch.njol.skript.lang.Effect.run(Effect.java:52)
    18. [22:14:31 ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:61)
    19. [22:14:31 ERROR]: #!#!     at ch.njol.skript.lang.TriggerItem.walk(TriggerItem.java:89)
    20. [22:14:31 ERROR]: #!#!     at ch.njol.skript.effects.Delay$1.run(Delay.java:94)
    21. [22:14:31 ERROR]: #!#!     at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
    22. [22:14:31 ERROR]: #!#!     at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
    23. [22:14:31 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723)
    24. [22:14:31 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374)
    25. [22:14:31 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654)
    26. [22:14:31 ERROR]: #!#!     at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557)
    27. [22:14:31 ERROR]: #!#!     at java.lang.Thread.run(Unknown Source)
    28. [22:14:31 ERROR]: #!#!
    29. [22:14:31 ERROR]: #!#! Version Information:
    30. [22:14:31 ERROR]: #!#!   Skript: 2.2-dev27
    31. [22:14:31 ERROR]: #!#!   Bukkit: 1.8.8-R0.1-SNAPSHOT
    32. [22:14:31 ERROR]: #!#!   Minecraft: 1.8.8
    33. [22:14:31 ERROR]: #!#!   Java: 1.8.0_151 (Java HotSpot(TM) 64-Bit Server VM 25.151-b12)
    34. [22:14:31 ERROR]: #!#!   OS: Windows 10 amd64 10.0
    35. [22:14:31 ERROR]: #!#!
    36. [22:14:31 ERROR]: #!#! Running CraftBukkit: false
    37. [22:14:31 ERROR]: #!#!
    38. [22:14:31 ERROR]: #!#! Current node: null
    39. [22:14:31 ERROR]: #!#! Current item: set {Leaf.SW.OPTION::InGameCMDS::*}(as java.lang.Object) to uk.tim740.skUtilities.files.SExprYaml
    40. [22:14:31 ERROR]: #!#!
    41. [22:14:31 ERROR]: #!#! Thread: Server thread
    42. [22:14:31 ERROR]: #!#!
    43. [22:14:31 ERROR]: #!#! End of Error.
    44. [22:14:31 ERROR]: #!#!
    Any help?
     
  11. Ayham Alali

    Moderator Resource Staff Supporter Dev Programme

    Joined:
    Jan 25, 2017
    Messages:
    51
    Likes Received:
    13
    Medals:
    Hey, before I begin thank you for this great addon that made scipting much easier ♥.
    I have a couple questions..
    1. Is there is any way to write line in file like WildSkript or Umbaska (wf "..." to "...") in SkUtilities?
    2. Is there is a way to format gui like that: ↓?
    Code (Text):
    1.  
    2. format a gui slot 0 of player with stone named ".."  to do:
    3.    code here ....
    4.  
    And thank you ♥.
     
  12. Snow-Pyon

    Snow-Pyon Well-Known Member

    Joined:
    Jan 25, 2017
    Messages:
    1,235
    Likes Received:
    176
    Medals:
    Yes, you can do:
    Code (Skript):
    1. write "something" at line (file "whatever.sk"'s line count + 1) to file "whatever.sk"
    I'd make a function just to avoid writing that all the time.

    As for your second question, it's completely unrelated to skUtilities so you're better off creating a help thread for it.
     
  13. Ayham Alali

    Moderator Resource Staff Supporter Dev Programme

    Joined:
    Jan 25, 2017
    Messages:
    51
    Likes Received:
    13
    Medals:
    Thank you for that idea (first question) :emoji_slight_smile:
    And I'm sorry I confused between SkUtilites and Tuske lol, my bad :emoji_grinning:
     
  14. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Hey Tim
    I saw in the docs the use of profession in spawning a villager.
    Was that removed?
    I tried
    Code (Skript):
    1. spawn a villager with profession NORMAL at location of player
    and it returned
    "Can't understand this condition/effect: spawn a villager with profession NORMAL at location of player"

    Also, on this same topic, is a personal able to call upon the villagers profession during a spawn event? If not are you able to add that?
    I found an API Skript for changing villagers trades on spawn, but I wanted to set them per profession.
     
  15. tim740

    Addon Developer

    Joined:
    Jan 24, 2017
    Messages:
    24
    Likes Received:
    29
    thats in skprofession
     
  16. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
    Ah yes, I see that now, thank you :emoji_slight_smile:
     
  17. KroterPvP

    KroterPvP Active Member

    Joined:
    Apr 10, 2017
    Messages:
    178
    Likes Received:
    7
  18. ShaneBee

    Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,183
    Likes Received:
    234
  19. ceruleanReverie

    Joined:
    Jan 31, 2017
    Messages:
    25
    Likes Received:
    0
    Getting errors when I try converting ascii back to a string... I made a thread about it here to no avail... is this a bug?
     
  20. jaylawl

    jaylawl Active Member

    Joined:
    Jan 29, 2017
    Messages:
    173
    Likes Received:
    31
    Suggestion:
    Add "yaml node is %type%" condition. Right now we're capable of looping through our yaml files quite alright, but it's hard and especially messy to determine what the looped yaml node functions as. I'm suggesting usage like this:

    Code (Skript):
    1. loop yaml nodes with keys "" of file {_file}:
    2.     yaml node "%loop-value%" of file {_file} = list
    3.     set {_list::%loop-value%} to yaml list "%loop-value%" of file {_file}
     

Share This Page

Loading...