Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Key 2 Channel
- This script demonstrates how to create a channel from a key. This can be the object key as demonstrated here, or any other key.
- Another feature of this script is the use of an application key to made scripts unique to one certain set. By using the bitwise XOR (the ^ operator) we can "salt" the channel with an integer unique to our set of scripts.
- Another upside of this pattern is that the result will always be a negative channel.
- */
- integer giAppId = 38478;
- integer GenerateAppChannel()
- {
- return (integer)(("0x8" + (string)llGetKey())) ^ giAppId;
- }
- default
- {
- touch_start(integer total_number)
- {
- integer iChannel = GenerateAppChannel();
- llSay(iChannel, "Message on channel " + (string)iChannel);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement