Fire On/Off Script

Written by: Headmaster
// OnOffFire -- LSL script to toggle looping animation of fire on and off
//   with spoken commands "ignite fire" and "douse fire"
//
// Uses the free "lit_texture" created by kohne Kato.

// OnOffFire.lsl is Copyright (C) 2007 Prospero Frobozz
//
// This script is free software, available under the GNU GPL version 2.
// You are free to use it, modify it, or distribute it.  If you distribute
// this script or any modified versions, they must also be under the GNU GPL.
// This means that the script itself must be mod/copy/transfer.  Objects that
// use the script, or other components of such objects, do not themselves need
// to be mod/copy/transfer, but the script, or any other scripts derived from
// it, must.  In addition, the full text of the GNU GPL (in Notecard "GNU GPL
// v2") must be included whenever this script or any script derived from this
// script is distributed.

default
{
     state_entry()
     {
         llSetStatus(STATUS_PHANTOM, TRUE);
         llSetTextureAnim (ANIM_ON | LOOP, ALL_SIDES, 4, 4, 0, 0, 15.0);
         llSetTexture("lit_texture", 3);
         llSetTexture("lit_texture", 1);
         llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <1, 0.9, 0.7>, 
                                1.0, 10.0, 0.75]);
         llListen(0,"","","");
     }

     listen(integer number, string name, key id, string message)
     {
        message=llToLower(message);
        if(message=="douse fire")
        {
            llSetTexture("alpha",ALL_SIDES);
            llSetTextureAnim(0, ALL_SIDES, 4, 4, 0, 0, 15.0);
            llSetPrimitiveParams([PRIM_POINT_LIGHT, FALSE, <1, 0.9, 0.7>,
                                    1.0, 10.0, 0.75]);
        }
        else if(message == "ignite fire")
        {
            llSetTextureAnim (ANIM_ON | LOOP, ALL_SIDES, 4, 4, 0, 0, 15.0);
            llSetTexture("lit_texture", 3);
            llSetTexture("lit_texture", 1);
            llSetPrimitiveParams([PRIM_POINT_LIGHT, TRUE, <1, 0.9, 0.7>, 
                                   1.0, 10.0, 0.75]);
        }
    } 
}