X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=huffware%2Fhuffotronic_tools_n_testers_v6.5%2Fdie_on_demand_v0.3.txt;fp=huffware%2Fhuffotronic_tools_n_testers_v6.5%2Fdie_on_demand_v0.3.txt;h=b0d5a44a9697b161e282c298a60ccdbd84ec380c;hb=ef90e9104684f535e8a5edef643f008592254019;hp=0000000000000000000000000000000000000000;hpb=8bca8b4404ce2236359f100b97b1d10abb1b94bb;p=feisty_meow.git diff --git a/huffware/huffotronic_tools_n_testers_v6.5/die_on_demand_v0.3.txt b/huffware/huffotronic_tools_n_testers_v6.5/die_on_demand_v0.3.txt new file mode 100755 index 00000000..b0d5a44a --- /dev/null +++ b/huffware/huffotronic_tools_n_testers_v6.5/die_on_demand_v0.3.txt @@ -0,0 +1,34 @@ + + +// huffware script: die on demand, by fred huffhines. +// +// a super simple script that merely makes an object subject to self-termination +// if it is told a secret phrase. +// +// this script is licensed by the GPL v3 which is documented at: http://www.gnu.org/licenses/gpl.html +// do not use it in objects without fully realizing you are implicitly accepting that license. +// + +////////////// +// API for the die on demand feature. saying the message below on the channel +// referenced will cause any listening object to zap itself out of the grid. +string DIE_ON_DEMAND_MESSAGE = "die-on-demand"; +integer DIE_ON_DEMAND_CHANNEL = 4826; +////////////// + +default +{ + state_entry() + { + llListen(DIE_ON_DEMAND_CHANNEL, "", NULL_KEY, "die-on-demand"); + } + + listen(integer channel, string name, key id, string message) { + if ( (channel == DIE_ON_DEMAND_CHANNEL) + && (llGetOwnerKey(id) == llGetOwnerKey(llGetKey())) + && (message == DIE_ON_DEMAND_MESSAGE) ) { + llWhisper(0, "removing object."); + llDie(); + } + } +}