ParseSK
ParseSK is a simple Skript addon allowing you to parse any string input with Skript. You can programmatically handle the parsing errors it may throw, and make it so it won't executes the given code (and only parse it).
Installation
This is a separate Plugin, not a Module!
Usage
Only one effect is added by ParseSK, which is eval
. Here are some usage examples:
add "set {_test} to 1" to {_test::*}
add "if {_test} is bigger than 0:" to {_test::*}
add " send ""&2Hello, world!""" to {_test::*}
add "else:" to {_test::*}
add " huh send ""&4Goodbye, world!""" to {_test::*}
set {_to-parse} to join {_test::*} with nl
eval {_to-parse} and store it in {_errors::*}
if {_errors::*} is not set:
send "&aNo errors found in the string."
else:
send "&4Errors found in the given code:"
loop {_errors::*}:
send " &c- %loop-value%"
Simply starts the effect with eval without executing
instead of eval
:
add "set {_test} to 1" to {_test::*}
add "if {_test} is bigger than 0:" to {_test::*}
add " send ""&2Hello, world!""" to {_test::*}
add "else:" to {_test::*}
add " huh send ""&4Goodbye, world!""" to {_test::*}
set {_to-parse} to join {_test::*} with nl
eval without executing {_to-parse} and store it in {_errors::*}
if {_errors::*} is not set:
send "&aNo errors found in the string."
else:
send "&4Errors found in the given code:"
loop {_errors::*}:
send " &c- %loop-value%"