b0d5a44a9697b161e282c298a60ccdbd84ec380c
[feisty_meow.git] / huffware / huffotronic_scripts / die_on_demand_v0.3.txt
1 
2
3 // huffware script: die on demand, by fred huffhines.
4 //
5 // a super simple script that merely makes an object subject to self-termination
6 // if it is told a secret phrase.
7 //
8 // this script is licensed by the GPL v3 which is documented at: http://www.gnu.org/licenses/gpl.html
9 // do not use it in objects without fully realizing you are implicitly accepting that license.
10 //
11
12 //////////////
13 // API for the die on demand feature.  saying the message below on the channel
14 // referenced will cause any listening object to zap itself out of the grid.
15 string DIE_ON_DEMAND_MESSAGE = "die-on-demand";
16 integer DIE_ON_DEMAND_CHANNEL = 4826;
17 //////////////
18
19 default
20 {
21     state_entry()
22     {
23         llListen(DIE_ON_DEMAND_CHANNEL, "", NULL_KEY, "die-on-demand");
24     }
25     
26     listen(integer channel, string name, key id, string message) {
27         if ( (channel ==  DIE_ON_DEMAND_CHANNEL)
28             && (llGetOwnerKey(id) == llGetOwnerKey(llGetKey()))
29             && (message == DIE_ON_DEMAND_MESSAGE) ) {
30             llWhisper(0, "removing object.");
31             llDie();
32         }
33     }
34 }