Jump to content

Xiija

Resident
  • Posts

    912
  • Joined

  • Last visited

Everything posted by Xiija

  1. else if (method == URL_REQUEST_GRANTED) the prim got a url, ... so i post it to the web... else if (method == "GET") .... something is polling this prim for it's info... so i send it! ( in a diff part of the script) hope this helps
  2. I send the url in the get request ...? here is a snippet where i send the url & info to a google form, which is linked to a google spreadsheet. http_request(key id, string method, string body) { integer responseStatus = 400; string responseBody = "Unsupported method"; if (method == URL_REQUEST_DENIED) throw_exception("The following error occurred while attempting to get a free URL for this device:\n \n" + body); else if (method == URL_REQUEST_GRANTED) { url = body; llLoadURL(llGetOwner(), "Click to visit my URL!", url); string send = "https://docs.google.com/forms/d/e/1FAIpQLSfmFFNdHlOpvkXBU_AyPKj4ATjTJdS8iA2N3K2ervPNxNwE_A/formResponse?entry.1012667783=" + region + "&entry.457815027=" + url + "&submit=Submit"; llHTTPRequest(send, [HTTP_METHOD, "POST", HTTP_VERBOSE_THROTTLE, FALSE, HTTP_BODY_MAXLENGTH, 16384], ""); llOwnerSay("sent..."); } else if (method == "GET") { avi = llGetRegionAgentCount(); responseStatus = 200; responseBody = "REGION NAME : " + region + "\nTIME DIALATION : " + (string)llGetRegionTimeDilation() + "\nREGION FPS : " + (string)llGetRegionFPS() + "\nAVATARS : " + (string) avi ; } llHTTPResponse(id, responseStatus, responseBody); }
  3. put the touch event in a script.. and put the script in the thing people will click?
  4. like... touch_start(integer num_detected) { // do something kewl llSetTimerEvent(2.0); } timer() { llSetTimerEvent(0.0); // redo something kewl }
  5. Sub menus are just lists, so you could do something like... list currentButtons= []; list Main = ["Face-1", "Face-2", "Face-3"]; list choices = [ "texture", "color"]; list textures = [ "tan skin", "blue skin"]; list colors = ["red", "green", "blue" ]; integer currentFace; ...so you would start out with....currentButtons = Main; ...... ...... => llDialog(ID, "Menu Choices:", currentButtons, channel_dialog); and when the user clicks a choice ( say they choose face-2 ), change your buttons and variables to their choice... currentFace = 2; ...... currentButtons = choices; ...... => llDialog(ID, "Menu Choices:", currentButtons, channel_dialog); if they then choose color .... currentButtons = colors; ..... => llDialog(ID, "Menu Choices:", currentButtons, channel_dialog); etc etc?
  6. you would need to have someone write a script to do that?
  7. dunno if this is relevent, but it's an example of a smooth touch increment/decrement kinda thing? You can link 3 prims together, and put the main script in the root, and the others in the other prims to get a kind of volume control effect? This lets you click the up & down prims.. and also ... click & hold them ~ touch_start ...starts a timer, touch_end ... stops it ~ ::MAIN:: ( root prim) integer time; integer place; string pList ; list zList = []; list Charsetz = [" ","▏","▎","▍","▌","▋","▊","▉","█","█"]; list Charsetx = [" ","█","█","█","█","█","█","█","█","█", "█ - Max!"]; default { state_entry() { } link_message(integer sender_num, integer num, string msg, key id) { if (num) { llSetTimerEvent( 5 ); time += num; if (time >= 20) { time = 20; llSay(0," Max\n\n"); } if (time <= 0) { time = 0; llSay(0," Muted\n\n"); } place = llFloor(time / 2); zList = llList2List(Charsetx,0,place); pList = llDumpList2String(zList,"" ); llSetText("Current Volume : " + (string)time + "\nPower: " + pList, <1.0, 1.0, 1.0>, 1.0); } } timer() { llSetText("", <1.0, 1.0, 1.0>, 1.0); } } ::ADJ UP :: ( prim #2 ) integer time = 0; integer flag; default { state_entry() { llSetTimerEvent( 0 ); } touch_start(integer total_number) { llSetTimerEvent( 0.3 ); } touch_end(integer end) { if( flag != 1 ) { llMessageLinked(LINK_ROOT, 1,"", ""); } llSetTimerEvent( 0 ); flag = 0; } timer() { llMessageLinked(LINK_ROOT, 1,"", ""); flag = 1; } } ::ADJ DOWN:: ( prim #3 ) integer time = 20; integer flag; default { state_entry() { llSetTimerEvent( 0 ); } touch_start(integer total_number) { llSetTimerEvent( 0.3 ); } touch_end(integer end) { if( flag != 1 ) { llMessageLinked(LINK_ROOT, -1,"", ""); } llSetTimerEvent( 0 ); flag = 0; } timer() { llMessageLinked(LINK_ROOT, -1,"", ""); flag = 1; } }
  8. Would the URL be attached to the owners Land settings, like an experience key? ... list of experience details [string experience_name, key owner_id, key experience_id, integer state, string state_message, key group_id, string experience_URL] or perhaps the owners uri namespace? ... i.e. secondlife:///app/agent/{AVI_ID}/registeredURL
  9. You could mebbe try a youtube livestream.. not sure if people will all see the same time frame or not .. hmmm How to Live Stream on Youtube you could use OBS to set it up... Open Broadcaster Software OBS is pretty easy... here is a vid i made with it in SL... OBS example
  10. @Innula..trutru here is a small snippet to strip all alpha characters from a string, if you ever need it? integer TrimInt(string in_str) { string num = "1234567890"; string tp; string test; integer i; integer LS = llStringLength( in_str ); for(;i<LS;++i) { test = llGetSubString(in_str,i,i); if(llSubStringIndex(num,test)>=0)tp+=test; } return (integer)tp; } default { state_entry() { } touch_start(integer total_number) { string new = "12a34bc56"; integer me = TrimInt(new); llOwnerSay( "got " + (string) me); } }
  11. hmmm... http://wiki.secondlife.com/wiki/LlGetListEntryType
  12. It's a good catch Phil Someone should make a note in the wiki.... if start & end both point to the same list item, the function apparently has NO operating range ? list mylist = [0,1]; list result_a = llList2ListStrided(mylist,1,-1,2); ( or ... llList2ListStrided(mylist,1,1,2); )
  13. default { state_entry() { } touch_start(integer total_number) { list num = [0,1,2,3,4,5,6,7,8,9,10,11] ; list names = llDeleteSubList(num,0,0); names = llList2ListStrided(llList2List(names, 0, -1), 0, -1, 2); string tmp = llDumpList2String(names," , "); llOwnerSay(" list is " + tmp); } } or something...?
  14. mebbbe something basic like.... vector startingSize; integer tog; default { state_entry() { startingSize = llGetScale(); } touch_start(integer total_number) { if( tog = !tog ) { llSetTimerEvent(0.02); } else { llSetTimerEvent(0.0); llSetScale( startingSize ); } } timer() { llSetScale( llGetScale() + <0.005, 0.005, 0.005> ); } }
  15. @Rhiannon I'm tryin to remember it all heh... something like... You create a google form, and a google spreadsheet, and link the two together, so all form submissions go to the sheet. Then change the form url ... from /edit to /viewform and check page source, to get entry for answer boxes.( f12 ... or right click & inspect element) To POST to the form/sheet you use something like this for your url string...( my form had 2 boxes, ... region name, and url of the sending prim) string send = "https://docs.google.com/forms/d/e/1FAIpQLSfmFFNdHlOpvkXBU_AyPKj4ATjTJdS8iA2N3K2ervPNxNwE_A/formResponse?entry.1012667783=" + region + "&entry.457815027=" + url + "&submit=Submit"; ( notice the .... &entry.457815027= .... those keys come from looking at the page source / inspecting the answer box elements on the form webpage.) when you want to GET the info from the linked google spreadsheet, your url looks something like this... "https://docs.google.com/spreadsheets/d/1MNKwhVqK8U8urzTWa_q0YtlGnYVn7SnICZBylstR2KE/pubhtml?gid=653993593&single=true&gid=0&output=txt&range=H4"; ( returns what is in cell H4 ) you can use normal google sheet formulas to shift the data on the sheet how you need it ... hope this helps a bit? p.s. i'm guessing this is NOT a secure way to store data?...not even sure about what perms to view/edit you need on your sheet & form p.p.s. ( not sure if any can view these, but...) the form I used... sim servers google form the google spreadsheet... sim server responses google spreadsheet
  16. I've used google sheets to store data, and retrieve it ... not too hard to set up. (http) what i wanna know is, why is there a key-value function, but it is ONLY available to paying members... trans = llCreateKeyValue("FOO", "BAR"); ( For this function to work, the script must be compiled into an Experience. ) ( Experience keys are only available to Premium members. ) ... sure, you can code with it outside an experience, but it's usable only Inside one... just seems odd that they limit such a powerful function to paying members Only...
  17. If ya are, check out some of these fun sites ! Codepen Repl,It FreeCodeCamp and for some fun..... Deep Dream Generator
  18. Class is... IN! 1. rez a prim. 2. edit the prim, and open the "Content" tab in the edit box. 3. click the "New Script" tab. 4. open the new script in the contents. 5. change the.... llSay(0, "Touched.");..... to this ... llSay(0, llDetectedName(0) + "Touched me !"); 6. close the edit window and touch your prim. 7. A Scripter is YOU!
  19. SL MP search for free FP dance scripts the basic code is ... llRequestPermissions(llDetectedKey(0), PERMISSION_TRIGGER_ANIMATION);
  20. It's the old ...list functions don't like Humans ( or other lists )... trick! changed the string stuff in the.... 'for' statement in the user function . list my_list = [ "43a2cd19-eb07-47a6-b1c3-94ea7924e4f7", "7a6b9c04-b610-4017-9982-80962eda2619", "06451596-818c-4975-8bc0-058ab2fe8274" // Xiija ]; list ListXandY(list myList, list scanList ) { list lz = []; integer x; integer n = llGetListLength( scanList ); for (x = 0; x < n; x++) { string new = llList2String(scanList, x); if (~llListFindList( myList,[new] ) ) { string avi = llList2String( llList2List( scanList, x, x) , 0 ); lz += avi; } } return lz; } default { touch_start(integer total_number) { list avatarsInRegion = llGetAgentList(AGENT_LIST_REGION, []); list result = ListXandY(my_list, avatarsInRegion); list names; integer y; for(; y < llGetListLength(result) ; ++y) { key currKEY = llList2Key(result,y); names += llGetUsername( currKEY ); } if( names != [] ) { string tmp = llDumpList2String( names, "\n"); llOwnerSay( "\nAvatar Found: \n" + tmp ); } else llOwnerSay( "\nNO Avatars Found" ); } }
  21. anyhoo, this seems to be workin for me? ( my key is the one ... 06451596-818c-4975-8bc0-058ab2fe8274) list my_list = [ "43a2cd19-eb07-47a6-b1c3-94ea7924e4f7", "369fac38-c0e6-4c65-b7ca-ff6da91c3d94", "06451596-818c-4975-8bc0-058ab2fe8274", // ME "be7f208e-a4ac-4073-b4eb-277d8581b13e" ]; list ListXandY(list myList, list scanList ) { // return a list of elements common to both lists list lz = []; integer x; integer n = llGetListLength( scanList ); for (x = 0; x < n; x++) { if (~llListFindList( myList, llList2List( scanList, x, x))) { lz += llList2List( scanList, x, x); } } return lz; } default { touch_start(integer total_number) // used "scan" to test { list scan = [ "369fac38-c0e6-4c65-b7ca-ff6da91c3d94", "06451596-818c-4975-8bc0-058ab2fe8274", // ME "be7f208e-a4ac-4073-b4eb-277d8581b13e"]; list avatarsInRegion = llGetAgentList(AGENT_LIST_REGION, []); list result = ListXandY( my_list, scan ); // REPLACE scan WITH avatarsInRegion list names ; integer y; for(; y < llGetListLength(result) ; ++y) { key currKEY = llList2Key(result,y); names += llGetUsername( currKEY ) ; } string tmp = llDumpList2String( names, "\n"); llOwnerSay( "\nFound: \n" + tmp ); } }
  22. if you put the particle code in a box, and then edit and move the box... you should see ribbon particles ...like lightsabre trails? i tested it on a "staff" cylinder.. looked kewl to use in your lightsabre, just add the particle bit at the top, add ... scale = llGetScale(); to your state_entry, and then ... when you draw your lightsabre, ( the ON bit) .. add the line ... plasma(); when you sheathe it, add.... llParticleSystem( [] );
  23. might be fun to add particles to it? here is a ribbon one you can mod for your needs.. plasma(){ llParticleSystem( [ PSYS_SRC_PATTERN,PSYS_SRC_PATTERN_ANGLE_CONE, PSYS_SRC_BURST_RADIUS,0, PSYS_SRC_ANGLE_BEGIN,0, PSYS_SRC_ANGLE_END,0, PSYS_SRC_TARGET_KEY,llGetKey(), PSYS_PART_START_COLOR,<0.3+llFrand(0.3),0.3+llFrand(0.3),0.2+llFrand(0.3)>, PSYS_PART_END_COLOR,<0.3+llFrand(0.3),0.2+llFrand(0.3),0.3+llFrand(0.3)>, PSYS_PART_START_ALPHA,0.1, PSYS_PART_END_ALPHA,0, PSYS_PART_START_GLOW,0.5, PSYS_PART_END_GLOW,0.2, PSYS_PART_BLEND_FUNC_SOURCE,PSYS_PART_BF_SOURCE_COLOR, PSYS_PART_BLEND_FUNC_DEST,PSYS_PART_BF_ONE_MINUS_SOURCE_ALPHA, PSYS_PART_START_SCALE,<scale.z, scale.z, 0.0>,//scale.z...lightsabre(cylinder)Z length PSYS_PART_END_SCALE,<0.01, 0.01, 0.0>, PSYS_SRC_TEXTURE,"5748decc-f629-461c-9a36-a35a221fe21f", PSYS_SRC_MAX_AGE,0, PSYS_PART_MAX_AGE,2, PSYS_SRC_BURST_RATE,0.02, PSYS_SRC_BURST_PART_COUNT,5, PSYS_SRC_ACCEL,<0.000000,0.000000,0.000000>, PSYS_SRC_OMEGA,<0.000000,0.000000,0.000000>, PSYS_SRC_BURST_SPEED_MIN,0.1, PSYS_SRC_BURST_SPEED_MAX,0.1, PSYS_PART_FLAGS, 0 | PSYS_PART_EMISSIVE_MASK | PSYS_PART_INTERP_COLOR_MASK | PSYS_PART_INTERP_SCALE_MASK | PSYS_PART_RIBBON_MASK ]); } vector scale; default { state_entry() { scale = llGetScale(); plasma(); // turn on when lightsabre is active ... off is ... llParticleSystem( [] ); } }
  24. a small mod of Scalar's code... integer listenHandle; remove_listen_handle() { llListenRemove(listenHandle); } integer steps = 10; // Adjust this to make it more smooth float movementSteps; default { state_entry() { movementSteps = 0.80274 / steps; listenHandle = llListen(33, "", llGetOwner(), ""); } listen(integer channel, string name, key id, string message) { if (message == "On") { integer x; for(x; x < steps; x++) { llSetLinkPrimitiveParamsFast( LINK_THIS , [ PRIM_POS_LOCAL , llGetLocalPos() + <0,0,movementSteps> ]); llSleep( 0.05 ); } } else if (message == "Off") { integer x; for(x; x < steps; x++) { llSetLinkPrimitiveParamsFast( LINK_THIS , [ PRIM_POS_LOCAL , llGetLocalPos() + <0,0, -movementSteps> ]); llSleep( 0.05 ); } } } }
×
×
  • Create New...