skUtilities

Addon skUtilities 0.9.2

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

tim740

Addon Developer
Jan 24, 2017
24
29
0
UK
tim740 submitted a new resource:

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

If you have any suggestions for this addon or need support you can contact me on Skript Chat Discord:
https://discord.gg/V4qFVnh (Different from skUnity's Discord)

About skUtilities:

Converts Various things in to other things, tons of file Support and utilities loads more to come!

You can disable parts of this addon in the config.

Thanks to @Sashie for helping me understand the basics at the start

I have no plans to add...

Read more about this resource...
 
Last edited:
@tim740: how can I check if a yml value exist at all without getting an error?

4btreVJ.png


code_language.skript:
       set {_test} to yaml value "oiooe" from file "plugins/Skript/yml/skit_timetables.yml"
       if {_test} is set:
           broadcast "set"
 
Last edited by a moderator:
Just an FYI, I believe there is an option in the skUtilties config to turn off these messages. They also shouldn't really be seen as "errors", but more as a warning that the path isn't set.[/user]
Im changing it from ERROR to WARN next update, ill be releasing next update very soon, if you have any suggestions message me on discord.
 
most of my content is already moved over to skunity i've just forgot to update the links on the site, the whole site needs a remodel, once thats done ill update everything
 
  • Like
Reactions: Laukage
the download syntax ist not working
code:
code_language.skript:
command /dl:
    trigger:
        download file from "https://github.com/tim740/skUtilities/releases/download/v0.4.1/skUtilities.v0.4.1.jar" in to file "plugins\skutilDLFU.jar"

console errors:
code_language.skript:
[Skript] Lade hacktest.sk neu...
[19:27:16 ERROR]: Can't understand this condition/effect: download file from "https://github.com/tim740/skUtilities/releases/download/v0.4.1/skUtilities.v0.4.1.jar" in to file "plugins\skutilDLFU.jar" (hacktest.sk, line 201: download file from "https://github.com/tim740/skUtilities/releases/download/v0.4.1/skUtilities.v0.4.1.jar" in to file "plugins\skutilDLFU.jar"')
[19:27:16 INFO]: [Skript] 1 Fehler ist beim Parsen aufgetreten!
can you please help me?
 
tim740 updated skUtilities with a new update entry:

Fixes and Dates

Added:
```
%string% parsed as date[ formatted as %-string%]
#parses a string date as a date

(year|month|month name|day of year|day of month|day of week|day name|hours|minutes|seconds) from date %date%
date %date%'s (year|month|month name|day of year|day of month|day of week|day name|hours|minutes|seconds)
#gets information from a date
```

Fixed CondFileExists syntax
Tweaked update messages
Changed `ERROR` to `WARN` in chat error messages
New checks added to download file

Read the rest of this update entry...
 
I'm having difficulties using download file...
when you go to https://translate.googleapis.com/translate_a/single?client=gtx&sl=id&tl=en&dt=t&q=rumah this will result in a downloaded text attachment f.txt
so i used download file syntax but then skUtilities gives error:

code_language.skript:
[19:25:53 INFO]: https://translate.googleapis.com/translate_a/single?client=gtx&sl=id&tl=en&dt=t&q=rumah
[19:25:53 INFO]: 200
[19:25:53 ERROR]: [skUtilities] v0.8.6: Error Reading from: 'https://translate.googleapis.com/translate_a/single?client=gtx&sl=id&tl=en&dt=t&q=rumah' Is the site down? (ExprUrlContents.class)
[19:25:53 INFO]: <none>
[19:25:53 ERROR]: [skUtilities] v0.8.6: Server returned HTTP response code: 403 for URL: https://translate.googleapis.com/translate_a/single?client=gtx&sl=id&tl=en&dt=t&q=rumah (Utils.class)

i used this code to produce those results

code_language.skript:
        set {_url} to "https://translate.googleapis.com/translate_a/single?client=gtx"
        set {_payload::1} to "sl=id"
        set {_payload::2} to "tl=en"
        set {_payload::3} to "dt=t"
        set {_payload::4} to "q=%arg-1%"
       
        set {_text} to {_url}
        loop {_payload::*}:
            set {_text} to "%{_text}%&%uncolored loop-value%" 
        $ thread   
        set {_result} to response code of url {_text}
        message "%{_text}%"
        message "%{_result}%"
        set {_results::*} to contents from url {_text}
        message "%{_results::*}%"
        download file from {_text} to file "downloaded/test.txt"
 
I'm having difficulties using download file...
when you go to https://translate.googleapis.com/translate_a/single?client=gtx&sl=id&tl=en&dt=t&q=rumah this will result in a downloaded text attachment f.txt
so i used download file syntax but then skUtilities gives error:

code_language.skript:
[19:25:53 INFO]: https://translate.googleapis.com/translate_a/single?client=gtx&sl=id&tl=en&dt=t&q=rumah
[19:25:53 INFO]: 200
[19:25:53 ERROR]: [skUtilities] v0.8.6: Error Reading from: 'https://translate.googleapis.com/translate_a/single?client=gtx&sl=id&tl=en&dt=t&q=rumah' Is the site down? (ExprUrlContents.class)
[19:25:53 INFO]: <none>
[19:25:53 ERROR]: [skUtilities] v0.8.6: Server returned HTTP response code: 403 for URL: https://translate.googleapis.com/translate_a/single?client=gtx&sl=id&tl=en&dt=t&q=rumah (Utils.class)

i used this code to produce those results

code_language.skript:
        set {_url} to "https://translate.googleapis.com/translate_a/single?client=gtx"
        set {_payload::1} to "sl=id"
        set {_payload::2} to "tl=en"
        set {_payload::3} to "dt=t"
        set {_payload::4} to "q=%arg-1%"
     
        set {_text} to {_url}
        loop {_payload::*}:
            set {_text} to "%{_text}%&%uncolored loop-value%"
        $ thread 
        set {_result} to response code of url {_text}
        message "%{_text}%"
        message "%{_result}%"
        set {_results::*} to contents from url {_text}
        message "%{_results::*}%"
        download file from {_text} to file "downloaded/test.txt"

Try
Code:
https://translate.googleapis.com/translate_a/single?client=gtx&sl=id&tl=en&dt=t&q=rumah/f.txt
[doublepost=1487727327,1487726943][/doublepost]@McKidPro @sandor_1234 please fill out a issue, https://github.com/tim740/skUtilities/issues/new (follow this format https://github.com/tim740/skUtilities/blob/master/CONTRIBUTING.md)
 
"date parsed", "unix to date" aren't working for me on mc 1.11, bensku's fork version dev-25:

code_language.skript:
22.03 09:35:38 [Server] ERROR v0.8.9: Text '10/13/2014 12:19:47 PM' could not be parsed at index 8 (ExprDateParsed.class) 
22.03 09:35:38 [Server] ERROR v0.8.9: Text '10/13/2014 12:20:02 PM' could not be parsed at index 8 (ExprDateParsed.class) 
22.03 09:35:38 [Server] ERROR v0.8.9: Text '02/04/2015 06:09:33 AM' could not be parsed at index 8 (ExprDateParsed.class) 
22.03 09:35:38 [Server] ERROR v0.8.9: Text '02/04/2015 06:10:02 AM' could not be parsed at index 8 (ExprDateParsed.class)

^ This error happens when trying to parse a string as a date, not sure if I need to reformat the text first before putting it in the expression or what.

If I try to write "formatted as..." for any expression in my skripts, I will get an error from skript telling me that it's "not a valid item data". Might want to change the syntax of these expressions so it doesn't conflict with existing expressions
 
tim740 updated skUtilities with a new update entry:

Files, Execute bash/batch code and more

Added:
```
file %string% is a dir[ectory]
file %string% is(n'| no)t a dir[ectory]
#checks if path is dircetory

relative path of %string%
%string%'s relative path
#Gets relative path

short path of %string%
%string%'s short path
#Gets short path

on (bash|batch|sh) (command|cmd) (run|execute)
#Event: Triggers when you use Run Command cancelable

run (bash|batch|sh) (command|cmd) %string%
#Excutes command in skript
#Windows: cmd /c <command>

[last ]output of executed (bash|batch|sh)...

Read the rest of this update entry...
 
Idea - how about an expression for the hostname a player is using?

For instance,
code_language.skript:
set {_hostname} to hostname of player