void main()
{
    // The target object being examined, fetched using GetEventParam
    object oSign = GetEventParamObject(0);  // This is the object being examined, i.e., the sign.
    if (!GetIsObjectValid(oSign))
    {
        return; // Exit if the object is invalid.
    }

    // Get the area of the sign.
    object oArea = GetArea(oSign);

    // Initialize the message text for the sign description.
    string sDescription = "";

    // Start looping through all objects in the area to find cookie plates.
    object oPlaceable = GetFirstObjectInArea(oArea);
    while (GetIsObjectValid(oPlaceable))
    {
        // Check if the object has the tag "CAS_COOKIEPLATE".
        if (GetTag(oPlaceable) == "CAS_COOKIEPLATE")
        {
            // Retrieve cookie type and number sold.
            string sCookieType = GetLocalString(oPlaceable, "sCOOKIE_TYPE");
            int iCookiesSold = GetLocalInt(oPlaceable, "iCookiesSold");

            // Append cookie information to the description for all cookie types.
            if (iCookiesSold > 0)  // Only display cookies that have been sold.
            {
                sDescription += sCookieType + " Sold: " + IntToString(iCookiesSold) + " Cookies!\n\n";
            }
        }

        // Move to the next object in the area.
        oPlaceable = GetNextObjectInArea(oArea);
    }

    // If no cookie plates were found or no cookies sold, set a default description.
    if (sDescription == "")
    {
        sDescription = "No cookies have been sold yet!";
    }

    // Update the sign's name and description.
    SetName(oSign, "Cookie Sales Status");
    SetDescription(oSign, sDescription);
}
