Xiija

Resident
  • Content count

    487
  • Joined

  • Last visited

Community Reputation

68 Excellent

About Xiija

  • Rank
    Advanced Member

Recent Profile Visitors

182 profile views
  1. wiki user page creation

    ah okay thanks If I did, i guess the first page I would edit is the one that says how anyone can create a page lol
  2. any info on how to create a wiki user page?. i watched the vids etc, but my page says " you do not have permission to create this page. " weird?
  3. JSON help?

    Thanks, i kept at it and finally think I got it was a combination of bad syntax, code errors, and ..."i've been staring at this too long" here is the multi NC reader I would post a link in the wiki, but don't know if I can?
  4. 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(); } } }
  5. JSON help?

    erm ok, can anyone please give a demonstration of how to nest a JSON obect in another object or an array? i'm not talking about the visualization of it, I.E. { "alpha": 1, "beta": [ "x", "y", "z" ], "gamma": { "a": 3.2, "b": true } } i'm talking about, how to write it in LSL.. i need to nest either an obect in an object, or an object in an array. right now I can do an object ( called stations) which I can set the key value pairs of "name" and "url" for multple entries in a notecard, ... what i'm trying to do is read Multiple notecards, and so have a higher level object or array to hold those notecard names, which will then hold the stations for that notecard. ... and how to call the info with llJsonGetValue() ....hope that is clearer? thanx for any help, X.
  6. Key Control Breaks when adding msg==

    for the HOLD ...mebbe something like if((change & CONTROL_UP) && (held & CONTROL_UP)) { // moving } if((change & CONTROL_UP) && !(held & CONTROL_UP)) { // stopped }
  7. 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
  8. Making a object walk aimlessly

    here is a small script that may help show how to choose which way it's facing.... not sure if your timer event being 1 second, and your move being 5 seconds will matter, also you get the beginning pos, not the current obj pos for your move?... ( drop in a box and touch to start/stop, timer & move both at 5 seconds) integer k; vector pos; vector vPosTarget; move() { vPosTarget = llGetPos() ; vPosTarget.x += llFrand(6.0) - 3.0; //Random number between -5 and 5 vPosTarget.y += llFrand(6.0) - 3.0; //Random number between -5 and 5 llSleep(0.3); llRotLookAt( llRotBetween( < 1.0, 0.0, 0.0>, llVecNorm( vPosTarget - llGetPos() ) ), 1.0, 0.5 ); llMoveToTarget(vPosTarget,5); llSetStatus(STATUS_PHYSICS, TRUE); } default { state_entry() { pos = llGetPos(); llSetStatus(STATUS_ROTATE_X | STATUS_ROTATE_Y , FALSE); llSetStatus(STATUS_PHYSICS, TRUE); llSetHoverHeight(pos.z - llGround(ZERO_VECTOR) + 0.7, FALSE, 1.0); llSleep(5); llSetStatus(STATUS_PHYSICS,FALSE); } touch_start(integer total_number) { if(k = !k) { llSetStatus(STATUS_PHYSICS, TRUE); move(); llSetTimerEvent(5.0); } else { llStopMoveToTarget(); llSetTimerEvent(0.0); llSetStatus(STATUS_PHYSICS,FALSE); } } timer() { move(); } }
  9. Prim Counter Help

    you could make an object with a sensor ( 96m area max) and add something like... list details = llGetObjectDetails(id, ([OBJECT_NAME, OBJECT_ROOT, OBJECT_OWNER, OBJECT_GROUP, OBJECT_CREATOR])); and move it around , adding to list only if it is not in the list already?
  10. Link Sit Target woes

    Ooo good call Arton, i may have fixed it tysm !
  11. Link Sit Target woes

    the reason i'm doing this is , I have been trying to make a sit target setter HUD,... you drop the script into any furniture cushion, wear the HUD, and use a keypad to move the avatar and set the sit target for that cushion. I made a bunch of mesh bean bags and chairs, and was looking to be able to just drop in a script, use a HUD and *presto* lol. i'll try subtracting or dividing the cushion pos & rot from the avatar stuff and see if that helps... mebbe the AVsitter code will have some insights too . ************** The sit target offset would have to be local to the child prim. *************** mebbe something like....? SetPositionLocalToCurrentPosition(vector local_position) { llSetPos( llGetLocalPos() + (local_position * llGetLocalRot() ) ); } or vector pos2_obj = (pos_region - llGetRootPosition()) / llGetRootRotation(); rotation rot2_obj = rot_region / llGetRootRotation(); ::shrugs:: **edit: a function from AV sitter ... string convert_to_world_positions(integer num) { list details = llGetObjectDetails(llGetLinkKey(llGetLinkNumber()), [OBJECT_POS, OBJECT_ROT]); rotation target_rot = llEuler2Rot(llList2Vector(ROT_LIST, num) * DEG_TO_RAD) * llList2Rot(details, 1); vector target_pos = llList2Vector(POS_LIST, num) * llList2Rot(details, 1) + llList2Vector(details, 0); return (string)target_pos + "|" + (string)target_rot; }
  12. Link Sit Target woes

    i hope when AVsitter is released i can just play with that, untill then - rez 2 boxes, link em and put this script in the child. if i sit on the child and click that box, it moves my avatar, ... and is supposed to renew the sitTarget, but when i stand and sit back down, the sit target is way off? tried everything i can think of thanx for any advice, X vector sitPos; vector sitRot; integer avLink; string anim ; list local; vector mypos; rotation myrot; rotation R_avRot; rotation V2Rrot; updateSitTrg(integer link,vector avPos, vector avRot) { key user = llAvatarOnLinkSitTarget(LINK_THIS); vector size = llGetAgentSize(user); R_avRot = llEuler2Rot(avRot * DEG_TO_RAD ); if(size) { local = llGetLinkPrimitiveParams(link, [PRIM_POS_LOCAL, PRIM_ROT_LOCAL]); ; mypos = llList2Vector(local,0); myrot = llList2Rot(local,1); mypos += avPos; myrot *= R_avRot; mypos.z -= ( (size.z/2) - 0.375 ); // height adjust? llSetLinkPrimitiveParamsFast(link, [PRIM_POS_LOCAL, mypos , PRIM_ROT_LOCAL, myrot ]); llOwnerSay("\n Sit Target after: \nPosition - " + (string)mypos + "\nRotation - " + (string)myrot); llLinkSitTarget(LINK_THIS,mypos * myrot , myrot); } } default { state_entry() { sitPos = <0.0, 0.0, 0.5>; sitRot = <0.0, 0.0, 0.0>; V2Rrot = llEuler2Rot(sitRot * DEG_TO_RAD ); llLinkSitTarget(LINK_THIS,sitPos, V2Rrot); } touch_start(integer total_number) { llOwnerSay("\n Sit Target before: \nPosition - " + (string)mypos + "\nRotation - " + (string)myrot); // sitPos += <0.05, 0.0, 0.0>; sitRot += <0.0, 0.0, 10.0>; updateSitTrg(avLink,sitPos,sitRot); } changed(integer change) { if (llAvatarOnSitTarget() != NULL_KEY) { llRequestPermissions(llAvatarOnSitTarget(), PERMISSION_TRIGGER_ANIMATION); llSetClickAction(CLICK_ACTION_TOUCH); avLink = llGetNumberOfPrims(); } else { llSetClickAction(CLICK_ACTION_SIT); avLink = 0; } } run_time_permissions(integer perm) { anim = llGetInventoryName(INVENTORY_ANIMATION, 0); if (anim != "") { llStopAnimation("sit"); llStartAnimation(anim); } } }
  13. Script of acceptance of terms

    the script is totally do-able using a timer, dialog box, llGetRegionAgentCount and llTeleportAgentHome .
  14. you need a return after the else... add an ...integer returnVal; and change your statements like ... return first - len; .... to ....returnVal = first - len; ( for all your return calls) and after the end of the ELSE... do... return returnVal;
  15. Change transparency of prims with the use of audio stream?

    most xml pages specify the type... <?xml version="1.0" encoding="UTF-8"?> i dunno, i just try to get in the habit of specifying the charset HTTP_MIMETYPE, "application/xml;charset=utf-8",