Myriad Lite Unopposed Test1

// Myriad_Lite_Unopposed_Test_1-v0.0.0-20131026.lsl
// Copyright (c) 2013 by Allen Kerensky (OSG/SL) All Rights Reserved.
// This work is dual-licensed under
// Creative Commons Attribution (CC BY) 3.0 Unported
// http://creativecommons.org/licenses/by/3.0/
// - or -
// Modified BSD License (3-clause)
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright notice, 
//   this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
//   this list of conditions and the following disclaimer in the documentation
//   and/or other materials provided with the distribution.
// * Neither the name of Myriad Lite nor the names of its contributors may be
//   used to endorse or promote products derived from this software without
//   specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
// NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// The Myriad RPG System was designed, written, and illustrated by Ashok Desai
// Myriad RPG System licensed under:
// Creative Commons Attribution (CC BY) 2.0 UK: England and Wales
// http://creativecommons.org/licenses/by/2.0/uk/
 
// CONSTANTS - DO NOT CHANGE DURING RUN
string BASENAME = "Myriad Lite Unopposed Test1"; // base name of this script without version or date
string VERSION = "0.0.0"; // Allen Kerensky's script version
string VERSIONDATE = "20131026"; // Allen Kerensky's script yyyymmdd
 
// Standard Target Numbers
// Myriad RPG System p.19
// 4 = Foolproof
// 5 = Easy
// 6 = Average
// 7 = Tricky
// 8 = Difficult
// 9 = Very Hard
// 11 = Infeasible
// 13 = Superhuman
// 15 = Godlike
// 17 = Impossible
string TARGETNUM = "6";
 
// Statistic to use for the Unopposed Test
// Power, Grace, Intellect, Spirit
// Choose the one that makes sense based on the skill required for the test
string STATISTIC = "Intellect";
 
// Skill to test again
// See Myriad RPG System p.53 for many sample skill ideas
string SKILL = "Geography";
 
// Success Actions Recipes
// These are recipes based on Myriad Lite's Link Message formats. 
// See the Myriad Lite HUD Modules, specifically the WELL module for many examples.
// Replace the | in standard link messages with a ^ for these recipes
// Separate multiple actions with commas
// Keep it short to stay in LSL message length limits
string ONSUCCESS = "OWNERSAY^You passed your Geography test.,OWNERSAY^You are ready for a world trip.";
 
// Success Actions Recipes
// These are recipes based on Myriad Lite's Link Message formats. 
// See the Myriad Lite HUD Modules, specifically the WELL module for many examples.
// Replace the | in standard link messages with a ^ for these recipes
// Separate multiple actions with commas
// Keep it short to stay in LSL message length limits
string ONFAIL = "OWNERSAY^You failed your Geography test.,OWNERSAY^Back to the maps and books.";
 
string UNOPPOSED_TEST;
 
SETUP() {
    llSetText("Easy Intellect/Geography\nUnopposed Test1\nMyriad Lite Preview 7",<1,1,1>,1);
    UNOPPOSED_TEST = "UNOPPOSED_TEST1|"+TARGETNUM+"|"+STATISTIC+"|"+SKILL+"|"+ONSUCCESS+"|"+ONFAIL;
}
 
default {
    state_entry() {
        SETUP();
    }
 
    touch_start(integer num_detected) {
        while (num_detected--) {
            integer chan = (integer)("0x"+llGetSubString(llDetectedKey(num_detected),0,6));
            llRegionSay(chan,UNOPPOSED_TEST);
        }    
    }
}