Introducing the SL Colonies Crafting Station API Script!

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!

1 Like
3 Likes

Excellent! This will add an entirely new creative aspect to our crafting presentations! Not to mention a surge of scripting tech support requests- :slight_smile: For clarification: When you say “So you can trigger any type of script to do anything” (8:03) does that mean that the crafting times can be shorter or the amount of CXP is awarded for completion can be increased? I wouldn’t think so but that was the first thing that came to mind when I heard that statement …

1 Like

LOL No, the ONLY thing that you are Able to Trigger in the Base Scripts it the ability to Start and Stop the Base sounds and animations, you do not have the ability to change anything else

2 Likes

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.