Jump to content

Xiija

Resident
  • Posts

    912
  • Joined

  • Last visited

Everything posted by Xiija

  1. 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?
  2. 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); }}
  3. 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
  4. something like....? integer chan = -5;list buttons;integer listen_handle;string firstname;default{ state_entry() { buttons = ["Pet","Feed","Play","Close"]; } 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, "","", ""); llInstantMessage( llGetOwner(), "Someone touched me" ); } listen( integer chan, string name, key id, string mess ) { if(mess == "Pet") { llSay(0,firstname + " scratches the dog behind the ears "); llDialog(id,"choose an action",buttons,chan); llSetTimerEvent(20); } if(mess == "Feed") { llSay(0,firstname + " throws the dog a bone "); llDialog(id,"choose an action",buttons,chan); llSetTimerEvent(20); } if(mess == "Play") { llSay(0,firstname + " 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); }} yell if ya need help with it
  5. hi i'm looking for a working example of the http call? here is what i'm trying, and many other variations... ( the url i'm using plays on my land radio, but does not show info on my song titler, so i * assume* it is v2? ) string url = "http://sl.magnatune.com/Indian/";key HTTPRequest;default{ state_entry() { } touch_start(integer total_number) { HTTPRequest=llHTTPRequest(url + "stats/songtitle/sid=1 HTTP/1.0\nUser-Agent: LSL Script (Mozilla Compatible)\n\n",[],""); } http_response(key k,integer status, list meta, string body) { if(k != HTTPRequest) { llSay(0," nope"); return; } else { llOwnerSay(" got \n" + body); } }} i have also tried HTTPRequest=llHTTPRequest(url + "stats?sid=1 HTTP/1.0\nUser-Agent: LSL Script (Mozilla Compatible)\n\n",[],""); if anyone knows of a v2 station url, could they post it? most of the stations on my radio are responding to the 7.html call
  6. i have tried every way i can think of to get this to work, no one can post a working example, and no one on SHoutcast forums has a clue. luckily the 7.html functionality will be returned with the next shoutcast update, so just hang in there for a bit
  7. ? llMapDestination(region, slurl_vector, ZERO_VECTOR); did you llEscapeURL(region) ?
  8. hmmm it seemed to work okay for me, i tried changing it a little, mebbe try something different... put a toggle to keep them from clicking more than once, and a reset on attatch. _____________________ integer len; integer count; list message; integer tog; default { attach(key id) { if (id) // if attatched to an avatar { llResetScript(); } } state_entry() { // male a list containing the sound uuid's message = ["3bb96018-abd5-45f1-c558-53b759d6cb3e","3883bd53-9704-fc00-5eda-e895158aada2", "2989ab4f-63ea-e822-dc0d-dd3b26acbafe","9ad75b79-8cd3-1839-7ce6-6228a7030b49", "1a7a0da8-cd53-d2e1-e7e0-86e9f1096bf3","4ef0f573-bb3a-c42c-a9d0-8f416db778c2"]; len =llGetListLength(message); integer n; for(n = 0;n < len;++n) // a for loop starts at zero and runs till n equals the numer of items in the list "message" { llPreloadSound( llList2String(message,n) ); } } touch_start(integer total_number) { ++tog; // tog is an integer- it starts at zero...here you add 1 to tog every time touch is clicked if(tog == 1) // this will only be true for the first click.... { llInstantMessage( llDetectedKey(0), "\nReceiving incoming radio message. . . \n[Don't click the radio again or take it off untill it's finished]"); llSetTimerEvent(1); // use a timer...sleep is not a good idea..... if you can avoid it, do so } } timer() { // count is zero here. string msg = llList2String(message,count); // list2string, takes the irtem in the Message list at position "count" llPlaySound( msg,1.0); // play the uuid from the list ++count; // increase the variable "count" for the next timer cycle if(count == len) // if you have increased "count"(run the timer) as many times as you have sounds in the list { count = 0; tog = 0; llSetTimerEvent(0);} // when you have gone thru the whole list of sounds, stop and reset else llSetTimerEvent(10); // restart the timer in 10 seconds } } ETA (Edited To Add) comments ( and fix typos!)
  9. this is a hatch script from somewhere using Key frames. you can mod it from touch to a listen or link message...play with the variables but beware of stack heap when changing "steps" you can rez a box, flatten it, and put this script in it ...will go from flat to 90 deg up hinged on the -X lower edge _______________________________________ float angleEnd = -PI_BY_TWO; float speed=0.2; // m/S float steps=4.0; // number of Key Frames float step=0.0; list KFMlist=[]; vector V; integer open=TRUE; vector basePos; rotation baseRot; float motion_time( float mt) { mt = llRound(45.0*mt)/45.0; if ( mt > 0.11111111 ) return mt; else return 0.11111111; } default { state_entry() { llSetMemoryLimit(0x2000); llSetPrimitiveParams([PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); basePos = llGetPos(); baseRot = llGetRot(); vector v1 = 0.5*llGetScale()*llGetRot(); rotation deltaRot = llEuler2Rot(< 0.0, angleEnd/steps, 0.0>); while ( step < steps ) { V = v1*llAxisAngle2Rot(llRot2Left(llGetRot()), angleEnd*step/steps); V = v1*llAxisAngle2Rot(llRot2Left(llGetRot()), angleEnd*(step+1.0)/steps) - V; KFMlist += [V, deltaRot, motion_time(llVecMag(V)/speed)]; step += 1.0; } } touch_end( integer n) { basePos = llGetPos(); baseRot = llGetRot(); llSetKeyframedMotion( [], []); if ( open ) { llSetPrimitiveParams([PRIM_POSITION, basePos, PRIM_ROTATION, baseRot]); llSetKeyframedMotion( KFMlist, []); } else { llSetKeyframedMotion( KFMlist, [KFM_MODE, KFM_REVERSE]); } open = !open; } on_rez( integer n) { llResetScript(); } } __________________________________
  10. http://wiki.secondlife.com/wiki/LlListen listen_handle = llListen(0, "", llGetOwner(), "");
  11. mebbe this? from the wiki..http://wiki.secondlife.com/wiki/LlParticleSystem PSYS_PART_TARGET_POS_MASK When set, emitted particles change course during their lifetime, attempting to move towards the target specified by the PSYS_SRC_TARGET_KEY rule by the time they expire. Note that if no target is specified, the target moves out of range, or an invalid target is specified, the particles target the prim itself. Particles moving towards a humanoid avatar, specified by PSYS_SRC_TARGET_KEY rule and setting the PSYS_PART_TARGET_POS_MASK flag, will end up at the geometric center of the avatar's bounding box which, unfortunately, make them appear to be striking the person in the groin area. If you want them to end up at another point on a target avatar, you instead have to place a target prim that is moved to the position where you wish them to end up, and use the key of that prim for the value of the PSYS_SRC_TARGET_KEY rule.
  12. http://wiki.secondlife.com/wiki/LlWater
  13. if you want to control your camera, you need to set cam params? http://wiki.secondlife.com/wiki/LlSetCameraParams check camera focus & camera focus locked. and request perms for both.. llRequestPermissions(llGetOwner(), PERMISSION_TAKE_CONTROLS | PERMISSION_CONTROL_CAMERA);
  14. is this something like what you want? changes the scale...then rotates the hud? (from a curtain script- just for testing purposes) (touch is on the main HUD prim-can be moded) vector offset = <0,1,0>; //Prim moves/changes size along this local coordinatefloat hi_end_fixed = FALSE; //Which end of the prim should remain in place when size changes? //The one with the higher (local) coordinate? float min = 0.2; //The minimum size of the prim relative to its maximum sizeinteger ns = 10; //Number of distinct steps for move/size changedefault { state_entry() { offset *= ((1.0 - min) / ns) * (offset * llGetScale()); hi_end_fixed -= 0.5; } touch_start(integer detected) { integer i; do { llSetPrimitiveParams([PRIM_SIZE, llGetScale() - offset, PRIM_POSITION, llGetLocalPos() + ((hi_end_fixed * offset) * llGetLocalRot())]); } while ((++i) < ns); offset = - offset; float move = 90/ns; integer j; do { llSetPrimitiveParams([PRIM_ROT_LOCAL,llGetLocalRot() * llEuler2Rot(<0,0,-move>*DEG_TO_RAD)]); } while ((++j) < ns); }}
  15. depends on what yur HUD is like.. you could put all the commands on your HUD and you can use : llDetectedTouchFace ..... http://wiki.secondlife.com/wiki/LlDetectedTouchFace or llDetectedLinkNumber .... http://wiki.secondlife.com/wiki/LlDetectedLinkNumber and when the touch happens on the HUD, you send the chat to run your function? ex: (the button for reload is link number 3, your gun listens on channel -9) ---------------------(in the touch event of your HUD)----------- integer Link = llDetectedLinkNumber(0); if(Link == 3) { llSay(-9,"reload"): }
  16. mebbe use a free vendor script and alter it to say the chat, and play the sound ? http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryVendor
  17. some ideas: set up a listen in your state entry and define a channel for the textbox key person = " preson to IM's key goes here"; in the touch_start event you need . id = llDetectedKey(0); name = llDetectedName(0); llTextBox(id, "send Instant Message":,channel) ; in the listen event : llInstantMessage(person,"\nFrom: " + name + "\n" + msg); or something like that? this should opeen a textbox, and have the message sent to whoever you have defined as ......person(see above)
  18. put state default : in the timer event mebbe?
  19. As far as i know, SL has no record option, and the limit for an object's sound file is 10 seconds.. you could mebbe open a web page that has a sound recorder on it?...dunno....
  20. this is just basic direction based on zero rotation, you can mod it to fit your needs? ...you would probably use a timer instead of a touch event , mebbe check llGetAgentInfo for walking? default{ state_entry() { } touch_start(integer total_number) { vector angle = llRot2Euler(llGetRot()); float z = angle.z; if(z >= - PI_BY_TWO && z <= PI_BY_TWO ) { llOwnerSay(" forward"); llPlaySound("open",1.0); } else { llOwnerSay(" backward"); llPlaySound("close",1.0); } }} eta: oops, dunno why i thought it was for an attatchment
  21. I've noticed that my viewer seems to change the lighting depending on distance. I made a lightning flash prim, and if you are close to it, it works fine, but if you move away from the prim, the viewer renders the flashes of lightning as a solid pulse of light....very odd...
  22. Ah...mkay, gotcha sorry, i use these forums to try and learn how to script, and I can't thank you all enuff for all the help and advice you give here is what i did with your scripts, this uses instant message to Owner so i could test it by leaving my sim..this part can be deleted after you test it. .this script clears the name lists every timer cycle, and de Rez's only once when there are no "friends" around. it uses UUID's from a notecard so you can add as many as you need. list gMyFriends = [];integer gStillHere;string CurrNC;key nameQuery;list inRegion = [];list Avs;list AvsName;list friendName = [];integer x;integer k;default{ state_entry() { CurrNC = llGetInventoryName(INVENTORY_NOTECARD, 0); nameQuery = llGetNotecardLine(CurrNC, 0); llSetTimerEvent(15.0); } touch_start(integer num) { k = !k; if(k) { llOwnerSay("ON"); llSetTimerEvent(15.0); } else { llOwnerSay("OFF"); llSetTimerEvent(0); } } dataserver(key query_id, string data) { if (query_id == nameQuery) { if (data == EOF) { // llOwnerSay("endOFfile"); } else { gMyFriends += data; ++x; nameQuery = llGetNotecardLine(CurrNC, x); } } } timer() { AvsName = []; friendName = []; //______________________________________________ Avs = llGetAgentList(AGENT_LIST_REGION,[]); integer j = llGetListLength(Avs); integer w; for(w = 0;w < j;++w) { AvsName += llKey2Name(llList2Key(Avs, w)); } string VisNames = llDumpList2String( AvsName, "\n "); llInstantMessage( llGetOwner(), "\nVisitor names :\n" + VisNames ); //__________________________________________ integer i = llGetListLength(gMyFriends); integer Here = FALSE; while (i >= 0) { if (~llListFindList(Avs,[llList2Key(gMyFriends,i)])) { Here = TRUE; friendName += llKey2Name(llList2Key(gMyFriends, i)); string Friends = llDumpList2String( friendName, "\n "); llInstantMessage( llGetOwner(), "\nFriends in Region :\n" + Friends ); } --i; } if (Here && (!gStillHere)) //Don't rez one if therre's already one there. Otherwise, go ahead { llInstantMessage( llGetOwner(),"first time rez"); // llRezAtRoot("Stuff",llGetPos() + <1.0,1.0,0.0>,ZERO_VECTOR,ZERO_ROTATION,0); gStillHere = TRUE; } else if (!Here && (gStillHere)) //Delete "Stuff" { llInstantMessage( llGetOwner(),"De rez"); // llRegionSay(-12345,"DIE"); gStillHere = FALSE; } llSetTimerEvent(15.0); }}
  23. integer i = llGetListLength(gMyFriends); should this be.... integer i = llGetListLength(Avs);
  24. that is the lsl wiki example? http://wiki.secondlife.com/wiki/LlDetectedPos
  25. i think age verification is viewer only ? the closest you can get with script is.....? llRequestAgentData(avatar_key,DATA_PAYINFO);
×
×
  • Create New...