/////////////////////////////////////////////////////////////////////////// // 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 // ////////////////////////////////////////////////////////// // This represents the value of one item in the // dispenser. Please set this to some sensible non-zero // value or the script will not proceed. integer PRICE = 10; /////////////////////////////////////////////////////////////////////////// // END CONFIGURATION // /////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // The following is an import function from Void Singer. The original URL: // // http://wiki.secondlife.com/wiki/Stamp2UnixInt and // ///////////////////////////////////////////////////////////////////////////// /*//-- Anti-License Text --//*/ /*// Contributed Freely to the Public Domain without limitation. //*/ /*// 2009 (CC0) [ http://creativecommons.org/publicdomain/zero/1.0 ] //*/ /*// Void Singer [ https://wiki.secondlife.com/wiki/User:Void_Singer ] //*/ /*//-- --//*/ list uUnix2StampLst( integer vIntDat ){ if (vIntDat / 2145916800){ vIntDat = 2145916800 * (1 | vIntDat >> 31); } integer vIntYrs = 1970 + ((((vIntDat %= 126230400) >> 31) + vIntDat / 126230400) << 2); vIntDat -= 126230400 * (vIntDat >> 31); integer vIntDys = vIntDat / 86400; list vLstRtn = [vIntDat % 86400 / 3600, vIntDat % 3600 / 60, vIntDat % 60]; if (789 == vIntDys){ vIntYrs += 2; vIntDat = 2; vIntDys = 29; }else{ vIntYrs += (vIntDys -= (vIntDys > 789)) / 365; vIntDys %= 365; vIntDys += vIntDat = 1; integer vIntTmp; while (vIntDys > (vIntTmp = (30 | (vIntDat & 1) ^ (vIntDat > 7)) - ((vIntDat == 2) << 1))){ ++vIntDat; vIntDys -= vIntTmp; } } return [vIntYrs, vIntDat, vIntDys] + vLstRtn; } ///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// // INTERNALS // /////////////////////////////////////////////////////////////////////////// list items = []; list buyers = []; default { state_entry() { if(!PRICE) { llOwnerSay("The price is set to 0, please edit the script and set a price in the configuration section."); return; } integer itra; for(itra=0, items = []; itra, 1); state vend; } } } state vend { state_entry() { llSetPayPrice(PRICE, (list)PRICE); } touch_start(integer num) { if(llDetectedKey(0) != llGetOwner()) return; integer itra; llOwnerSay("====== BUYERS ======"); for(itra=0; itra, 1); } }