Jump to content

Xiija

Resident
  • Posts

    909
  • Joined

  • Last visited

Everything posted by Xiija

  1. @Prokofy Neva mebbe make a list of ID's from ... GetAgentList
  2. @Ayame Musashi Is your SL script using http .. or https? .. if the url you are sending back to SL has https, you may need a cert? here is a thread on that ...just incase it helps. Http Certificate
  3. @Ayame Musashi are you logging the requests to the php script?.. are all the values getting thru?
  4. So, I'm doing a request to this site to get JSON back... https://api.github.com/repos/Xiija/FakeDB/git/trees/fac9e3a9fb898709503e39e943a329d36f8dd4dc and i'm using this in SL to look at the response... llOwnerSay( "\n INFO IS: \n" + llJsonGetValue( body, [ "tree" ] ) + "\n" ); ... this returns an array, and i'm having trouble trying to loop thru the array. I can use ... llOwnerSay( "\n INFO IS: \n" + llJsonGetValue( body, [ "tree", 0, "path" ] ) + "\n" ); to see the first item in the array, but am unsure how to get the array length from the first call? Thanx for any helps ETA, got it with.. string arr = llJsonGetValue( body, [ "tree" ] ); list li = llJson2List( arr ); integer length = llGetListLength( li ); integer indx = 0; for(; indx < length; ++indx) { llOwnerSay( "\n INFO IS: \n" + llJsonGetValue( body, [ "tree", indx, "path" ] ) + "\n" ); }
  5. @Katherine Heartsong dunno if this helps, but here is a working example... this displays on the forward X face ( face 2 ) .. you still have to add media to that face ... ( i set mine to ... h ttps://img-test-2.tikihed.repl.co/images/img-0.png ... to start) image numbers should start at zero. there seems to be a 4 second delay in loading images for some reason ... the LSL script > string url = "https://img-test-2.tikihed.repl.co/images/img-"; integer img_count = 2; integer x = 0; default { state_entry() { llSetPrimMediaParams( 2, [ PRIM_MEDIA_AUTO_SCALE,TRUE, PRIM_MEDIA_PERMS_INTERACT,0x1, // owner PRIM_MEDIA_PERMS_CONTROL,0x0 , // none PRIM_MEDIA_AUTO_LOOP,TRUE, PRIM_MEDIA_AUTO_PLAY,TRUE ]); llSetTimerEvent(0.5); } timer() { llSetTimerEvent(6.0); x = ++x % img_count; string show = url + (string) x +".png"; llSetPrimMediaParams(2, [ PRIM_MEDIA_CURRENT_URL, show ]); } } the server i'm using, hosting files... the Repl server p.s. this is using .png as the file extension, you can use whatever, but make sure all your images are the same format?
  6. @Katherine Heartsong the prim you are using will display a webpage on a prim face. most likely your script would be server side, not a script in SL. here is a basic example of a slideshow hosted outside of SL, just set your media face to the url of your page... JS iframe slideshow
  7. mebbe search for titler on MP ? several free scripts there
  8. @Coffee Pancake which extension do you use?.. i saw 4 @Scum Pond Python is a tool of the DarkLord
  9. It would be nice to have a "tag" ( hashtag?) option when posting...
  10. @Coffee Pancake trutru, i always hover links before i click them http://www.google.com
  11. @gwenavive 1. that was from my lsl script. 2. & 3. here are some more ideas on saving data. an LSL script that registers it's url, and can get data back on touch... string region; integer CHAN = 19; string server_url = "https://SecLife-php-server-1-1.tikihed.repl.co/index.php?"; string secureUrl; key http_request_id; key urlRequestId; key selfCheckRequestId; request_secure_url() { llReleaseURL(secureUrl); secureUrl = ""; urlRequestId = llRequestSecureURL(); } default { on_rez( integer param) { llResetScript(); } state_entry() { region = llGetRegionName(); request_secure_url(); } touch_start(integer total_number) { string URL2 = server_url + "getdata=true"; http_request_id = llHTTPRequest( URL2 , [HTTP_METHOD, "GET", HTTP_MIMETYPE, "application/json", HTTP_BODY_MAXLENGTH,16384, HTTP_PRAGMA_NO_CACHE,TRUE], "" ); } http_request(key id, string method, string body) // recieved a request { integer responseStatus = 400; string responseBody = "Unsupported method"; if (method == URL_REQUEST_DENIED){} else if (method == URL_REQUEST_GRANTED) { secureUrl = body; llOwnerSay("\ngot new URL:\n" + secureUrl); string URL3 = server_url + "url=" + secureUrl + "&channel=" + (string)CHAN; // send new URL to the PHP server http_request_id = llHTTPRequest(URL3 , [HTTP_METHOD, "GET", HTTP_MIMETYPE, "application/json", HTTP_BODY_MAXLENGTH,16384, HTTP_PRAGMA_NO_CACHE,TRUE], "" ); // check every 5 mins for dropped URL llSetTimerEvent(300.0); } else if (method == "GET") { responseStatus = 200; responseBody = "Method: GET"; } else if (method == "POST") { llOwnerSay("got POST body:\n" + body); // ( untested ) } // else if (method == "PUT") ...; // else if (method == "DELETE") { responseStatus = 403; responseBody = "forbidden"; } llHTTPResponse(id, responseStatus, responseBody); } http_response(key request_id, integer status, list metadata, string body) // responses to requests made to this sscript { integer marker = llSubStringIndex( body, "**"); if( marker > -1) { string bod = llGetSubString( body, marker+3, -1) ; llOwnerSay("\n Incomming Req: \n" + bod ); } } timer() { selfCheckRequestId = llHTTPRequest(secureUrl, [ HTTP_METHOD, "GET", HTTP_VERBOSE_THROTTLE, FALSE, HTTP_BODY_MAXLENGTH, 16384 ], ""); } changed( integer chg ) { if( chg && ( CHANGED_INVENTORY | CHANGED_REGION_START ) ) { llResetScript(); } } } and the PHP script that goes with it ( for testing ) https://replit.com/@TikiHed/SecLife-php-server-1-1#index.php I have no idea about how it will affect your page on the web... mebbe use a regular html page, and just use the PHP page for data handling?
  12. @gwenavive i tested with the script on Repl.it, on Aditi.. worked ok . can you fork the repl, and insert your own url for testing? not sure if the script only runs at startup, or with every page refresh ( mine seems to work on refresh )
  13. @gwenavive the cert is here.. https://bitbucket.org/lindenlab/llca/raw/master/LindenLab.crt if your inworld script doesn't use secure url, i think you can skip it? here is a PHP example posting to an SL prim ( non secure url ) .... https://replit.com/@TikiHed/php-send-test-01#index.php and here is the inworld script i'm testing with... key req; key requestURL; default { state_entry() { requestURL = llRequestURL(); // non static , for testing ONLY } http_request(key id, string method, string body) { if ((method == URL_REQUEST_GRANTED) && (id == requestURL) ) { llOwnerSay("Obtained URL: " + body); requestURL = NULL_KEY; } else if ((method == URL_REQUEST_DENIED) && (id == requestURL)) { llOwnerSay("There was a problem, and an URL was not assigned: " + body); requestURL = NULL_KEY; } else if (method == "POST") { llOwnerSay("Received information from the outside: \n" + body); llHTTPResponse(id,200,"Thank you for calling. All of our operators are busy."); } else { llHTTPResponse(id,405,"Unsupported Method ( posts only ) "); } } }
  14. @Mollymews sadly it will take ANY url ...
  15. to check for a valid stream, you might do something like... listen(integer channel, string name, key id, string message) { string stream = llStringTrim( message, STRING_TRIM ); if( llGetSubString( stream, 0, 3) != "http") { llSay(0, "Invalid Stream URL: " + message); } else { llSay(0, "Setting Stream to: " + message); } }
  16. small example of checking for animation.. key sitter; // global string animation; default { state_entry() { animation = llGetInventoryName( INVENTORY_ANIMATION,0 ); vector scale = llGetScale(); llSitTarget( <scale.x/2, 0.0, scale.z + 0.01>, ZERO_ROTATION ); llSetClickAction(CLICK_ACTION_SIT); } changed(integer change) { if (change & CHANGED_LINK) { sitter = llAvatarOnSitTarget(); if(sitter != NULL_KEY) { llRequestPermissions(sitter , PERMISSION_TRIGGER_ANIMATION); } else { if (llGetPermissions() & PERMISSION_TRIGGER_ANIMATION) { if( animation) llStopAnimation(animation); } } } } run_time_permissions(integer perm) { if ( perm & PERMISSION_TRIGGER_ANIMATION ) { if( animation ) { llStartAnimation(animation); llStopAnimation("sit"); } else { llRegionSayTo( sitter,0, "the animation is missing or is incorrectly named ... " ); } } } }
  17. @gwenavive here is a small JSON add / delete thing you could mod to replace a list thing? string Customers; key BORNquery; key ONquery; string purch; string info; string name; key id; list newCust; getInfo(string person) { llOwnerSay("JSON object details:\n"); list details = llJson2List (llJsonGetValue ( Customers,[person] ) ); list fields = llList2ListStrided (details, 0, -1, 2); integer len = llGetListLength(fields); integer x; for(;x < len;++x) { string tmp = llList2String(fields,x); llOwnerSay(tmp + " : " + llJsonGetValue (Customers, [person, tmp]) ); } } default { state_entry() { purch = llList2Json( JSON_ARRAY, [] ); info = llList2Json (JSON_OBJECT, [ "01 AvatarKey", JSON_NULL, "Rezday", JSON_NULL, "02 STATUS", JSON_NULL, "01.5 zPurchases", purch ] ); Customers = llList2Json( JSON_OBJECT, [] ); } touch_end( integer num) { id = llDetectedKey(0); name = llDetectedName(0); if (llJsonGetValue (Customers, [name] ) == JSON_INVALID) { llSay(0,"\nAdding: " + name ); Customers = llJsonSetValue (Customers, [name], info); Customers = llJsonSetValue (Customers, [name, "01 AvatarKey"], id); BORNquery = llRequestAgentData(id, DATA_BORN ); ONquery = llRequestAgentData(id, DATA_ONLINE ); getInfo(name); } else if (llJsonGetValue (Customers, [name] ) != JSON_INVALID) { llSay(0,"\nDeleting: " + name ); Customers = llJsonSetValue (Customers, [name], JSON_DELETE); getInfo(name); } } dataserver(key queryid, string data) { if ( queryid == BORNquery ) { Customers = llJsonSetValue (Customers, [name, "Rezday"], data); } if ( queryid == ONquery ) { string status; if(data == (string)0) {status = "Offline";} if(data == (string)1) {status = "Online";} Customers = llJsonSetValue (Customers,[name, "02 STATUS"], status); } } }
  18. trutru, we use shout to go between sims at the SL Burningman, as with a heavy load, things like http may lag out for normal inter-regional coms.
  19. i'm testing with this, and it seems to work ok?... llExecCharacterCmd(CHARACTER_CMD_STOP, []); llPursue(llDetectedKey(0), [PURSUIT_OFFSET, <-2.0, 0.0, 0.0>, PURSUIT_FUZZ_FACTOR, 0.2]); llSleep(1.0); // just enuff time to spin about & face a target llExecCharacterCmd(CHARACTER_CMD_STOP, []); llSleep(5.0); // stare at the target a bit doStuff(); // continue on
  20. could you do a stop. purse of 0.2 sec, then stop again to get it lined up?
  21. Does anyone have any info on languages used with HexText? trying to find out what character sets they are...
  22. if your function is on a timer, you mebbe need to clear your list each time? .. myList = [ ];
  23. i'm guessing some items you get have a piece of code that sends your UUID to an offworld DB, and adds you to an inworld mailing list etc ... hmmm i always wondered why i get spam offers from people i never met lol.
  24. have you checked ... llGetDayLength or ... llGetRegionDayLength ? , no clue if that would work ....hmm or mebbe ... llGetEnvironment with [ ENVIRONMENT_DAYINFO ]
  25. i've run into this before, alpha textures borking on a HUD, can't remember how or if i fixed it
×
×
  • Create New...