Jump to content

Xiija

Resident
  • Posts

    912
  • Joined

  • Last visited

Everything posted by Xiija

  1. just need to clean it up a bit, something like.... integer channel; integer listening; default { on_rez(integer start_param) { llResetScript(); } state_entry() { channel = (integer)(llFrand(-1000000000.0) - 1000000000.0); } touch_start(integer total_number) { llDialog(llDetectedKey(0), "\nPlease choose an option:", (["Booking", "Song List", "Join Group","WebSite", "Calendar","Facebook","Reverb","Youtube"]), channel); listening = llListen(channel,"", "",""); } listen(integer _chan, string _name, key _id, string _option) { llListenRemove( listening ); if (_option == "Booking") { llGiveInventory(_id,"Booking Info"); } if (_option == "Song List") { llGiveInventory(_id,"Song List"); } if (_option == "Join Group") { llGiveInventory(_id,"Join Group"); } if (_option == "WebSite") { llLoadURL(_id, "Visit website?", "https://www.roguegalaxymusic.com"); } if (_option == "Calendar") { llLoadURL(_id, "Visit website?", "https://calendar.google.com/calendar/embed?src=moj8pm1uojuciitflq8d02uh60%40group.calendar.google.com&ctz=America%2FNew_York"); } if (_option == "Facebook") { llLoadURL(_id, "Visit website?", "https://www.facebook.com/RogueGalaxySL"); } if (_option == "Reverb") { llLoadURL(_id, "Visit website?", "https://www.reverbnation.com/cathietimian"); } if (_option == "Youtube") { llLoadURL(_id, "Visit website?", "https://www.youtube.com/c/cathietimian/"); } } }
  2. have you tried something like... changed(integer change) { if (change & CHANGED_TELEPORT) { llSleep(5.0); llResetScript(); } }
  3. Some thoughts on the new Google Apps script stuff: to use the newer google apps script, after you have followed the video, you would make 2 new scripts, one for getting a stored url, one for actually storing data. ◥◣◥◣◥◣◥◣◥ RAMBLING AREA ◣◥◣◥◣◥◣◥◣◥ storing data: I use a query string param in the Second Life prim's get request like so... string URL = "https://script.google.com/macros/s/AKfycbzigU- some long string of numbers etc etc- zjrmZg/exec?txt="; and after my prim has gotten a secure url using ... llRequestSecureURL()... i store that in a variable with... myURL = body; and the secondlife get req looks like, http_request_id = llHTTPRequest(URL + myURL, [HTTP_METHOD, "GET", HTTP_MIMETYPE, "text/plain", HTTP_BODY_MAXLENGTH,16384, HTTP_PRAGMA_NO_CACHE,TRUE], ""); here is a link to the google apps script that handles this http GET request: set Value on google sheet - https://script.google.com/d/1KMDXmVAlu9qLKO8UGdKLgVSEhMeaYT1yv24yOaxtWVddKSG8XaQ-19mz/edit?usp=sharing i have not tried it, but you could prolly make the cell that you want to store data in... into a variable. on the apps script, the relevant line is .... ws.getRange("A2").setValue(link); you could prolly add a second query string paramto your SL code with a cell, like... var query2 = "&cell="; var cellNum = "A3"; and then just use a different cell to store another line of data. Your http req would then look something like... http_request_id = llHTTPRequest(URL + myURL + query2 + cellNum , and on your apps script, add a new variable and use it... var cell_number = e.parameter.cell; ws.getRange(cell_number).setValue(link); // ============================ to get the values back into SL, you just make a GET request to your script that fetches the values... ( again, you could add a query string param to get different cells. ) get Value from google sheet - https://script.google.com/d/1aOsccUMaTZF1vhkvrkKhz64m5m2zVFbL1wq3TADB7bnSBNhNkxHR502Z/edit?usp=sharing ◥◣◥◣◥◣◥◣◥ END RAMBLING AREA ◣◥◣◥◣◥◣◥◣◥ just tryin to share the info for folks who wanna experiment
  4. @HajraLegacy not sure unless you post some code, but if you are using markers, mebbe change the marker to be different for each set of data?
  5. there is a good video on the new google apps script stuff here... these other posts may be outdated now?.. dunno...
  6. Some people use an init() function instead of resetting. you can reset variables there, and it saves you from having to reset the script all the time.
  7. vector linear; vector angular; integer start = level & edge; integer end = ~level & edge; integer held = level & ~edge; integer untouched = ~(level | edge); if( (held & CONTROL_ROT_RIGHT) && (held & CONTROL_LBUTTON) || (held & CONTROL_ML_LBUTTON) ) { angular.z = -10.0; } // caveat, you cannot touch the vehicle( or anything? ) with the left button when not in mouselook,
  8. just in case anyone can ever use some pre-defined params... control(key id, integer held, integer chng) { // define params ================== integer start_Fwd = (chng & CONTROL_FWD) && (held & CONTROL_FWD); integer moving_Fwd = (held & CONTROL_FWD); integer release_Fwd = (chng & CONTROL_FWD) && !(held & CONTROL_FWD); integer start_Rev = (chng & CONTROL_BACK) && (held & CONTROL_BACK); integer moving_Rev = (held & CONTROL_BACK); integer release_Rev = (chng & CONTROL_BACK) && !(held & CONTROL_BACK); integer start_Rot_R = (chng & CONTROL_ROT_RIGHT) && (held & CONTROL_ROT_RIGHT); integer Rot_R = (held & CONTROL_ROT_RIGHT); integer release_Rot_R = (chng & CONTROL_ROT_RIGHT) && !(held & CONTROL_ROT_RIGHT); integer start_Slide_R = (chng & CONTROL_RIGHT) && (held & CONTROL_RIGHT); integer Slide_R = (held & CONTROL_RIGHT); integer release_Slide_R = (chng & CONTROL_RIGHT) && !(held & CONTROL_RIGHT); integer start_Rot_L = (chng & CONTROL_ROT_LEFT) && (held & CONTROL_ROT_LEFT); integer Rot_L = (held & CONTROL_ROT_LEFT); integer release_Rot_L = (chng & CONTROL_ROT_LEFT) && !(held & CONTROL_ROT_LEFT); integer start_Slide_L = (chng & CONTROL_LEFT) && (held & CONTROL_LEFT); integer Slide_L = (held & CONTROL_LEFT); integer release_Slide_L = (chng & CONTROL_LEFT) && !(held & CONTROL_LEFT); integer start_Up = (chng & CONTROL_UP) && (held & CONTROL_UP); integer moving_Up = (held & CONTROL_UP); integer release_Up = (chng & CONTROL_UP) && !(held & CONTROL_UP); integer start_Down = (chng & CONTROL_DOWN && held & CONTROL_DOWN); integer moving_Down = (held & CONTROL_DOWN); integer release_Down = (chng & CONTROL_DOWN) && !(held & CONTROL_DOWN); vector angular_motor = ZERO_VECTOR; float speed = llVecMag( llGetVel() ); }
  9. if you wish to try cyclic loops, here are some ideas.. integer stage; integer numStages = 5; integer test = 1; // change this ( 1,2,or 3 ) default { state_entry() { } touch_start(integer total_number) { // cycle thru stages( 0-4 ), ... to get 1-5, add +1 to the end of your calculations. if( test == 1) // 0 to 4 { stage = ++stage % numStages; llOwnerSay("stage: " + (string)stage); } if( test == 2) // 0 thru -4 { stage = --stage % -numStages; llOwnerSay("stage: " + (string)stage); } if( test == 3) // 4 backwards to 0 { stage = --stage % numStages; if (stage < 0) { stage = numStages - 1; } llOwnerSay("stage: " + (string)stage); } } }
  10. the copy was just a quick grab from the changed page... http://wiki.secondlife.com/wiki/Changed i've had this problem before when snaggin code for other scripts, and when i use the snippet copied from the wiki, the script fails weirdly, but when i type it out manually, it works fine. (from my post in animesh forum, i used ... llGetInventoryName(INVENTORY_SOUND,0); ) anyhoo, i guess rachel is on to something, and i will hand type stuff from now on ty
  11. don't know if this affects anyone else, but when i copy/paste from the LSL wiki, it will bork a script. i copy pasted a simple changed event ( changed inv ) , and it triggered in my obj on every touch event, but when i erased if from the script and manually wrote the event, it worked fine. anyone else?... anyone?.. Beuller?
  12. yah so after everything in inv & perms was set.. i still had to deed it.. then Open it... then right click the script itself.. and then share That! lol...
  13. just for clarification, You others can deed a script, and still edit it after ?
  14. heh, yah i've got all the perms set, and share clicked before i deed it... after i deed, the share goes unclicked, and i re-click it.. still can't edit. i think someone may have cursed me!
  15. i used to be able to edit deeded scripts, not anymore? or isit a setting i need to change? ( i'm in the group with a role that allows editing group owned obj )
  16. this appears to be old & broken?
  17. mebbe go to MP & search for ... discord NOT designs
  18. This forum is for help with current script projects, the forums you need are here .... https://community.secondlife.com/forums/forum/124-commerce-forum/
  19. some ideas... for the json.. string j_obj = llList2Json( JSON_OBJECT, [ "name", "test", "url", myURL // or llUnescapeURL(myURL) ]); then you could send it as a get, post, response etc... llHTTPResponse(id, 200, j_obj); if you use google apps scripts, your Code.gs script might look something like... (if your url was stored in cell A2 , and the name of the sheet was ... "Data") // to set let url = "https://docs.google.com/spreadsheets/d/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/edit#gid=0"; function doGet(e) { if ( e != "") { var urlLink = e.parameter.txt; let ss = SpreadsheetApp.openByUrl(url); let ws = ss.getSheetByName("Data"); ws.getRange("A2").setValue(urlLink); return ContentService.createTextOutput("Url set") .setMimeType(ContentService.MimeType.TEXT); } }; // to get let url = "https://docs.google.com/spreadsheets/d/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/edit#gid=0"; function doGet(e) { if ( e != "") { let ss = SpreadsheetApp.openByUrl(url); let ws = ss.getSheetByName("Data"); let resp = ws.getRange("A2").getValue(); return ContentService.createTextOutput("url: " + resp) .setMimeType(ContentService.MimeType.TEXT); } }; assuming your send code was something like... string URL = "https://script.google.com/macros/s/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/exec?txt="; http_request_id = llHTTPRequest(URL + myURL, [HTTP_METHOD, "GET", HTTP_MIMETYPE, "text/plain", HTTP_BODY_MAXLENGTH,16384, HTTP_PRAGMA_NO_CACHE,TRUE], ""); and myURL was set with llRequestSecureURL(); ? refernce vid for apps scripts: ...
  20. if JSON doesnt freak you out, you could do something like this small example... ( you can drop this in a box, touch it, then do ... /99 test ... to see it work ) string Reminders; init() { Reminders = llList2Json( JSON_OBJECT, [] ); } addReminder( string name , string dateTime, string text ) { if (llJsonGetValue ( Reminders, [name] ) == JSON_INVALID) // if there is not a JSON key-value pair in the JSON object, add one { Reminders = llJsonSetValue ( Reminders, [name, "Date_Time"], dateTime); Reminders = llJsonSetValue ( Reminders, [name, "Reminder_Text"], text); } } default { state_entry() { llListen(99,"","",""); } touch_start(integer total_number) { llOwnerSay("Populating..."); string name = "Your Name"; string dateTime = "2020-08-13T16:33Z"; string text = "SHopping Event"; addReminder( name , dateTime, text ); } listen( integer vIntChn, string vStrNom, key vKeySpk, string vStrMsg ) { if( vIntChn == 99) { string info1 = llJsonGetValue ( Reminders, [ "Your Name", "Date_Time"]) ; string info2 = llJsonGetValue ( Reminders, [ "Your Name", "Reminder_Text"]) ; string info3 = llJsonGetValue ( Reminders, [ "Your Name" ]) ; llOwnerSay("got:\n1. " + info1 + "\n2. " + info2 + "\n3. " + info3); } } }
  21. if you wanted to play with json & http you could get utc really quick with... string url = "http://worldclockapi.com/api/json/utc/now"; key req; default { state_entry() { } touch_start(integer total_number) { llOwnerSay("Current UTC time..."); req = llHTTPRequest(url , [HTTP_USER_AGENT, "XML-Getter/1.0 (Mozilla Compatible)", HTTP_METHOD, "GET", HTTP_MIMETYPE, "application/json", HTTP_BODY_MAXLENGTH,16384, HTTP_PRAGMA_NO_CACHE,TRUE], ""); } http_response(key request_id, integer status, list metadata, string body) { string test1 = llJsonGetValue(body,["currentDateTime"]); string test2 = llJsonGetValue(body,["dayOfTheWeek"]); llOwnerSay("UTC: " + test1 + " * " + test2); } }
  22. it seems to work with a 120 sec timer.. i'm wondering if the headers on the site are relevant? Keep-Alive timeout=5, max=100 hmm
  23. I get a 502 alot using the exacat same script.. is this bad gateway a result of a throttle on the Linden Website?.. any ideas? it's just a basic request, but seems to work only every so often.. string URL_RESIDENT = "http://world.secondlife.com/resident/" + (string)llGetOwner() ; http_request_id = llHTTPRequest( URL_RESIDENT , [ HTTP_USER_AGENT, "LSL_Script(Mozilla Compatible)", HTTP_METHOD, "GET", HTTP_MIMETYPE, "text/plain", HTTP_BODY_MAXLENGTH,16384, HTTP_PRAGMA_NO_CACHE,TRUE ], "");
  24. i also use Rolig's method, since i was having trouble with not getting responses due to lag or somesuch
  25. some ideas on Listens ... you could use the owner's id & the item/hud/rezzer's id to create a unique channel. ownerChan = 0x80000000 | (integer)("0x"+(string)llGetOwner() ); itemChan = 0x80000000 | (integer)("0x"+(string)llGetKey() ); chan = ownerChan + itemChan; chan_handle = llListen(chan,"","",""); this might be good for a rezzer, which has items that need to listen to the rezzing obj. you could also just use a name, if you have a specific item you need to talk to. string itemName = "receiver_one"; string msg= "|color|<0,1,0>"; llRegionSay(ownerChan, itemName + msg ); and in the receiving obj, check for the name... myName = llGetObjectName(); list sent = llParseString2List(message,["|"],[""]); if(llList2String( sent,0) != myName) return; string command = llList2String( sent,1); string command_text = llList2String( sent,2); // change to vector, rot etc if needed just looking for different ways to do things ....
×
×
  • Create New...