Random Hovertext Colour
De DigiWiki.
This script generates a random colour every 0.5 seconds and sets the ?hovertext? of and object to it, the ?hovertext? itself is defined in the script.
// Created by Kopilo Hallard on 4th March 2007 // sets the ?hovertext? of an object to a random colour every 0.5 seconds // Copyright (C) 2007 Kopilo Hallard // text for the hover text string TXT = "default text"; //Simply change ?default text? to what you wish the hovertext to be. // *********** License Agreement Follows *********************** // 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 2 // 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, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA // 02110-1301, USA. float MIN_GREY = 0.4; //sets the minimum darkness of the text vector colour; //variable to keep the current colour value //Method for changing the colour of the text RandomColour() { //sets three random values between MIN_GREY and 1 to the colour variable colour = (<llFrand(1 - MIN_GREY) + MIN_GREY, llFrand(1 - MIN_GREY) + MIN_GREY, llFrand(1 - MIN_GREY) + MIN_GREY>); } default { state_entry() { llSetTimerEvent(0.5); } timer() { RandomColour(); llSetText(TXT,colour,1); } }


