// madison-api-skeleton.lsl
// Copyright 2019-2021 Lava Babii.
// You may use this script as a basis to create plugins and add-ons for
// Madison billboards. You are allowed to sell your derived scripts
// with the permission set you want.
// Plugins are simply dropped into the billboard's contents.
// BE ADVISED that if your scripts is reported to harm the billboard's
// operation, it will be blacklisted and deleted upon detection.
talk2owner(string m) {
string n = llGetObjectName();
llSetObjectName(llGetScriptName());
llOwnerSay(m);
llSetObjectName(n);
}
default {
state_entry() {
}
link_message( integer sender_num, integer num, string message, key id )
{
// The following if-blocks contain the available API events.
if (message == "rented-by") {
talk2owner("Rented by " + llKey2Name(id) + " for " + (string)num + " weeks");
} else if (message == "extended-by") {
talk2owner("Rental extended by " + (string)num + " weeks");
} else if (message == "terminated") {
talk2owner("Rental has been terminated");
} else if (message == "expired") {
talk2owner("Rental has expired");
} else if (message == "clicked-by") {
talk2owner("Clicked by " + llKey2Name(id));
} else if (message == "locked") {
if (num)
talk2owner("Board has been locked");
else
talk2owner("Board has been unlocked");
} else if (message == "time-remaining") {
talk2owner("Rental time remaining: " + (string)num + " seconds");
} else if (message == "payment-received") {
talk2owner("Received payment of a net amount of " + (string)num + " L$ from "
+ llKey2Name(id));
}
}
}