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!
You can always check out skUnity Downloads for downloads and any other information about Skript!
?? You can't... If the console doesn't detects the error, there's no error, you just write your code wrong.Hello, I am somewhat worried about an error that a Scoreboard is giving me on my server, and the important thing would be to detect the error in the console, how could I do it?
?? You can't... If the console doesn't detects the error, there's no error, you just write your code wrong.
[Craft Scheduler Thread - 9/ERROR]: [FeatherBoard] java.lang.IllegalArgumentException: Team name 'MVdWFB50552' is already in use
at org.apache.commons.lang.Validate.isTrue(Validate.java:136)
Maybe FeatherBoard has an API for that, if they do, use skript-mirror, but if they don't then I have no idea how you should do thatWhat I need is to detect, for example, the following error.
When the console prints it, detect it in some way, be it with Skript or some Addon.code_language.skript:[Craft Scheduler Thread - 9/ERROR]: [FeatherBoard] java.lang.IllegalArgumentException: Team name 'MVdWFB50552' is already in use at org.apache.commons.lang.Validate.isTrue(Validate.java:136)
Maybe FeatherBoard has an API for that, if they do, use skript-mirror, but if they don't then I have no idea how you should do that
[Craft Scheduler Thread - 9/ERROR]: [FeatherBoard] java.lang.IllegalArgumentException: Team name 'MVdWFB50552' is already in use
at org.apache.commons.lang.Validate.isTrue(Validate.java:136)
Do you have a specific code which is causing the error?Thank you very much I will try to do something with Skript-Mirror, if I do not understand I will ask for help. Really, thank you.
[doublepost=1538265651,1538076529][/doublepost]Hi again, I have managed to find a line to detect errors in consoles and perform actions but I do not understand how to use it. Someone to give me a hand?
Code that I need to detect:
code_language.skript:[Craft Scheduler Thread - 9/ERROR]: [FeatherBoard] java.lang.IllegalArgumentException: Team name 'MVdWFB50552' is already in use at org.apache.commons.lang.Validate.isTrue(Validate.java:136)
Add-on: https://skript-mirror.gitbook.io/docs/advanced/error-handling#programmatic-access
From already thank you very much
Yeah, maybe if you have a specific code for that you can detect it. Not the error, the code which causes the error! Maybe this helps: https://www.spigotmc.org/threads/skript-get-info-from-a-script-to-another-one.253249/Do you have a specific code which is causing the error?
There is a chance that FeatherBoard has an API for error handling stuff, and if they do, it can be possible to catch errors. And for the second part, it is possible with the link you send (under Error Object). Whenever you run the code which may cause an error, you check if that expression changed.I think there is no way to detect an error with Skript, but you can cause it ( https://skript-mirror.gitbook.io/docs/advanced/error-handling#programmatic-access )
Yeah, maybe if you have a specific code for that you can detect it. Not the error, the code which causes the error! Maybe this helps: https://www.spigotmc.org/threads/skript-get-info-from-a-script-to-another-one.253249/
if the log level is error:
Use on log, see if it's from featherboard with logger name and check if it's the specific error with logged message. Then add 1 to a variable, if that variable is above a specific amount, set it to 0 and execute a commandI do not need the entire code, but help me get started. How can I start to detect errors and save them in a variable, by the time I get to the number of times, the console executes a command?
on log:
if the log level is info:
set {_message} to the logged message
if {_message} contains "[Skript]":
if {Error} is not set:
set {Error} to 1
send "" to console
send "" to console
send "Cantidad de errores: %{Error}%" to console
send "" to console
send "" to console
stop
else:
add 1 to {Error}
send "" to console
send "" to console
send "Cantidad de errores: %{Error}%" to console
send "" to console
send "" to console
stop
[16:36:25 ERROR]: can't understand this condition: 'the log level is info' (Erro
r.sk, line 2: if the log level is info:')
Can you try if "%the log level%" is "info" for me?mmmh I do not understand how to detect that this is the message I want to generate a variable. Because it can not be compared to a text.
CODE:
code_language.skript:on log: if the log level is info: set {_message} to the logged message if {_message} contains "[Skript]": if {Error} is not set: set {Error} to 1 send "" to console send "" to console send "Cantidad de errores: %{Error}%" to console send "" to console send "" to console stop else: add 1 to {Error} send "" to console send "" to console send "Cantidad de errores: %{Error}%" to console send "" to console send "" to console stop
ERROR:
code_language.skript:[16:36:25 ERROR]: can't understand this condition: 'the log level is info' (Erro r.sk, line 2: if the log level is info:')
Try if log level is infoKeep giving error.
code_language.skript:[17:50:31 ERROR]: Can't understand this expression: the log level (Error.sk, lin e 2: if "%the log level%" is "info":')