/////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2011 - License: GNU GPLv3 // // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // // rights of fair usage, the disclaimer and warranty conditions. // /////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////// // CONFIGURATION // ////////////////////////////////////////////////////////// // // // Set this to the URL of a radio station to which the // land parcel should switch to once the DJ leaves. string RADIO_URL = "http://www.google.com"; // This represents the interval in seconds between scans. integer SCAN_INTERVAL = 30; // This represents the range for the scans. integer SCAN_RANGE = 10; // Whenever a DJ is not found after a scan, the script // will decrement this value. When this value reaches 0, // the script will consider that the DJ has left and // it will switch to the configured radio station. This // is done this way, because sometimes scans fail and // they are unable to locate a DJ. This is some sort of // error fuzz that the script will allow. integer ALLOWED_SCAN_FAILS = 10; // // // END CONFIGURATION // ////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// // INTERNALS // /////////////////////////////////////////////////////////////////////////// key dQuery = NULL_KEY; integer dLine = 0; list dList = []; init() { integer itra; for(itra=0; itra 0) { --dLine; } } dataserver(key query_id, string data) { if(query_id == dQuery) { if(data == EOF) { dLine = ALLOWED_SCAN_FAILS; llSetTimerEvent(30); llSensorRepeat("", "", AGENT, SCAN_RANGE, TWO_PI, SCAN_INTERVAL); return; } if(data == "") jump next_line; list pData = llParseString2List(data, ["#"], [""]); if(llKey2Name(llList2Key(pData, 1)) == llList2String(pData, 0)) dList += llList2Key(pData, 1); @next_line; dQuery = llGetNotecardLine("DJ List", ++dLine); } } }