/* Schneelocke Saarinen's engine script for devices using the Black Gazza power grid. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ integer pwrChan = -139849; // channel used for BG grid communication list devices = []; default { state_entry() { llListen(pwrChan, "", NULL_KEY, ""); } listen(integer channel, string name, key id, string msg) { if(channel == pwrChan) if(msg == "PING") { devices = []; llSetTimerEvent(5); // devices should answer within 5 seconds, right? } else if(msg == "PONG") { devices += [llKey2Name(id)]; } } timer() { llSetTimerEvent(0); llSetText(llDumpList2String(devices, "\n"), <1, 1, 1>, 1.0); } }