Jump to content

Search the Community

Showing results for tags 'json'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • People Forum
    • Your Avatar
    • Make Friends
    • Lifestyles and Relationships
    • Role Play
    • General Discussion Forum
    • Forums Feedback
    • Missed Connections
    • Second Life Education and Nonprofits
  • Places and Events Forum
    • Favorite Destinations
    • Upcoming Events and Activities
    • Games in Second Life
  • Official Contests, Events & Challenges
    • Challenges
    • Contests
  • Creation Forum
    • Fashion
    • Art, Music and Photography
    • Animation Forum
    • Bakes on Mesh
    • Environmental Enhancement Project
    • Machinima Forum
    • Building and Texturing Forum
    • Mesh
    • LSL Scripting
    • LSL Library
    • Experience Tools Forum
  • Technology Forum
    • Second Life Server
    • Second Life Viewer
    • Second Life Web
    • General Second Life Tech Discussion
    • Mobile
  • Commerce Forum
    • Merchants
    • Inworld Employment
    • Wanted
  • Land Forum
    • General Discussion
    • Mainland
    • Linden Homes
    • Regions for Sale: Full Private Island
    • Region for Rent: Full Private Island
    • Regions for Sale: Homesteads
    • Region Rentals: Homestead
    • Parcels for Sale: Mainland
    • Parcels for Rent: Mainland
    • Wanted: Full Private Island
    • Wanted: Homesteads
    • Wanted: Mainland
  • International Forum
    • Deutsches Forum
    • Foro en español
    • Forum in italiano
    • Forum français
    • 日本語フォーラム
    • 한국어 포럼
    • Fórum em português
    • Forum polskie
    • المنتدى العربي
    • Türkçe Forum
    • Форум по-русски
  • Adult Content Forum
    • Highlight Upcoming Events
    • General Discussion
    • General Announcements
  • Answers
    • Abuse and Griefing
    • Account
    • Avatar
    • Creation
    • Inventory
    • Getting Started
    • Controls
    • Land
    • Linden Dollars (L$)
    • Shopping
    • Technical
    • Viewers
    • Everything Else
    • International Answers

Blogs

  • Commerce
  • Featured News
  • Inworld
  • Tools and Technology
  • Tips and Tricks
  • Land
  • Community News

Categories

  • English
  • Deutsch
  • Français
  • Español
  • Português
  • 日本語
  • Italiano
  • Pусский
  • Türkçe

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Member Title

Found 4 results

  1. I would like to send JSON messaging between two prims that are located in two different regions without having to reach out to an external webserver to do so. I have considered using a prim scripted with llHTTPRequest to contact another by key using XMLRPC scripting, but have read that XMLRPC is old school and replaced with llHTTPRequest. What is the best way to do this using modern LSL techniques?
  2. Xiija

    JSON help?

    trying to do nested objects, tried arrays but failed there too... premise: 2 notecards, one named rock, site1 # url1 site2 # url2 one named jazz site1 # url1 site2 # url2 ------- possible pre definitions? ------- info = llList2Json (JSON_OBJECT, [ "TITLE", JSON_NULL, "URL", JSON_NULL ] ); notecards = llList2Json( JSON_OBJECT, [] ); --------------------------------------------------------------------------------- example: CurrNC = rock, string title = site1, string url = url1 in the data server event: if (llJsonGetValue (notecards, [CurrNC] ) == JSON_INVALID) { notecards = llJsonSetValue (notecards, [CurrNC] ,info) ; // trying to create a "ROCK" object in the notecards object } title = site1; url = url1; if (llJsonGetValue (CurrNC, [title] ) == JSON_INVALID) // if there is not a JSON key-value pair in the JSON object, add one { notecards = llJsonSetValue (notecards, [CurrNC, "URL"] ,url) ; notecards = llJsonSetValue (notecards, [CurrNC, "TITLE"] ,title) ; } and then trying to get the syntax to get these infos? getInfo(string card) { list details = llJson2List (llJsonGetValue ( notecards,[card] ) ); list fields = llList2ListStrided (details, 0, -1, 2); list send = []; integer len = llGetListLength(fields); integer x; for(;x < len;++x) { string tmp = llList2String(fields,x); send += tmp + " @ " + llJsonGetValue (notecards, [card, tmp]); } llSay(0,"\nInfo for " + card + "\n" + llDumpList2String(send,"\n")); } thanx for any help
  3. a Multi notecard reader using JSON . There may be monsters ( or bugs) , but it shows how to nest JSON objects and call their values... notecard lines are in the format: Birdsong = http://stardust.wavestreamer.com:8062 /* Xiija Resident, 2017 Json Radio example with moded VoidSinger Dialog code */ string station; string NC; string TuneIn; integer iLine; integer len; string Curr; list gLstMnu; string txt; key id; integer chan ; integer handle; integer idx; integer ttlPG; integer currPG = 1; // ---------------------- string name; integer ttl_NC; integer NC_lines; key query_id; integer count; string CurrNC; list myNCs; integer card_index; key kQuery; integer index; string stations; string notecards; string title; string url; list uDlgBtnLst( integer vIdxPag ) { list vLstRtn; if ((gLstMnu != []) > 9) { integer vIntTtl = -~((~([] != gLstMnu)) / 9); //-- Total possible pages integer vIdxBgn = (vIdxPag = (vIntTtl + vIdxPag) % vIntTtl) * 9; //-- first menu index string vStrPag = llGetSubString( " ", 21 - vIdxPag, 21 ); //-- encode page number as spaces vLstRtn = llListInsertList( llList2List( gLstMnu, vIdxBgn, vIdxBgn + 8 ), (list)(" «" + vStrPag), vIdxBgn + 9 ) + "OFF/CLOSE" + (list)(" »" + vStrPag); } else { vLstRtn = gLstMnu + [" ", "OFF/CLOSE"," "] ; } return //-- fix the order for [L2R,T2B] and send it out llList2List( vLstRtn, -3, -1 ) + llList2List( vLstRtn, -6, -4 ) + llList2List( vLstRtn, -9, -7 ) + llList2List( vLstRtn, -12, -10 ); } init() { chan = 0x80000000 | (integer)("0x"+(string)llGetOwner()); // unique channel based on owners UUID stations = llList2Json (JSON_OBJECT, [] ); notecards = llList2Json( JSON_OBJECT, [] ); ttl_NC = llGetInventoryNumber( INVENTORY_NOTECARD ); CurrNC = llGetInventoryName(INVENTORY_NOTECARD,0); llSay(0,"Stations Loading....."); kQuery = llGetNotecardLine(CurrNC, count); txt = "\n Radio Menu\nPage : " + (string) currPG + " of " + (string)ttlPG + "\n \nOff - turns off radio\nCLOSE - closes this menu\n \nCurrently listening to " + "\n " + Curr; } read_card() { CurrNC = llGetInventoryName(INVENTORY_NOTECARD,card_index); kQuery = llGetNotecardLine(CurrNC, count); } get_NC_names() // *******************get notecard names { myNCs = []; list details = llJson2List ( notecards ); list fields = llList2ListStrided (details, 0, -1, 2); integer len = llGetListLength(fields); integer x; for(;x < len;++x) { string tmp = llList2String(fields,x); myNCs += tmp; } gLstMnu = myNCs; } card_2_buttons( string card) // *************populate butn list { string Js = llJsonGetValue( notecards, [card]); list Jl = llParseString2List( Js, [ "," , "[" , "]", "{", "}" ], [] ); Jl = llList2ListStrided (Jl, 0, -1, 2); gLstMnu = Jl; integer c = llGetListLength(gLstMnu); ttlPG = llCeil(c/9.0 ); txt = "\n Radio Menu\nPage : " + (string) currPG + " of " + (string)ttlPG + "\n \nOff - turns off radio\nCLOSE - closes this menu\n \nCurrently listening to " + "\n " + Curr; llDialog( id, txt, uDlgBtnLst( 0 ), chan ); } default { state_entry() { init(); } on_rez(integer param) { init(); } touch_start(integer total_number) { id = llDetectedKey(0); get_NC_names(); llDialog( id, txt, uDlgBtnLst( 0 ), chan ); handle = llListen(chan,"","",""); llListenControl(handle, TRUE); llSetTimerEvent(20); } dataserver(key query_id, string data) { if (query_id == kQuery) { if (data == EOF) { count = 0; ++card_index; llOwnerSay( CurrNC + " - Notecard loaded - "); if( card_index < ttl_NC) { read_card(); } else { llOwnerSay( " ALL Notecards loaded"); card_index = 0; } } else { if(data != "") { if (llJsonGetValue (notecards, [CurrNC] ) == JSON_INVALID) { notecards = llJsonSetValue (notecards, [CurrNC] , stations) ; // *** add names to notecard object llOwnerSay("adding NC : " + CurrNC ); } list extract = llParseString2List(data,[" "],["="]); title = llList2String(extract, 0); title = llGetSubString(title, 0, 13) ; // a check ..if !( name = 0 < button_text_length < 13) url = llList2String(extract, 2); if (llJsonGetValue (notecards, [CurrNC,title] ) == JSON_INVALID) { notecards = llJsonSetValue (notecards, [CurrNC , title, "URL"], url); // add title and url } } ++count; kQuery = llGetNotecardLine(CurrNC, count); } } } listen( integer vIntChn, string vStrNom, key vKeySpk, string vStrMsg ) { if (!llSubStringIndex( vStrMsg, " " )) { integer SSI = llSubStringIndex(vStrMsg, "»"); if(SSI == 1) { ++currPG; if(currPG > ttlPG) { currPG = 1;} } else { --currPG; if(currPG < 1) { currPG = ttlPG;} } txt = "\n Radio Menu\nPage : " + (string) currPG + " of " + (string)ttlPG + "\n \nOff - turns off radio\nCLOSE - closes this menu\n \nCurrently listening to " + "\n " + Curr; llDialog( vKeySpk, txt, uDlgBtnLst( llStringLength( vStrMsg ) + llSubStringIndex( vStrMsg, "»" ) - 2 ), vIntChn ); llSetTimerEvent(20); } else if (vStrMsg == "OFF/CLOSE") { llDialog( vKeySpk, "\n \nPick an option...",["OFF","CLOSE"], vIntChn );} else if (vStrMsg == "CLOSE") { llSetTimerEvent(0.5);} else if (vStrMsg == "OFF") { llListenControl(handle, FALSE); llSetParcelMusicURL(" "); llSay(0,"Turning Radio off... " ); llSetTimerEvent(0); llMessageLinked(LINK_THIS, 0, TuneIn, ""); // for a seperate titler script perhaps? } else { if (~llListFindList( myNCs,[vStrMsg]) ) // if Dialog sent a NC name { card_2_buttons( vStrMsg ); return; } Curr = vStrMsg; llSay(0,"Tuning in to... " + vStrMsg ); TuneIn = llJsonGetValue (stations, [vStrMsg, "URL"]) ; llSetParcelMusicURL(TuneIn); idx = llListFindList( gLstMnu, (list)vStrMsg ) / 9; txt = "\n Radio Menu\nPage : " + (string) currPG + " of " + (string)ttlPG + "\n \nOff - turns off radio\nCLOSE - closes this menu\n \nCurrently listening to " + "\n " + Curr; llDialog( id, txt, uDlgBtnLst(idx ), chan ); llSetTimerEvent(20); llMessageLinked(LINK_THIS, 1, TuneIn, ""); // for a seperate titler script perhaps? } } timer() { llListenControl(handle, FALSE); llSetTimerEvent(0); } changed(integer change) { if (change & (CHANGED_REGION_START | CHANGED_OWNER | CHANGED_INVENTORY) ) { llOwnerSay("Radio Resetting..."); llResetScript(); } } }
  4. JSON radio example with moded VoidSinger dialog code. Parcel radios must usually be deeded. Notecard station format is... SecretAgent = http://mp2.somafm.com:9016 Techno = http://81.88.36.42:8010 etc.... _________________________________________________ /* Xiija Resident, 2017 Json Radio example with moded VoidSinger Dialog code */ string station; string Stations; string name; string url; string NC; string TuneIn; key kQuery; integer iLine; integer len; string Curr; list gLstMnu; string txt; key id; integer chan ; integer handle; integer idx; integer ttlPG; integer currPG = 1; list uDlgBtnLst( integer vIdxPag ) { list vLstRtn; if ((gLstMnu != []) > 9) { integer vIntTtl = -~((~([] != gLstMnu)) / 9); //-- Total possible pages integer vIdxBgn = (vIdxPag = (vIntTtl + vIdxPag) % vIntTtl) * 9; //-- first menu index string vStrPag = llGetSubString( " ", 21 - vIdxPag, 21 ); //-- encode page number as spaces vLstRtn = llListInsertList( llList2List( gLstMnu, vIdxBgn, vIdxBgn + 8 ), (list)(" «" + vStrPag), vIdxBgn + 9 ) + "OFF/CLOSE" + (list)(" »" + vStrPag); } else { vLstRtn = gLstMnu + [" ", "OFF/CLOSE"," "] ; } return //-- fix the order for [L2R,T2B] and send it out llList2List( vLstRtn, -3, -1 ) + llList2List( vLstRtn, -6, -4 ) + llList2List( vLstRtn, -9, -7 ) + llList2List( vLstRtn, -12, -10 ); } init() { chan = 0x80000000 | (integer)("0x"+(string)llGetOwner()); // unique channel based on owners UUID NC = llGetInventoryName(INVENTORY_NOTECARD,0); Stations = llList2Json( JSON_OBJECT, [] ); // must declare JSON object before using. llSay(0,"Stations Loading....."); kQuery = llGetNotecardLine(NC, iLine); txt = "\n Radio Menu\nPage : " + (string) currPG + " of " + (string)ttlPG + "\n \nOff - turns off radio\nCLOSE - closes this menu\n \nCurrently listening to " + "\n " + Curr; } default { state_entry() { init(); } on_rez(integer param) { init(); } touch_start(integer total_number) { id = llDetectedKey(0); llDialog( id, txt, uDlgBtnLst( 0 ), chan ); handle = llListen(chan,"","",""); llListenControl(handle, TRUE); llSetTimerEvent(20); } dataserver(key query_id, string data) { if (query_id == kQuery) { if (data == EOF) { iLine = 0; llSay(0,"Stations Loaded"); list details = llJson2List ( Stations ); details = llList2ListStrided(details,0,-1,2); // strided list of button names from notecard gLstMnu = details; integer c = llGetListLength(gLstMnu); ttlPG = llCeil(c/9.0 ); txt = "\n Radio Menu\nPage : " + (string) currPG + " of " + (string)ttlPG + "\n \nOff - turns off radio\nCLOSE - closes this menu\n \nCurrently listening to " + "\n " + Curr; } else { if(data != "") { list extract = llParseString2List(data,[" "],["="]); name = llList2String(extract, 0); name = llGetSubString(name, 0, 23) ; // a check ..if !( name = 0 < button_text_length < 23) url = llList2String(extract, 2); if (llJsonGetValue (Stations, [name] ) == JSON_INVALID) // if not a JSON key-value pair in the JSON object, add one { Stations = llJsonSetValue (Stations, [name, "URL"], url); } } ++iLine; kQuery = llGetNotecardLine(NC, iLine); } } } listen( integer vIntChn, string vStrNom, key vKeySpk, string vStrMsg ) { if (!llSubStringIndex( vStrMsg, " " )) { integer SSI = llSubStringIndex(vStrMsg, "»"); if(SSI == 1) { ++currPG; if(currPG > ttlPG) { currPG = 1;} } else { --currPG; if(currPG < 1) { currPG = ttlPG;} } txt = "\n Radio Menu\nPage : " + (string) currPG + " of " + (string)ttlPG + "\n \nOff - turns off radio\nCLOSE - closes this menu\n \nCurrently listening to " + "\n " + Curr; llDialog( vKeySpk, txt, uDlgBtnLst( llStringLength( vStrMsg ) + llSubStringIndex( vStrMsg, "»" ) - 2 ), vIntChn ); llSetTimerEvent(20); } else if (vStrMsg == "OFF/CLOSE") { llDialog( vKeySpk, "\n \nPick an option...",["OFF","CLOSE"], vIntChn );} else if (vStrMsg == "CLOSE") { llSetTimerEvent(0.5);} else if (vStrMsg == "OFF") { llListenControl(handle, FALSE); llSetParcelMusicURL(" "); llSay(0,"Turning Radio off... " ); llSetTimerEvent(0); llMessageLinked(LINK_THIS, 0, TuneIn, ""); // for a seperate titler script perhaps? } else { Curr = vStrMsg; llSay(0,"Tuning in to... " + vStrMsg ); TuneIn = llJsonGetValue (Stations, [vStrMsg, "URL"]) ; llSetParcelMusicURL(TuneIn); idx = llListFindList( gLstMnu, (list)vStrMsg ) / 9; txt = "\n Radio Menu\nPage : " + (string) currPG + " of " + (string)ttlPG + "\n \nOff - turns off radio\nCLOSE - closes this menu\n \nCurrently listening to " + "\n " + Curr; llDialog( id, txt, uDlgBtnLst(idx ), chan ); llSetTimerEvent(20); llMessageLinked(LINK_THIS, 1, TuneIn, ""); // for a seperate titler script perhaps? } } timer() { llListenControl(handle, FALSE); llSetTimerEvent(0); } changed(integer change) { if (change & (CHANGED_REGION_START | CHANGED_OWNER | CHANGED_INVENTORY) ) { llOwnerSay("Radio Resetting..."); llResetScript(); } } }
×
×
  • Create New...