Jump to content

Xiija

Resident
  • Posts

    912
  • Joined

  • Last visited

Everything posted by Xiija

  1. @ArmTwilight this is close, you could mebbe tweak it from here... vector position; rotation facing; key agent ; default { on_rez(integer param) { llResetScript(); } state_entry() { } changed(integer change) { if (change & CHANGED_LINK) { agent = llAvatarOnLinkSitTarget( LINK_THIS); if (agent) { llRequestPermissions(agent,PERMISSION_CONTROL_CAMERA); } else { agent = NULL_KEY; } } } run_time_permissions(integer perm) { if (perm & PERMISSION_CONTROL_CAMERA) { llClearCameraParams(); llSetCameraParams([ CAMERA_ACTIVE, 1, // 1 is active, 0 is inactive CAMERA_FOCUS_LOCKED, TRUE, CAMERA_POSITION_LOCKED, TRUE ]); facing = llGetRot(); position = llGetPos() + <2.0, 0.0, 0.5> * facing; vector focus = position + llRot2Fwd(facing); llSetCameraParams([ CAMERA_FOCUS, focus, CAMERA_POSITION, position ]); } } }
  2. @ArmTwilight mebbe something like..( untested ) rotation boothRot = llGetRot(); vector boothPos = llGetPos(); vector offset = <2.0, 0.0, 0.2>; vector camfocus = boothPos + offset * boothRot;
  3. I've been staring at this too long guess... I'm trying to get the value from a json string... just missing some simple thing i think? ( from the wiki ... http://wiki.secondlife.com/wiki/Json_usage_in_LSL ) default { state_entry() { } touch_start(integer total_number) { string json1 = " { 'alpha': 1, 'beta': [ 'x', 'y', 'z' ], 'gamma': { 'a': 3.2, 'b': true } }"; // --------- list jlist = llJson2List(json1); string jstring = llList2Json( JSON_OBJECT , jlist ); string j2 = llList2Json( JSON_OBJECT , [json1] ); /* llJsonGetValue ( value, [ "alpha" ] ) ⇒ 1 llJsonGetValue ( value, [ "beta" ] ) ⇒ [ "x", "y", "z" ] llJsonGetValue ( value, [ "beta", 2 ] ) ⇒ z llJsonGetValue ( value, [ "gamma", "a" ] ) ⇒ 3.2 */ llOwnerSay("JSON: " + llJsonGetValue ( jstring, ["alpha" ] ) ); llOwnerSay("JSON: " + llJsonGetValue ( json1, ["alpha" ] ) ); llOwnerSay("JSON: " + llJsonGetValue ( j2, ["alpha" ] ) ); llOwnerSay("JSON: " + json1 ); } } ETA: my bad, i didn't read to the end & forgot to parse it separately... string value = llList2Json( JSON_OBJECT, ["alpha", 1, "beta", llList2Json( JSON_ARRAY, [ "\"x\"", "\"y\"", "\"z\"" ] ), "gamma", llList2Json( JSON_OBJECT, [ "a", 3.2, "b", JSON_TRUE ] )] );
  4. sounds like your checker script is doin something weird then? mebbe try adding your own memory checker inside your script? kinda like ... integer mem = llGetUsedMemory( ); llOwnerSay("MEM: " + (string)mem );
  5. if you do a ... reset scripts .. it should show you the names of all the scripts in your item... then you can check them all for the leak mebbe? I've had times where i copy pasted and the blank or bad spaces i copied caused my script to bork.. hadda redo it from scratch, not just copy it to a new prim You could also try ... Stop Scripts .. and just turn your own script on and see if it still happens?
  6. @sayua If you just want a simple rot in place 90 deg, mebbe kinda like ... Touch object: integer ownerChan; default { state_entry() { ownerChan = 0x80000000 | (integer)("0x"+(string)llGetOwner() ); } touch_start(integer num) { llRegionSay(ownerChan,"TURN"); } } Rotating object: integer ownerChan; integer Swing = 90; rotation Rot; default { state_entry() { Rot = llEuler2Rot( <0.0, 0.0, (float)Swing * DEG_TO_RAD> ); ownerChan = 0x80000000 | (integer)("0x"+(string)llGetOwner() ); llListen(ownerChan,"","TURN",""); } listen(integer channel, string name, key id, string message) { if( message == "TURN") { llSetLocalRot( Rot * llGetLocalRot() ); } } } if you want it to rotate 180 deg, and back to normal, change the 90 to 180 , and change the rotation line to: llSetLocalRot( ZERO_ROTATION / Rot * llGetLocalRot() );
  7. is your script fp? is your jewelry? if so, yo could just use SLPPF ... http://wiki.secondlife.com/wiki/LlSetLinkPrimitiveParamsFast#llSetLinkPrimitiveParamsFast
  8. I've been using the LSL JSON stuff to store & retrieve from the exp key-value ... was just wondering if someone already did this, so I don't have to reinvent the wheel heh
  9. Just wondering if anyone had an example of an experience database, i've got mine half made, but could use a snippet or two for reference thnx !
  10. I put the regionsay in one prim and your script in the other, and it worked for me?
  11. this may help? avatarList += [ llGetSubString( llDetectedName(i), 0, 23 ) ];
  12. @Quistessa ty. @Indigo Somerset your http request might look something like this, and then you just parse the body in your http_response event? streamInfo() { string stream_base = llGetParcelMusicURL(); string v1 = "7.html"; string v2_a = "index.html?sid=1"; string v2_b = "currentsong?sid=1"; http_request_id = llHTTPRequest( url7 + v2_a , [ HTTP_USER_AGENT, "LSL_Script(Mozilla Compatible)", HTTP_METHOD, "GET", HTTP_MIMETYPE, "text/html", HTTP_BODY_MAXLENGTH,16384, HTTP_PRAGMA_NO_CACHE,TRUE ], ""); }
  13. i have one, but thanks to typical SL BS, it won't work ... no idea why, i feel like i am going insane sometimes, trying to script in SL. i have this in a script. touch_start(integer total_number) { llOwnerSay("touched"); string stream_base = llGetParcelMusicURL(); llOwnerSay("base: " + stream_base); } it works undeeded, when i share / deed it, then touch, it wont work. i've tried taking it into inv, re-rez, re-deed... no luck. i have correct tag and it's shared with that group. arg?
  14. @Birdguru make sure you have no whitespace after your one line in your notecard. here is mine, working....
  15. Heya @Birdguru, here is a snippet that seems to work ?.. string msg = "Default message here!!! "; string mess; string color = "rand"; string CurrNC; key kQuery; integer from; integer x; default { state_entry() { llMessageLinked(LINK_SET, 0, "", "fw_reset"); CurrNC = llGetInventoryName(INVENTORY_NOTECARD,0); kQuery = llGetNotecardLine(CurrNC, 0); } touch_start(integer total_number) { } link_message(integer sender, integer num, string str, key id) { from = sender; if (id == "fw_ready") { llOwnerSay("FW text is up and running!"); llMessageLinked(LINK_SET, 0, "c=" + color + "; a=center", "fw_conf"); llSetTimerEvent(0.5); } } dataserver(key query_id, string data) { if (query_id == kQuery) { if (data == EOF) { if(mess != "") { msg = mess; } } else { mess = llStringTrim( data, STRING_TRIM ); llOwnerSay("mess : " + mess); kQuery = llGetNotecardLine(CurrNC, 1); } } } timer() { color = "rand"; llMessageLinked(LINK_SET, 0, "c=" + color + "; a=center", "fw_conf"); llMessageLinked(from, 0, msg , "fw_data"); llSetTimerEvent(6.0); } changed(integer change) { if (change & CHANGED_INVENTORY) { llOwnerSay("The inventory has changed."); llResetScript(); } } }
  16. you could use one of the many scripts in the pinned door post, Door Scripts or try this one... ( you can change the rotation vector to fit your needs ) /* * Smooth Rotating Linked Door With Hinge * * By: Lyn Mimistrobell * Version: 1.1 * License: Do whatever you like with it, just don't blame me if you break it :) */ vector ROTATION = <0.0, 0.0, 80.0>; vector HINGE_POSITION = <-0.8, 0.05, 0.0>; integer gClosed = TRUE; // Door state: TRUE = closed, FALSE = opened rotation gRotationClosed; // Initial rotation of the door (closed) vector gPositionClosed; // Initial position of the door (closed) doOpenOrClose() { integer linkNumber = llGetLinkNumber(); if (gClosed) { gPositionClosed = llGetLocalPos(); gRotationClosed = llGetLocalRot(); } vector hingePosition = gPositionClosed + HINGE_POSITION * gRotationClosed; gClosed = !gClosed; if (gClosed) { llSetLinkPrimitiveParamsFast(linkNumber, [PRIM_ROT_LOCAL, gRotationClosed, PRIM_POS_LOCAL, gPositionClosed]); } else { rotation rotationOpened = llEuler2Rot(ROTATION * DEG_TO_RAD) * gRotationClosed; vector positionOpened = hingePosition - HINGE_POSITION * rotationOpened; llSetLinkPrimitiveParamsFast(linkNumber, [PRIM_ROT_LOCAL, rotationOpened, PRIM_POS_LOCAL, positionOpened]); llSetTimerEvent(5); } } default { state_entry() { } on_rez(integer param) { llResetScript(); } touch_start(integer agentCount) { doOpenOrClose(); } timer() { llSetTimerEvent(0.0); if (! gClosed) doOpenOrClose(); } }
  17. Xiija

    Profile Icons

    we used to be able to use icons in our profiles, is this still do-able? thanx for any...
  18. perfect, ty all so much
  19. so, I have several flags/toggles , and would like to check their state. Using code from these forums, i can type a number on channel 2 and toggle bitflags. integer ttl_Bits; default { state_entry() { llListen(2, "", llGetOwner(), ""); } listen(integer c, string n, key i, string m) { ttl_Bits = ttl_Bits ^ (1 << (integer)m); llOwnerSay( "\nBit-flag: " + m + " is toggled " + llList2String(["OFF","ON"], (ttl_Bits >> (integer)m) & 0x1) + "\nTotal of Bits: " + (string)ttl_Bits + "\n" ); } } If I toggle flags 1,2,3 & 4 on - the ttl is 30. If I toggle flags 1,2, 4 on - the ttl is 22. is there any way to use the ttl number to decode which flags are on? Thanx for any ...
  20. @Chantilly Levee just don't multiply by the rezzer's rotation? touch_start(integer total_number) { string myObj = llGetInventoryName( INVENTORY_OBJECT,0 ); vector myPos = llGetPos(); vector rezPos = myPos + <2.0, 0.0, 0.2>; // or region coordinates vector rezVel = <1.0, 0.0, 0.0>; rotation rezRot = llEuler2Rot(<0.0, 0.0, 0.0> * DEG_TO_RAD ); integer param = 10; llRezAtRoot(myObj, rezPos, rezVel, rezRot, param); }
  21. A quick way to set and append data to a Sheet with Apps Scripts... Set & Append to a Sheet
  22. Xiija

    deleted

    deleted
  23. re: Google Apps Script to store data to a google doc, you can use an apps script. in my test, i use a GET request with 3 params... date, a message, and id the apps script will check if the id is blank, and if so it creates a new doc with the date as the title, and send that doc's id in the http response. if the SL prim gets an id, it can send it next time.. then the apps script will append to the current doc. you just need to set a timer & clear the id variable in SL on a date change. here is the Apps script to test with, if ya need the Sl bit, i can post that too. Google create doc apps script
  24. re: Google Apps Scripts After some testing, i was able to do a POST thru sl only by going SL > thru repl.it > google apps script > repl.it > back to SL it seems google apps scripts use a redirect, and Sl only follows those if the request is GET.. i've got a GET apps script working, & will post it soon
  25. Not sure if you are asking for help? mebbe mention what viewer you are using, the instructions you are following, and any error messages if you are? also, mebbe not a scripting question?.. you could try here... general-second-life-tech-discussion
×
×
  • Create New...