Jump to content

Xiija

Resident
  • Posts

    912
  • Joined

  • Last visited

Everything posted by Xiija

  1. to check when someone sits... http://wiki.secondlife.com/wiki/LlAvatarOnLinkSitTarget to give a button .... http://wiki.secondlife.com/wiki/LlDialog if you have a script you are working on, you can post it for help. if you are looking for someone else to make you a script, you can try Help Wanted, or Inworld Employment https://community.secondlife.com/forums/forum/124-commerce-forum/
  2. mebbe its ... llResetScript(); cant get in world to check
  3. If you drop this in the cylinder, it should rotate only the cylinder? default { state_entry() { llSetLinkPrimitiveParamsFast(LINK_THIS, [ PRIM_OMEGA ,<0.0, 0.0, 1.0>*llGetRot(), 0.1, 0.01 ]); } } you may need to stop the spin in the root, if that is where your spin is coming from? just add this line to state entry in the root: llTargetOmega(ZERO_VECTOR, 0, 0);
  4. llSetRot( llEuler2Rot( (<0,0,90>*DEG_TO_RAD) ));
  5. You could cheat a bit.... llSound("SoundName1",1.0,TRUE,TRUE); llLoopSound("SoundName2", 1.0);
  6. I recently got to play around with these... we tried tp, coms, and url persistence .. very handy ! I only got to test because a friend has premium, otherwise i'd never have a chance. It would be nice if every account got at least 1 key-val to use outside of experiences.. oh well
  7. menbbe using SLPPF ... SetLinkPrimitiveParamsFast . with the LINK_THIS flag? it's hard to answer with such a vague question
  8. Mebbe like a vendor system, once you click a generator, it is "in use" and no one else can click it till it is done, and once a person has clicked one, it sends a msg to all other generators that this person is already using another generator in the system?
  9. for a temp fix, you could hack the end of the borken JSOn ? key XMLRequest; default { state_entry() { } touch_start(integer total_number) { llOwnerSay("Sending HTTP Request, ..."); string tail = "Malachi 3:2"; // "joshua1:9"; // Malachi 3:2 tail = llEscapeURL(tail); string URL = "http://bible-api.com/"; XMLRequest = llHTTPRequest( URL + tail , [HTTP_USER_AGENT, "XML-Getter/1.0 (Mozilla Compatible)", HTTP_METHOD, "GET", HTTP_MIMETYPE, "application/json;charset=utf-8", // "text/plain;charset= CP-1252", ISO-8859-1, utf-8 HTTP_BODY_MAXLENGTH,16384, HTTP_PRAGMA_NO_CACHE,TRUE], ""); } http_response(key k,integer status, list meta, string body) { if(k == XMLRequest) { if(status != 200) { llOwnerSay("\nRrror code : " + (string)status); return; } else { body = llDeleteSubString(body, -5, -1); // ***hack off end, ** body = body + "\":'non'}"; // ***and add json ending tag*** llOwnerSay("\nVerse: \n" + llJsonGetValue( body, ["text"]) ); } } } }
  10. I did a fake json file to test functionality.. works ok, so it's all on the API dood key XMLRequest; default { state_entry() { } touch_start(integer total_number) { llOwnerSay("Sending HTTP Request, ..."); string URL2 = "https://my-json-server.typicode.com/Xiija/FakeDB/db"; XMLRequest = llHTTPRequest( URL2 , [HTTP_USER_AGENT, "XML-Getter/1.0 (Mozilla Compatible)", HTTP_METHOD, "GET", HTTP_MIMETYPE, "application/json;charset=utf-8", HTTP_BODY_MAXLENGTH,16384, HTTP_PRAGMA_NO_CACHE,TRUE], ""); } http_response(key k,integer status, list meta, string body) { if(k == XMLRequest) { if(status != 200) { llOwnerSay("\nRrror code : " + (string)status); return; } else { llOwnerSay("returnedJSON: \n" + llJsonGetValue( body, ["comments","0","body"]) ); } } } } the return was... [07:12] http get api thing 2: Sending HTTP Request, ... [07:13] http get api thing 2: returnedJSON: My body is ONE! from my JSON file ... https://github.com/Xiija/FakeDB/blob/master/db.json
  11. I'm not sure what you mean by truncated?.. i put my script in a box, and it gives me the full verse? the params in the request are just basic ones i use for generic requests. I'll test the json thing and see how that goes heh ETA: tested, i see why the JSON is not working, and the truncation now... the end of the json should be.... "translation_note": "Public Domain"} but all that is getting thru is ...... "translation_not ...( making the JSON invalid) mebbe the timeout or content length on the API side? the Joshua one is 578 bytes, ...and the content length set at the api is is 509 ::shrugs::
  12. mebbe parse the body? It seems to be using either ISO-8859-1 or CP-1252 charset from the API ? no idea how to fix that except to use a string replace func? (this is a prim- touch to GET, change for your needs ) string strReplace(string str, string search, string replace) { return llDumpList2String(llParseStringKeepNulls((str = "") + str, [search], []), replace); } key XMLRequest; default { state_entry() { } touch_start(integer total_number) { llOwnerSay("Sending HTTP Request, ..."); string tail = "joshua1:9"; // "joshua1:9"; // Malachi 3:2 tail = llEscapeURL(tail); string URL = "http://bible-api.com/"; XMLRequest = llHTTPRequest( URL + tail , [HTTP_USER_AGENT, "XML-Getter/1.0 (Mozilla Compatible)", HTTP_METHOD, "GET", HTTP_MIMETYPE, "application/json;charset=utf-8", // "text/plain;charset= CP-1252", ISO-8859-1, utf-8 HTTP_BODY_MAXLENGTH,16384, HTTP_PRAGMA_NO_CACHE,TRUE], ""); } http_response(key k,integer status, list meta, string body) { if(k == XMLRequest) { if(status != 200) { llOwnerSay("\nRrror code : " + (string)status); return; } else { string txt = llGetSubString(body, llSubStringIndex(body, "\"text\":" )+ llStringLength( "\"text\":"), llSubStringIndex(body, "}]," )-5); // replace non utf-8 characters... â , â , â, â txt = strReplace(txt, "â", "'"); txt = strReplace(txt, "â", " "); txt = strReplace(txt, "â", " "); llOwnerSay("Verse: \n" + txt); } } } }
  13. Are you set on using path finding?.. or have you tried a sensor repeat with MoveToTarget?
  14. for the RGB stuff, mebbe this will help? http://wiki.secondlife.com/wiki/Category:LSL_Color
  15. non binary toggle... integer x; integer num = 9; default { state_entry() { } touch_start(integer total_number) { if( x=x^num ) llOwnerSay("On: " + (string)x); // says ON: 9 else llOwnerSay("Off: " + (string)x); // says Off: 0 } }
  16. It's been so long since i used this, i can't remember if i made it or not lol... Non Sensor Range Checker: integer range(vector vec1, vector vec2, float rng) { if( vec1.x >= (vec2.x - rng) && vec1.x <= (vec2.x + rng) && vec1.y >= (vec2.y - rng) && vec1.y <= (vec2.y + rng) ) return TRUE; else return FALSE; } vector target = <175.0, 32.0, 3023.70508>; integer area = 5; default { state_entry() { llSetTimerEvent(5.0); } touch_start(integer total_number) { } timer() { vector pos = llGetPos(); if( range( pos, target, area) ) { llOwnerSay("In Range"); } else { llOwnerSay("Not In Range"); } } }
  17. @viggy , you would need to save the store status somewhere if your website is static. Repl.It has some ability to do a server, not sure if that is what is needed tho heh... an example: ( a chat server ) the Repl- https://repl.it/@Xiija/chat02 and the site- https://chat02--xiija.repl.co
  18. On your website, in your JS, you could do... var queryString = decodeURI( window.location.search ); console.log("queryString is : " + queryString); then use the variable to change your webpage info. ... so you would send an http GET request to your website with a search param... i.e. for your SecondLife get req url.... http://www.mywebsite.com?cafe-open and in the above example, the queryString variable would end up being .... ?cafe-open ( here is a Codepen with an example .... ) https://codepen.io/XMODS/full/KYmxYz?cafe-open ( click "change view > editor view " .. to see the code ) for persistent storage of a variable, you would need a server, or google sheet, mebbe php ?
  19. something like this in your changed event?... (untested) if (sittingAvatar == NULL_KEY) { llStopSound(); return; } string sound = llList2String( soundnames, llFloor(llFrand( sounds )) ); llPlaySound(sound, volume);
  20. Something like... (untested) integer count; list songs = [uuid#1, uuid#2, etc etc]; default { touch_start(integer total_number) { llLoopSound( llList2Key(sounds,count), 0.5 ); ++count; count %= llGetListLength(sounds); } }
  21. so, a kinda hacky trick... when you send your data to the form, use a "marker" your marker could be anything.. like .... ~start~ or .... ~end~ in this example, i used something easy to find.... @!@ ..... was my marker. so if the data you send is ...." HTTPtest 2-16-2019" ... just add your marker to that to get... @!@HTTPtest 2-16-2019 on the sheet, my cell ... ( c6) ...looked like this .... @!@HTTPtest 2-16-2019 string sheetID = "1MNKwhVqK8U8urzTWa_q0YtlGnYVn7SnICZBylstR2KE"; string sheetURL = "https://docs.google.com/spreadsheets/d/1MNKwhVqK8U8urzTWa_q0YtlGnYVn7SnICZBylstR2KE/pubhtml?gid=653993593&single=true&gid=0&output=txt&range=C6"; key selfCheckRequestId; default { state_entry() { } touch_start(integer total_number) { selfCheckRequestId = llHTTPRequest( sheetURL, [HTTP_METHOD, "GET", HTTP_VERBOSE_THROTTLE, FALSE, HTTP_BODY_MAXLENGTH, 16384], ""); } http_response(key id, integer status, list metaData, string body) { if (id == selfCheckRequestId) { string marker = "@!@"; integer start = llSubStringIndex(body,marker); integer end = llSubStringIndex(body, "</td>"); string fetch = llGetSubString(body,start + llStringLength(marker), end-1); llOwnerSay("\n response: \n" + fetch); } } } the inworld response from putting this code in a box and touching it was... the value of cell c6 (with the marker bit removed) as i said , this is hacky ... it may break depending on where "</td>" appears on the sheet... you ~could~ add an ending marker to your sent data ... mebbe it would look like ... @!@HTTPtest 2-16-2019 @!!@ to make is more safe to parse? the NEW google stuff has an API ( you have to get a key) ... https://developers.google.com/sheets/api/
  22. @oOPussInBootsOo (ETA: ty to Puss for catching the mistaken link ) to see the id from my example, you have to use the ...pubhtml link, not the edit one just copy your sheet http link, but change it like so... https://docs.google.com/spreadsheets/d/1MNKwhVqK8U8urzTWa_q0YtlGnYVn7SnICZBylstR2KE/pubhtml ( click this link below and check the page source ) The link with the sheet ID
  23. @Jazmina Voom when you right click your google spreadsheet, you choose 'view page source' ( at least i can in firefox) at the bottom of the source page you will see something like... <script type="text/javascript">activeSheetId = '653993593'; switchToSheet('653993593');</script></body></html> - 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"; ( ...&range=H4...returns what is in cell H4 ) so the place where you see ... pubhtml?gid=653993593 ... is the sheet id from the page-source ( activeSheetId = '653993593'; ) so your response in the SecondLife GET request will return what is in that cell ( H4 in this example) from that google sheet Example: https://docs.google.com/spreadsheets/d/(your-sheet)/pubhtml?&gid=(your-sheet-id)&single=true&gid=0&output=txt&range=(what cell you want) links: the sheet from this example the actual url of the cell's return value SL wiki: How to handle a GET request
  24. heh, sry, was just codeblind.. dunno, i finally get it.. 4 - 8 = -4!
×
×
  • Create New...