/////////////////////////////////////////////////////////////////////////// // 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 height of the board. integer BOARD_HEIGHT = 10; // Set this to the width of the board. integer BOARD_WIDTH = 10; ////////////////////////////////////////////////////////// // INTERNALS // ////////////////////////////////////////////////////////// key _owner = NULL_KEY; integer comChannel = 0; default { state_entry() { _owner = llGetOwner(); comChannel = ((integer)("0x"+llGetSubString((string)llGetOwner(),-8,-1)) & 0x3FFFFFFF) ^ 0xBFFFFFFF; llListen(0, "", llGetOwner(), ""); } listen(integer channel, string name, key id, string message) { integer itra = BOARD_HEIGHT*BOARD_WIDTH; string pld = ""; do { pld += (string)(itra+1) + "," + llGetSubString(message, itra, itra) + ","; } while(--itra>=0); llWhisper(comChannel, pld); } link_message(integer sender_num, integer num, string str, key id) { if(id != "bcst") return; llWhisper(comChannel, (string)num + "," + str); } on_rez(integer param) { _owner = llGetOwner(); } changed(integer change) { if(change & CHANGED_OWNER) { _owner = llGetOwner(); } } }