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.

Skript Tools SkLectern 1.0.2-alpha

Supercharge your scripts with various new language features and performance gains.

Tags:
  1. Kiip
    EARLY PREVIEW, BUG TESTING ONLY
    REPORT BUGS HERE


    Supercharge your scripts with various new language features and performance gains, transpiling right into Skript code.

    Please do note that this is just a proof of concept, and the result is by no means production grade.

    Macros
    This language feature is similar to Skript options, it gets searched and replaced before execution like options, but allows arguments like functions. The benefit of macros is that they don't have a performance impact unlike functions, and it allows for syntax elements to be passed as argument. Please do note that parsing times may increase, and your scripts can become quite large when transpiled. Use with caution and optimize the macro body.

    Macros need to end with a ! and unlike functions they don't have types for arguments.

    The syntax to use macros is as follows:
    Code (Text):
    1. command /test:
    2.   trigger:
    3.    chance!(broadcast "hi", 0.5)
    4.  
    5. macro chance!(statement, chance):
    6.   if chance of $chance:
    7.    $statement
    With as result:
    Code (Text):
    1. command /test:
    2.   trigger:
    3.    if chance of 0.5:
    4.      broadcast "hi"
    Structures are also supported:
    Code (Text):
    1. item!(dirt, 5 seconds)
    2. item!(stone, 10 seconds)
    3.  
    4. structure macro item!(item, cooldown):
    5.   command /$item:
    6.    cooldown: $cooldown
    7.    cooldown message: &cWait a little longer before getting another item!
    8.    trigger:
    9.      give $item to player
    With as result:
    Code (Text):
    1. command /dirt:
    2.   cooldown: 5 seconds
    3.   cooldown message: &cWait a little longer before getting another item!
    4.   trigger:
    5.    give dirt to player
    6.  
    7. command /stone:
    8.   cooldown: 10 seconds
    9.   cooldown message: &cWait a little longer before getting another item!
    10.   trigger:
    11.    give stone to player
    Arithmetic
    Simple arithmetic like 3 + 2 gets simplified into 5.
    This allows you to write more clear code without worrying about performance.