Gnasp.com

Home Posts Maps Videos

Smelt with variables

02 August 2016

Yesterday I released Smelt 0.8.0 beta, which includes a new feature: variables!

Introducing Variables

Variables were requested by Johann/Skaran, and I felt that it was a great idea; but because I didn’t want to get distracted on the road to 1.0.0 I put it aside for version 1.1.0.

Thankfully Skaran really wanted them sooner than that; so he decided to have a go at implementing them himself and sent me his code. A few tweaks and bug fixes later, and it was done!

So now, you can use variables in your MCC code. For example:

// Declare variables
$Name=Johann
$NameAndTitle=Mr $Name
$Message=Hello $Name

#Start
>{"type":"impulse", "auto":true}
/say $Name
    >{"type":"chain"}
    /say $Message
    // Override a variable
    $Message=Goodbye $NameAndTitle
    /say $Message

Output:

[@] Johann
[@] Hello Johann
[@] Goodbye Mr Johann

Other stuff

You might also notice in the above example that the syntax has changed a fair amount. Check out the change notes on the Smelt website to learn more about version 0.8.0.