Jump to content

Xiija

Resident
  • Posts

    909
  • Joined

  • Last visited

Everything posted by Xiija

  1. also this mebbe? http://community.secondlife.com/t5/LSL-Library/Move-a-childprim-along-an-axis-of-the-root-prim-like-a-beam/td-p/1825275
  2. is there any help amywhere on using Json? i've tried the web, the wiki, and am still lost. i am trying to do this: 1. an array of voters- 2. and array of votes for each voter i've got the voters array with: Jvote = llList2Json( JSON_ARRAY, ["VOTERS"]); and added names with: name = llDtetectedName(0); Jvote += llList2Json( JSON_ARRAY, [name] ); but do not know how to add the votes to the name in the Json list? (in this project, people will have 20 items in their vote array) any examples on how to add to an array, or how to use json indexes would be great, ty
  3. string message = "Here is a photo."; string item = "Photo1"; key id = "XXX-XXX-XXX-XXX"; string name = "Jo Bloggs"; default { touch_start(integer total_number) { key toucher = llDetectedKey(0); if(toucher == id) { llGiveInventory(toucher, item); llInstantMessage(toucher, message); } else { llSay(0,"You are not " + name); } } }
  4. could you use a sensor & use llReturnObjectsByOwner http://wiki.secondlife.com/wiki/LlReturnObjectsByOwner if they are not in the group or on a whitelist?
  5. here is a particle script that will draw a line between 2 things, you can mod it to your needs just put this in one prim, and put the target's KEY in the script key target = " (put the key here) " ; (the key I used in the script is yours ) //// "Laser" PARTICLE TEMPLATE v2 - by Jopsy Pendragon - 4/19/2008//// You are free to use this script as you please, so long as you include this line://** The original 'free' version of this script came from THE PARTICLE LABORATORY. **//integer AUTO_START = TRUE; // Optionally FALSE only if using CONTROLLERS.list particle_parameters=[]; // stores your custom particle effect, defined belowkey target = "dfcea458-142e-4b67-abed-f1d3f87ed9ae";default { state_entry() { particle_parameters = [ // start of particle settings // Texture Parameters: PSYS_SRC_TEXTURE, llGetInventoryName(INVENTORY_TEXTURE, 0), PSYS_PART_START_SCALE, <0.051, 1.0, FALSE>, PSYS_PART_END_SCALE, <0.05, 1.0, FALSE>, PSYS_PART_START_COLOR, <1.00,.25,.25>, PSYS_PART_END_COLOR, <.75,0.00,0.00>, PSYS_PART_START_ALPHA, (float) 1.0, PSYS_PART_END_ALPHA, (float) .5, // Production Parameters: PSYS_SRC_BURST_PART_COUNT, (integer) 5, PSYS_SRC_BURST_RATE, (float) 0.1, PSYS_PART_MAX_AGE, (float) 2.0, // PSYS_SRC_MAX_AGE, (float) 0.00, PSYS_SRC_TARGET_KEY, target, // Placement Parameters: PSYS_SRC_PATTERN, (integer) 4, // 1=DROP, 2=EXPLODE, 4=ANGLE, 8=CONE, // Placement Parameters (for any non-DROP pattern): PSYS_SRC_BURST_SPEED_MIN, (float) 0.00, PSYS_SRC_BURST_SPEED_MAX, (float) 5.0, // PSYS_SRC_BURST_RADIUS, (float) 00.00, // Placement Parameters (only for ANGLE & CONE patterns): PSYS_SRC_ANGLE_BEGIN, (float) 0.00 * PI, PSYS_SRC_ANGLE_END, (float) 0.00 * PI, // PSYS_SRC_OMEGA, <00.00, 00.00, 00.00>, // After-Effect & Influence Parameters: PSYS_SRC_ACCEL, < 00.00, 00.00, 00.0>, // PSYS_SRC_TARGET_KEY, (key) llGetLinkKey(llGetLinkNumber() + 1), PSYS_PART_FLAGS, (integer) ( 0 // Texture Options: | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK | PSYS_PART_EMISSIVE_MASK | PSYS_PART_FOLLOW_VELOCITY_MASK // After-effect & Influence Options: // | PSYS_PART_WIND_MASK // | PSYS_PART_BOUNCE_MASK // | PSYS_PART_FOLLOW_SRC_MASK // | PSYS_PART_TARGET_POS_MASK | PSYS_PART_TARGET_LINEAR_MASK ) //end of particle settings ]; if ( AUTO_START ) llParticleSystem( particle_parameters ); }}
  6. I also use a toggle, to keep others from closing a listen that is being used by the original toucher..... touch_start(integer num_detected) { ToucherID = llDetectedKey(0); if(tog == 1){llSay(0,"In Use"); } else { tog = 1; llListenRemove(listenHandle); // It doesn't matter if we try closing an already closed, or non-existent listener listenHandle = llListen(dialogChannel, "", ToucherID, ""); llDialog(ToucherID, dialogInfo, buttons, dialogChannel); llSetTimerEvent(60.0); // Here we set a time limit for responses } } // then reset the toggle when the listen is closed, and in the timer // this allows only one user at a time, if you needed more, you could // open a new listener and add one to the channel after comparing // id's ?
  7. llSetLinkPrimitiveParamsFast(LINK_SET, [PRIM_COLOR, ALL_SIDES, <1.0, 0.0, 0.0>, 1.0]);
  8. would the last example on this page be usable with modification? http://wiki.secondlife.com/wiki/LlGetBoundingBox
  9. this will give you a variable called "speed", which you can change if you need to.... to rotate in the oposite direction, change the end part to ...speed*-TWO_PI default{ state_entry() { float speed = 0.05; llSetTextureAnim(ANIM_ON | SMOOTH | ROTATE | LOOP, ALL_SIDES,1,1,0, TWO_PI, speed*TWO_PI); }}
  10. something like this...? this will send a clickable TP link to the object every 30 seconds.. you could make a list and a toggle to only be notified once per obj tho vector pos;integer num;string region;integer k;key id;default{ state_entry() { region = llEscapeURL( llGetRegionName() ); } touch_start(integer obj) { id = llDetectedKey(0); if(id == llGetOwner() ) { k = !k; if(k) { llOwnerSay("ON"); llSensorRepeat("SPECIAL OBJECT", "",PASSIVE|ACTIVE, 20.0, PI, 30.0); } else { llOwnerSay("OFF"); llSensorRemove();} } } sensor(integer num_detected) { num = num_detected; integer i; for(i = 0; i < num_detected; i++) { pos = llDetectedPos(i); llInstantMessage( llGetOwner(), "\nClick link below to Teleport to SPECIAL OBJECT \n secondlife:///app/teleport/" + region + "/"+(string)llRound(pos.x)+ "/" +(string)llRound(pos.y)+ "/" +(string)llRound(pos.z)); } } no_sensor() { llOwnerSay ("No SPEICAL OBJECT's found in " + (string)num + " objects!"); }}
  11. I rent at Miriam Chung estates....i'm not premium. you buy the land for 49L$, and pay the weekly tier to a rentbox. this gives you land rights, just like you would have as a premium member.
  12. vector pos = llGetPos(); vector Target = Nface; llRotLookAt( llRotBetween( <-1.0, 0.0, 0.0>, llVecNorm( <Target.x, Target.y, pos.z> - pos ) ) , 1.0, 0.5 ); // choose which face to use with <-1.0, 0.0, 0.0> (this is negative x) // <0.0, 1.0, 0.0> (this is positive y)
  13. tried the corallary but had to change it a bit? integer test = 5; integer q; list listy = [3,3,4,5,2,1,6,5,3,5,5,2,3,2,1,5,5,3,2,2,5,5,5,5,2,1,1,3,3,5]; list replacement = ["five gone."]; while (~q = llListFindList(listy,[test])) listy = llListReplaceList(listy,replacement,q,q) ; llSay(0, llList2CSV(listy)); btw: ty for these...great work
  14. Kayla, I've copy/pasted this inworld, and tested with my alt, and it seems to work fine...very odd. you have to type " listaccess" and not " list access" etc...andt all commands are not parsed to lower...so typing "First" will not work...you have to type it lowercase. (you could modify the script to change all incoming messages to lowercase) http://wiki.secondlife.com/wiki/LlToLower and, i too find that looking at scripts and modifying them actually helps
  15. // Lockble Door Script v1.1 by Prospero Frobozz// lockabledoor.lsl is Copyright © 2007 Prospero Frobozz//// This script is free software, available under the GNU GPL version 2.// You are free to use it, modify it, or distribute it. If you distribute// this script or any modified versions, they must also be under the GNU GPL.// This means that the script itself must be mod/copy/transfer. Objects that// use the script, or other components of such objects, do not themselves need// to be mod/copy/transfer, but the script, or any other scripts derived from// it, must. In addition, the full text of the GNU GPL (in Notecard "GNU GPL// v2") must be included whenever this script or any script derived from this// script is distributed.// Voice commands are:// /6 lock// /6 unlock// /6 listaccess// /6 adduser Firstname Lastname// /6 deluser Firstname Lastname// substitute the control channel for 6 in all of the above.// CONFIGURATION -- set the variables belowinteger controlchannel=6;list accesslist;integer locked=0;integer checkaccess(string whoname,key whokey) { integer ok; integer length; integer i; if (whokey==llGetOwner()) { ok=1; } else { length=llGetListLength(accesslist); for (i=0 ; (!ok) && i<length ; ++i) { if (whoname==llList2String(accesslist,i)) { ok=1; } } } return ok; }vector pos;//Base Postionvector end;//Target Positionkey owner;default{ state_entry() { owner=llGetOwner(); accesslist += owner; pos=llGetPos(); llListen(controlchannel,"",NULL_KEY,""); } listen(integer chan,string name,key id,string message) { integer ok; integer length; integer i; string response; string val; list commands; integer dex; ok=checkaccess(name,id); if (!ok) return; commands=llParseString2List(message,[" "],[]); if (llGetListLength(commands)<1) return; length=llGetListLength(accesslist); response=""; if (message=="listaccess") { response="Access granted to: "; for (i=0 ; i<length ; ++i) { response+=llList2String(accesslist,i); if (i < (length - 1)) response+=" "; } } else if (llList2String(commands,0)=="adduser") { if (llGetListLength(commands)>=3) { val=llList2String(commands,1); val+=" "; val+=llList2String(commands,2); dex=-1; for (i=0 ; i<length ; ++i) { if (val==llList2String(accesslist,i)) dex=i; } if (dex>=0) { response="Already in access list: "+val; } else { accesslist+=val; response="Added to access list: "+val; } } } else if (llList2String(commands,0)=="deluser") { if (llGetListLength(commands)>=3) { val=llList2String(commands,1); val+=" "; val+=llList2String(commands,2); dex=-1; for (i=0 ; i<length ; ++i) { if (val==llList2String(accesslist,i)) dex=i; } if (dex>=0) { accesslist=llDeleteSubList(accesslist,dex,dex); response="Removed from access list: "+val; } } } else if (message=="lock") { locked=1; response="Elevator locked."; } else if (message=="unlock") { locked=0; response="Elevator unlocked."; } else if(message == "align") { pos=llGetPos(); llSetStatus(STATUS_PHYSICS,TRUE); llMoveToTarget(pos,1.5); llSetTimerEvent(5); } else if(message =="first") { if(locked == 0) { end=pos; llSetStatus(STATUS_PHYSICS,TRUE); llMoveToTarget(end,1.5); llSetTimerEvent(5); } else {llSay(0,"Elevator is Locked"); } } else if(message=="second") { if(locked == 0) { end=pos+<0,0,3.50>; llSetStatus(STATUS_PHYSICS,TRUE); llMoveToTarget(end,1.5); llSetTimerEvent(5); } else {llSay(0,"Elevator is Locked"); } } if (response!="") llSay(0,response); } timer() { llSetStatus(STATUS_PHYSICS,FALSE); llSetTimerEvent(0); } }
  16. make a new list from all the numbers in your main list using http://wiki.secondlife.com/wiki/LlList2ListStrided then sort the new list from lowest to highest using http://wiki.secondlife.com/wiki/LlListSort then divide the list length (-1) by 2 to get a half way point. ex: your list length is 12 (-1 = 11).....halfway is 5 random number between 0-11 is the index for the list. (remember to subtract 1 from the list length..a list of 12 is indexed 0-11) if your random number is greater than the halfway point...give the prize, if not, roll a second time and give the prize to who ever wins? this would make lower numbers have to roll twice? whatever index is used for the winning pick, get the value at that index in your new list and compare it to the mainlist using llListFindList( mainlist, [winning number]) and get the key associated with that number...
  17. Message linked will only work if your 2 objects are linked...are they? also, a listen will only work if you turn one on... in your second script you need... state_entry() { llListen(0, "", "", ""); } to combine the scripts, you could put the script in the body object and use llDetectedLinkNuber(0) in the touch event to see what link was clicked? http://wiki.secondlife.com/wiki/LlDetectedLinkNumber
  18. this will count everything -minus 1 for the script integer inv;default{ state_entry() { inv = llGetInventoryNumber( INVENTORY_ALL ); inv = inv -1; llSetText((string)inv + " Items Availble", <0.0, 1.0, 0.0>, 1.0 ); } changed(integer change) { if (change & CHANGED_INVENTORY) { inv = llGetInventoryNumber( INVENTORY_ALL ); inv = inv -1; llSetText((string)inv + " Items Availble", <0.0, 1.0, 0.0>, 1.0 ); } }}
  19. use a script with Take Controls... and in the control event something like this...? if(level & CONTROL_FWD) { if(llGetAgentInfo(llGetOwner()) & AGENT_WALKING) {llApplyImpulse(<-1,0,0>,TRUE);} }
  20. this is closer...but not quite there... it works forward, but not backwards arg list names = ["John Smith","Shymus Roffo","Some Person","Cool Kid","Second Life","Linden Lab"]; list links4txt = [5,4,3,2]; llSetLinkText(integer ln, string t, vector c) { // LinkNumber,Text,Color llSetLinkPrimitiveParamsFast(ln,[PRIM_TEXT,t,c,1]); } ffUpdateDisplay(integer pos,integer active) { end = index + 3; display = llList2List(names, index, end); //llOwnerSay(llDumpList2String(display, ",")); llOwnerSay(llList2String(names,pos)); // llOwnerSay(" j is" + (string)pos); integer i; for(i=0; i< prims; i++) { if(pos > 3 ){pos = 3;} // if(pos < 2 ){pos = 2;} if(i == pos) { llSetLinkText(llList2Integer(links4txt,i),llList2String(display,i),<1,0.5,0.5>); echo = llList2String(display,i); } else llSetLinkText(llList2Integer(links4txt,i),llList2String(display,i),<1,1,1>); } llSetText("Index: " + (string)index + "\n Position: "+(string)pos,<1,1,1>,1); } integer len; integer index; integer end ; integer prims ; integer j; list display; string echo; default { state_entry() { end = index + 3; len = llGetListLength(names); prims = llGetListLength(links4txt); display = llList2List(names, index, end); // llOwnerSay("namelist len " + (string)len); } touch_start(integer n) { if(llDetectedKey(0) == llGetOwner()) { string name = llGetLinkName(llDetectedLinkNumber(0)); if(name == "forward") { j++; if(j == len ) { j = 0;index = 0;} if(j > end ) { ++index;} ffUpdateDisplay(j,j); } else if(name =="backward") { j--; if(j < 0) { j = 5; index = 2;} if(j < index ) { --index;} ffUpdateDisplay(j,j); } else if(name =="Some Object") { llSay(0,"echoing : " + echo); } } } }
  21. list AnimList; list getInventoryList(){ list result = []; integer n = llGetInventoryNumber(INVENTORY_ANIMATION); while(n) result = llGetInventoryName(INVENTORY_ANIMATION, --n) + result; return result;}default{ state_entry() { AnimList = getInventoryList(); } touch_start(integer total_number) { string temp = llDumpList2String(AnimList, "\n"); llSay(0,"Animations :\n" + temp); } } a menu button which, when touched says the anims in Inventory? to actually use them you would need a dialog menu i think?
  22. integer chan = -5;list buttons;integer listen_handle;string firstname;default{ state_entry() { buttons = ["Pet","Feed","Play","Close"]; llSetObjectName(""); } touch_start(integer total_number) { key id = llDetectedKey(0); string name = llKey2Name(id); firstname = llGetSubString(name,0,llSubStringIndex(name," ")); llDialog(id,"choose an action",buttons,chan); listen_handle = llListen(-5, "","", ""); llSetObjectName("The Animal"); llInstantMessage( llGetOwner(), "Touched by :" + name ); llSetObjectName(""); } listen( integer chan, string name, key id, string mess ) { if(mess == "Pet") { llSay(0,"The Dog smiles as " + name + " scratches it behind the ears "); llDialog(id,"choose an action",buttons,chan); llSetTimerEvent(20); } if(mess == "Feed") { llSay(0,name + " throws the dog a bone "); llDialog(id,"choose an action",buttons,chan); llSetTimerEvent(20); } if(mess == "Play") { llSay(0,name + " plays with the dog! "); llDialog(id,"choose an action",buttons,chan); llSetTimerEvent(20); } if(mess == "Close") { llListenRemove(listen_handle); } } timer() { llListenRemove(listen_handle); llSetTimerEvent(0); }}
  23. just change a few parts in the script... change.... llInstantMessage( llGetOwner(), "Someone touched me" ); to llInstantMessage( llGetOwner(), "Touched by :" + name ); and change ..: llSay(0,firstname + " scratches the dog behind the ears "); to llSay(0,"The Dog smiles as " + name + " scratches it behind the ears "); yellow text is viewer side and cannot be changed unless your viewr lets you... i.e. in firestorm its under Avatar>preferences>colors
×
×
  • Create New...