-
Posts
351 -
Joined
-
Last visited
Content Type
Forums
Blogs
Knowledge Base
Everything posted by Ron Khondji
-
You could even skip the ´if else´ and just do: llSetLinkAlpha(llDetectedLinkNumber(0), flip = !flip, ALL_SIDES);
-
Or do you maybe close the listen at the beginning of the listen event. In that case you have to re-open it for the script to be able to hear the dialog.
-
Lessening amount of scripts in wings
Ron Khondji replied to Vehementi Nacon's topic in LSL Scripting
To find the names of prims in a linkset you can use llGetLinkName(). To later do someting to prims with specific names, you can put their linknumbers in a list. Like: list LinkNums;default { state_entry() { integer i; while ( ++i <= llGetNumberOfPrims() ) { if ( llToLower( llStringTrim( llGetLinkName( i), STRING_TRIM ) ) == "prim name" ) LinkNums += [i]; } }} -
Need help with a Quote on Touch Script.
Ron Khondji replied to Sky Linnaeus's topic in LSL Scripting
I made this litle quote script once: string NoteName;integer Lines;key count;key quote;default { state_entry() { NoteName = llGetInventoryName(INVENTORY_NOTECARD,0); count = llGetNumberOfNotecardLines(NoteName); } touch_start(integer total_number) { integer line = (integer)llFrand(Lines); quote = llGetNotecardLine(NoteName, line); } dataserver( key query_id, string data) { if(query_id == count) Lines = (integer)data; else if (query_id == quote) { string name = llGetObjectName(); llSetObjectName(" "); llSay (0, data); llSetObjectName(name); } } changed(integer change) { if (change & CHANGED_INVENTORY) llResetScript(); }} It uses less memory as it does not use a list to store all the notecard lines. Allthough I don´t really know if the use of the dataserver at every touch might be worse -
The script was original made without collision events. If you change the "collision_start()" and "collision_end()" to "touch_start()" and "touch_end()" the owner can toggle the fire on or off with a touch and the menu (hud) only appears after the owner touches the thing for longer then a second. Which is as it was intended.
-
So you want the time and a seperate status. I would just a global variable for the status and do: string status;string ts2Days(integer unixExpiration) { integer seconds = unixExpiration - llGetUnixTime(); integer weeks = seconds / 604800; integer days = (seconds % 604800) / 86400; integer hours = (seconds % 86400) / 3600; integer mins = (seconds % 3600) / 60; string time = ""; if (weeks) { time += (string)weeks + " week"; if (~-weeks) time += "s"; time += " "; } if (days) { time += (string)days + " day"; if (~-days) time += "s"; time += " "; } if (hours) { time += (string)hours + " hour"; if (~-hours) time += "s"; time += " "; } if (mins) { time += (string)mins + " min"; if (~-mins) time += "s"; } if (weeks) status = "SUPERB"; else if (days >= 4) status = "OK"; else status = "EXPIRING"; return time;}default { state_entry() { llSay(0, "Rent expires in: " + ts2Days( llGetUnixTime() + (2 * 86400) + (3 * 3600))); llSay(0, "Status is " + status); }}
-
This does what you´re looking for, I think: if (weeks) time += ", SUPERB"; else if (days >= 4) time += ", OK"; else time += ", EXPIRING"; return time;
-
Anyone seen these 500 (server fail) errors lately?
Ron Khondji replied to Jenni Darkwatch's topic in LSL Scripting
Might be because of server changes since april 30. This is from the release notes: Keepalive connections for some HTTP-based servicesThe behavioral change for HTTP connections marks the beginning of support for persistent (keepalive) connections. Services transiting the capabilities router, at ports 12043 and 12046, may honor a request for keepalives and keep a connection open after request completion. These services may include such activities as texture and mesh fetching, event delivery to viewer, HTTP-In for LSL scripts, asset uploads and inventory operations. Benefits from keepalives include immediate and future throughput increases and less TCP connection churn (which often disrupts consumer-grade networking equipment). The exact set of services that will see this is expected to change over time. I believe I read somewhere that users might see more 500 errors resulting from those changes. -
Help with and changing "Repeats Horiz & Vert" and Changing them
Ron Khondji replied to joeyblueyes's topic in LSL Scripting
Each element of a vector can be accessed individually by appending .x, .y, or .z to the variable name. So... vector repeats;list params = llGetPrimitiveParams([PRIM_TEXTURE,0]);repeats = llList2Vector(params, 1);repeats = <0.5, repeats.y, repeats.z>;llSetPrimitiveParams([ PRIM_TEXTURE, 0, llList2String(params, 0), repeats, llList2Vector(params, 2), llList2Float(params, 3) ] should work. I think. -
else if(msg = "LIGHTHIGH") You´re missing a "=" there.
-
Menu Color Changer Script:: Any Help Appreciated
Ron Khondji replied to AnnieBumbleclaw's topic in LSL Scripting
There´s a "Dynamic Multi-page Dialog (AKA Pagination)" function, made by Void, in the library. -
No Notecard Writing in LSL is Driving me Crazy
Ron Khondji replied to Shivan Zhang's topic in LSL Scripting
llGetPrimitiveParams returns a list. So you have to do something like: dilithium_amount = (integer)llList2String(llGetPrimitiveParams( [ PRIM_DESC ]), 0); -
No Notecard Writing in LSL is Driving me Crazy
Ron Khondji replied to Shivan Zhang's topic in LSL Scripting
And why do you think scripts can only have 1 listen. -
Dialog, PikkuBot, llInstantmessage....Where's my Advil...
Ron Khondji replied to Kiran Steamweaver's topic in LSL Scripting
I think you should edit your posts to remove the UUID´s from the scripts. If they are real that is. Otherwise people might start messing with your bot. Or did I just give someone a bad idea :matte-motes-agape: -
ghost avatars stuck on teleport beam
Ron Khondji replied to Hills90210 Beverly's topic in LSL Scripting
Could it be because of the 'interest list improvement project' that went live on the whole grid on 2013-02-20? -
Glow on command script (with slight alteration.)
Ron Khondji replied to Shrouded Kytori's topic in LSL Scripting
If I were to try to make something like this I would put a number to represent the alert level in the description of a prim in a linkset and then use that number to set the glow of that prim if the same number comes up after "alert". Something like this: default { state_entry() { llListen(0, "", llGetOwner(), ""); } listen(integer channel, string name, key id, string message) { list temp = llParseString2List(llToLower(message), [" "], []); if (llList2String(temp, 0) == "alert") { integer i = llGetNumberOfPrims() + 1; while (--i > 0) { llSetLinkPrimitiveParamsFast(i, [PRIM_GLOW, ALL_SIDES, 0.0, PRIM_FULLBRIGHT, ALL_SIDES, FALSE]); if (llList2String(llGetLinkPrimitiveParams(i, [PRIM_DESC]), 0) == llList2String(temp, 1)) { llSetLinkPrimitiveParamsFast(i, [PRIM_GLOW, ALL_SIDES, 0.5, PRIM_FULLBRIGHT, ALL_SIDES, TRUE]); } } } }} -
What would happen if I vote today, then nobody else for the next 24+ hours and then me again? In other words; it would be better to 'update()' the gVOTERS list before checking if somebody is in there.
-
There´s probably a better way, but I would try something like below to turn one prim at a time invisible: integer prim;default{ touch_start(integer num_detected) { llSetTimerEvent(0.1); prim = 1; } timer() { llSetTimerEvent(1.0); llSetLinkAlpha(prim, 0.0, ALL_SIDES); integer i = 1; do { if (i != prim) llSetLinkAlpha(i, 1.0, ALL_SIDES); } while (++i < 4); ++prim; if (prim == 5) llSetTimerEvent(0.0); }} I´m hoping somebody else knows a more elegant way.
-
You probably need a comma between the two lines. list animations = ["Slave01", "leftwrist,top-left ring,rightwrist,top-right ring,leftankle,bottom-left ring,rightankle,bottom-right ring","Slave02", "leftwrist,top-left ring,rightwrist,top-right ring,leftankle,bottom-left ring,rightankle,bottom-right ring"];
-
Texture Switch won't apply by UUID - Help Needed Please
Ron Khondji replied to Ry Elcano's topic in LSL Scripting
A dialog communicates which button was clicked by "saying" the button name on the specified channel. I would put the button names and the texture keys in a list. Like for instance: list buttons = ["vic_101", "vic_102", etc]; list textures = ["uuid", "uuid", etc]; Then in the listen event use llListFindList(buttons, [message]) to find the index of the buttonname in the buttons list and set the texture with llList2Key(textures, index). This way you can also use the buttons list in the llDialog(). -
If you set "Teleport Routing" to "Anywhere", people should arrive at the coordinates in the slurl instead of at the landing point.
-
Instaed of llKey2Name you could use llGetDisplayName.
-
Best Way To Retrieve Data From PHP Script
Ron Khondji replied to joniveehernandez's topic in LSL Scripting
It is just one possible way to get html on a prim. You could also just create some webpage on some server somewhere and display that on a prim face. That way there´s no need for any script. Just add the media under the texture tab in edit mode. -
Best Way To Retrieve Data From PHP Script
Ron Khondji replied to joniveehernandez's topic in LSL Scripting
With llSetPrimMediaParams you can build arbitrary html in your LSL script and display it on the face of the prim. See what used to be Kelly Linden´s LSL hacks wiki page. -
Something like this is what you´re looking for: list colors = [ <0.0, 0.0, 1.0>, // blue <1.0, 0.0, 0.0>, // red <0.0, 1.0, 0.0>, // green <1.0, 1.0, 0.0> // yellow ];integer count;default { touch_end(integer total_number) { llSetColor(llList2Vector(colors, count), ALL_SIDES); ++count; if (count >= llGetListLength(colors)) count = 0; }}