Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- key gOwnerKey;
- integer gNaniteLightsChannel;
- integer isVector(string testString)
- {
- list tempList = llParseString2List(testString, [" "], ["<", ">", ","]);
- if (llGetListLength(tempList) != 7)
- {
- return FALSE;
- }
- else
- {
- if (((string)((vector)testString) == (string)((vector)((string)llListInsertList(tempList, ["-"], 5)))) == FALSE)
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
- }
- }
- setNaniteColor(vector colorVector, integer linkNumber)
- {
- llSetLinkColor(linkNumber, colorVector, ALL_SIDES);
- if (colorVector == ZERO_VECTOR)
- {
- llSetLinkPrimitiveParamsFast(linkNumber, [PRIM_GLOW, ALL_SIDES, 0]);
- }
- else
- {
- llSetLinkPrimitiveParamsFast(linkNumber, [PRIM_GLOW, ALL_SIDES, 0.05]);
- }
- }
- default
- {
- state_entry()
- {
- gOwnerKey = llGetOwner();
- gNaniteLightsChannel = -1 - (integer)("0x" + llGetSubString((string)gOwnerKey, -7, -1)) + 106;
- llListen(gNaniteLightsChannel, "", "", "");
- llRegionSayTo(gOwnerKey, gNaniteLightsChannel, "color-q");
- llSetMemoryLimit(llGetUsedMemory() + 5120);
- }
- on_rez(integer sp)
- {
- llResetScript();
- }
- listen(integer channel, string name, key id, string message)
- {
- if (llGetOwnerKey(id) == gOwnerKey)
- {
- llWhisper(0, message);
- if (message == "on" || message == "bolts off" || message == "charge stop")
- {
- llRegionSayTo(gOwnerKey, gNaniteLightsChannel, "color-q");
- }
- else if (message == "off")
- {
- setNaniteColor(ZERO_VECTOR, LINK_THIS);
- }
- else if (message == "bolts on")
- {
- setNaniteColor(<1, 0, 0>, LINK_THIS);
- }
- else if (message == "charge start")
- {
- setNaniteColor(<0, 1, 0>, LINK_THIS);
- }
- else if (llGetSubString(message, 0, 5) == "color ")
- {
- list c = llParseString2List(message, [" "], []);
- vector color = <(float)llList2String(c, 1), (float)llList2String(c, 2), (float)llList2String(c, 3)>;
- if (isVector((string)color))
- {
- setNaniteColor(color, LINK_THIS);
- }
- }
- }
- }
- }
- // Alicia
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement