Greetings, Colonists! As part of our recent updates, we’re excited to introduce a new tool for advanced users who want to customize their crafting experience further: the SL Colonies Crafting Station API Script!
Our script listens for six different link messages that allow you to track the crafting process and tailor your station. These messages are as follows:
-
NEW
: This message is sent when a player first sits on the station. -
START
: This message is dispatched when the player initiates a craft and includes the crafting time in seconds. -
STOP
: This message is received when the player stands up from the craft - either because it is completed or paused. It contains the remaining crafting time in seconds. -
DONE
: This message is sent when a player finishes a craft, including the finish time in UNIX time. -
GATHERED
: When the player gathers the crafted items, the script receives this message with the gathering time in UNIX time. -
SPOILED
: This message is sent when an item has spoiled, with the spoiled time in UNIX time.
The actual LSL script looks like this:
key playerUUID;
integer craftingTime;
integer finishedTime;
integer gatheredTime;
default
{
link_message(integer sender_num, integer number, string message, key id)
{
if (message == "NEW")
{
playerUUID = id;
}
else if (message == "START")
{
playerUUID = id;
craftingTime = number;
}
else if (message == "STOP")
{
playerUUID = id;
craftingTime = number;
}
else if (message == "DONE")
{
playerUUID = id;
finishedTime = number;
}
else if (message == "GATHERED")
{
playerUUID = id;
gatheredTime = number;
}
else if (message == "SPOILED")
{
playerUUID = id;
gatheredTime = number;
}
}
}
Please note that this script is aimed at those who have an understanding of LSL scripting. If you need assistance with this script, we recommend consulting an experienced LSL scripter.
Enjoy tailoring your SL Colonies experience!