Get IM when land is sold

Written by Kitsune
integer ctime = 10;
 
default
{
state_entry()
{
llSay(0, "Online. Will check every "+(string)ctime+" seconds. If land owner is NOT the same as object owner, will message object owner with location and 'your land sold' message, and self delete.");
llSetTimerEvent((float)ctime);
}
 
timer() {
if (llGetLandOwnerAt(llGetPos()) == llGetOwner()) {
// object owner matches land owner
} else {
// object owner does NOT match land owner!
llInstantMessage(llGetOwner(),"Your land at "+(string)llGetRegionName()+":"+(string)llGetPos()+" has been sold. The new buyer may be : "+llKey2Name(llGetLandOwnerAt(llGetPos()))+" (if this fails, a group now has it).");
llDie();
}
 
}
}