Jump to content

Xiija

Resident
  • Content Count

    644
  • Joined

  • Last visited

Community Reputation

165 Excellent

2 Followers

About Xiija

  • Rank
    Lotus Eater

Recent Profile Visitors

812 profile views
  1. 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 } }
  2. 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"); } } }
  3. @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
  4. 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 ?
  5. something like this in your changed event?... (untested) if (sittingAvatar == NULL_KEY) { llStopSound(); return; } string sound = llList2String( soundnames, llFloor(llFrand( sounds )) ); llPlaySound(sound, volume);
  6. 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); } }
  7. 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/
  8. @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
  9. @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
  10. heh, sry, was just codeblind.. dunno, i finally get it.. 4 - 8 = -4!
  11. just curious, why does 4 minus 0 = -4? lol i would have thought you would need to do integer RndX = -4 + (integer) llFrand(9.0);
  12. nice, @Wandering Soulstar .. it didn't work for me tho hmmm another way would be... if ( (llDetectedLinkNumber(0) == 0) || (llDetectedLinkNumber(0) == 1 && llGetNumberOfPrims() > 1) ) { // do your thang }
  13. it would look something like this, but this doesnt f**cking work string inventory; string object; vector relativePosOffset = <1.0, 0.0, 0.2>; vector relativeVel = <0.0, 0.0, 0.0>; rotation relativeRot = <0.707107, 0.0, 0.0, 0.707107>; integer startParam = 0; float scanDistance = 2.0; float SCAN_INTERVAL = 5.0; integer items_contained; string name; integer rezcount; string objname; integer CountItems() { return items_contained = llGetInventoryNumber( INVENTORY_ALL ); // --items_contained; } SayCount() { name = llGetObjectName(); llSetText(name + "\n" + "Has " + (string)items_contained + " items.", <0.0,1.0,0.0>, 1 ); } rezzit() { object = llGetInventoryName(INVENTORY_OBJECT,0); //get name of the 1st object in inventory vector myPos = llGetPos(); rotation myRot = llGetRot(); vector rezPos = myPos+relativePosOffset*myRot; vector rezVel = relativeVel*myRot; rotation rezRot = relativeRot*myRot; llRezObject(object, rezPos, rezVel, rezRot, startParam); //rez the 1st object ++rezcount; llOwnerSay("rezcount: " + (string)rezcount +"\nObj: " + object ); } default { touch_start(integer count) { rezzit(); } object_rez(key id) // as soon as something is rez'd , turn on sensor { if( rezcount == 1) { objname = object; } else { objname = object + " 1"; } llOwnerSay("Sensor for:..." + objname ); llSensorRepeat( objname , "" , (PASSIVE|SCRIPTED), 10.0, PI, 10.0 ); } sensor( integer detected ) { while(detected--) { llOwnerSay(llDetectedName(detected)); } } no_sensor() // when item is taken, if any are left in inv, rez another { if( CountItems() ) rezzit(); } }
  14. something like... list liked = ["one", "Two", "three"]; default { state_entry() { llListen(10, "","", ""); } listen( integer channel, string name, key id, string message ) { if(message) { if (!~llListFindList(liked,[message])) { llOwnerSay("adding *" + message + "* to list..."); liked += message; } else { llOwnerSay("already on list..."); } } } }
×
×
  • Create New...