Jump to content

Darkie Minotaur

Resident
  • Posts

    1,663
  • Joined

  • Last visited

Everything posted by Darkie Minotaur

  1. Ahh - ok - I interpreted that as a typo. It would be helful if you stated such non-obvious matters. I think, what you want isn't really possible in the strictest sense. Apart from the fact, that you would have to define "English String" (what if expressions like a vector shows up - it's not an English word - but it's no number either. You could, hoever , to get as close as possible, look at something like this function (or the parts of it you need) to find out wehere you'd have to stop the reversal, generate the non-reversed sub-string, then insert this non-reversed sub-string into the new string an move on happily to reverse the string
  2. This sould do the trick: string gsSource = "abc";default{ touch_end(integer total_number) { string revstring = ""; integer i = llStringLength(gsSource); while (i > 0) { i--; revstring += llGetSubString(gsSource, i, i); } llOwnerSay("This is the string in reverse: " + revstring); } }
  3. This is actually not a group for asking for scripts, but fo helping with scripting issues or discussing them. If the scripts that you tried, turn your prism into a cube, there must be something like llSetPrimitiveParams or llSetLinkPrimitiveParams in the script, that changes the prim type - it would look like: llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX, 0,<0,1,0>, 0.0, <0,0,0>, <1.0,1.0,0>, <0,0,0>]); Just take that out. If the prim type is set together with the texture, take it out and replace it with llSetTexture
  4. If I understood correctly what you wanted, this should be it integer maxNumberOfHits = 10;//the maximum number of hits during gameplay the Target can take until the game will end//integer x = 0;//this is a 'toggle' that switches between TRUE (1) and FALSE (0) and is used to tell other parts of the script that the game has started and a specific function was triggeredinteger points = 0;//total amount of points earned during gameplyinteger yellow = 0;//amount of bullseyes hit during gameplayinteger numberOfHits = 0;//total amount of times the target was hit during gameplay///////////////////////////////integer main;//this is the name (integer) that represents the link number for the yellow (Target)say(string text)//just a cleaner looking way of calling 'llSay()'{ llSay(0,text);}endGame(){ llShout(-5870,"Your Score: "+"\n"+"yellow: "+(string)yellow+"\n"+"For a Total of "+(string)points+" Points");//say the scored points" Points");//say the scored points llSleep(1.0);//sleep for just a second in case other scripted events need to catch}reset()//reset common values. This function is called within the script to reset common values back to default{ points = 0;//reset the amount of points scored yellow = 0;//reset how many bullseyes were hit during gameplay numberOfHits = 0;//reset the amount of overall times the Target was hit during gameplay}default{ on_rez(integer p){ llResetScript(); } state_entry() { llSetTimerEvent(30.0); } collision(integer num_detected)//detect information about which part of the Target was hit during gameplay and then update values { integer hit = llDetectedLinkNumber(0);//the linked object number that was hit in the link set is labelled 'hit' if(hit == main)//if the link number that was hit matches the link number for the bullseye prim, then proceed.. { yellow += 1;//add a point to the amount of yellowtarget hit during gameplay points += 1;//add 10 points to the 'total points earned' during gameplay } numberOfHits += 1;//add a point to the amount of hits the Target has taken during gameplay if(numberOfHits >= 10)//if the Target has taken 20 hits during gameplay, then proceed to do the function 'endGame()' { llSetTimerEvent(0); endGame(); lSleep(5); llDie(); } } timer() { llSay(0, "I've been hit " + (string)numberOfHits + " times so far"); }}
  5. There are a range of functions, that you may want to look at, depending on what exactly you want to do. Start with llSetCameraAtOffset Nd then have a look at llSetCameraEyeOffset. Finally, look at llSetCameraParams which gives you the most control over the camera. Here some little tips: If you want to do something on sit, you have to set a sit target first (e.g in the state_entry) - see llSitTarget to get information on when an ava sits down on your object, you use rge change event (Changed) and check for a change in the link set (CHANGED_LINK). If there is such a change, check if there's an ava on the sit target using llAvatarOnSitTarget if your camera control requires permission, you should request permission at this point. You the wiki will tell you if that's necessary and the example will tell you what to do
  6. You can contact me here through PM or inworld through IM - sounds interesting, but there is a lot more to know, before one can really see what's to this job.
  7. This should do the trick string profile_key_prefix = "<meta name=\"imageid\" content=\"";string URL_RESIDENT = "http://world.secondlife.com/resident/";key default_texture = "89556747-24cb-43ed-920b-47caed15465f";default{ on_rez(integer start_param) { llSetTexture(default_texture, ALL_SIDES); llHTTPRequest( URL_RESIDENT + (string)llGetOwner(),[HTTP_METHOD,"GET"],""); } http_response(key req,integer stat, list met, string body) { integer s1 = llSubStringIndex(body, profile_key_prefix); key UUID=llGetSubString(body, s1+llStringLength(profile_key_prefix), s1+llStringLength(profile_key_prefix)+ 35); llOwnerSay(UUID); if (s1 != -1 && UUID != NULL_KEY) { llSetTexture(UUID, ALL_SIDES); } else { llSetTexture(default_texture, ALL_SIDES); llOwnerSay("No texture found"); } }}
  8. You can only read a nc in the same prim. But scripts can comminate in an object by using llMessageLinked - so if the nc is in prim A and you need the keys in prim B, you woud put script a in prim A and script b in prim B. a would read the card and send the information to b
  9. First question - yes, that's correct Second question - no. llOwnerSay is to say things just to the owner of an oject - others - including HUDs, don't hear it - and: you can't pass the fuction a channel
  10. I don't really your script samples, but I can try toanswer your questions: Use the key of the owner (using llGetOwner()) in the llListen command - read up here Look up here how to read a notecard - the examples should be very helpful To do so, just use llGetObjectName in die function mentioned in 2
  11. I have some questions, which may help to find a solution: Are all the prims (I guess you added some to an existing build) linked? You said, there is a script, that already existed - again, I assume, there was an original build you want to mod and this script was part of the original build - is that script the only one in the original linkset, or is there at least one in each alpha changing prim? If all is controlled from one script, maybe naming your new hidable prims exactly like on of the original hideable prims will do the trich - using llSetLinkPrimitiveParams, usually don't rely on the link numbers, but look for the prim names If that doesn't work, you can still follow your old path: on the change event, get the Alpha value of the prim that the original prim changes compare the Alpha vaue of that prim with your prim - and only change it, if they are not the same - that should do the trichk, if I understand you correctly
  12. You don't want to use a channel number and you don't want to see what you say to the object? If that's what you want to know - the answer: That isn't possible. You can make the object listen to channel 0 (which is a pretty bad idea) and what you say on it - but what you say appears in the local chat. If you want to day something on a different channel, you have to use a channel number.
  13. First of all - take a deep breath, sit down, and have a cup of tea. As for your case, there's a much better way than to use any n2k - just use ANS (Advanced Notofications). As far as I know, LL migrated that over to DD
  14. Your 'bank avi' has to be the owner of the ATM and grant permission to give out money. It seems that you used your main avi as the owner of the ATM
  15. It would be helpfull if you showed us the bit of your script that produces the output you get now.
  16. Here is a little test script you can use - it uses fsock <?php$url = '';//the URL of your object goes hereecho "Request answered<br>";$Data = CallLSLScript($url, "Hello this is a test");die($Data);function CallLSLScript($URL, $Data, $Timeout = 10) { echo "callscript: ".$URL."<br>"; //Parse the URL into Server, Path and Port $Host = str_ireplace("http://", "", $URL); $Path = explode("/", $Host, 2); $Host = $Path[0]; $Path = $Path[1]; $PrtSplit = explode(":", $Host); $Host = $PrtSplit[0]; $Port = $PrtSplit[1]; //Open Connection $Socket = fsockopen($Host, $Port, $Dummy1, $Dummy2, $Timeout); echo "<br>socket: ".$Socket."<br>"; if ($Socket) { //Send Header and Data fputs($Socket, "POST /$Path HTTP/1.1\r\n"); fputs($Socket, "Host: $Host\r\n"); fputs($Socket, "Content-type: application/x-www-form-urlencoded\r\n"); fputs($Socket, "User-Agent: Opera/9.01 (Windows NT 5.1; U; en)\r\n"); fputs($Socket, "Accept-Language: de-DE,de;q=0.9,en;q=0.8\r\n"); fputs($Socket, "Content-length: ".strlen($Data)."\r\n"); fputs($Socket, "Connection: close\r\n\r\n"); fputs($Socket, $Data); //Receive Data while(!feof($Socket)) {$res .= fgets($Socket, 128);} fclose($Socket); echo "sent<br>"; } //return the data to the bowser echo $res;}?> You have to add the URL of the object in the top part of the script. Call the script from a browser - it will give you some output - the variable $res will echo the full header and body of what the response of the object returned - the actual body is at the end. Here is the LSL script that goes with it: key gkURLReq;string gsURLOut;default { state_entry() { gkURLReq = llRequestURL(); } http_request(key id, string method, string body) { if (gkURLReq == id) { gkURLReq = ""; if (method == URL_REQUEST_GRANTED) { llSay(0,"URL: " + body); gsURLOut = body; } else if (method == URL_REQUEST_DENIED) { llInstantMessage(llGetOwner(), "Something went wrong at " + llGetTimestamp() + " , no url. " + body); } } else { llOwnerSay("request received" + body); llHTTPResponse(id, 200, "This is the response from SL."); } }}
  17. Before lookig at the scripts: Are you sure you can send out an http request from the port required?
  18. In that case, you will have do poll the state of the ava with a timer - there is no event that tells you, that an ava change inti a 'sitting state'
  19. I'm not too sure, what you really want - but tis simple example will tell you if the agent is sitting - on touch, that is default { touch_end(integer num_detected) { if (llGetAgentInfo(llGetOwner()) & AGENT_SITTING) { llSay(0, "Agent is sitting"); } }}
  20. Delete the textures from the end. Let's say you have the textures a, b and c in the inventory, on the first loop, it deletes a and i = 0, on the next round, it will try to delete the texture on index 1, which is c now - next is an error
  21. If you mean: Is there a way to detect if ab avatar sits (one always sits 'on' something), you can use llGetAgentInfo.
  22. in the list Flors, there is an " missing after 5 - that should fix it
  23. Try this it's untested, though list items;list clients = [];buildList() { items=[]; integer i; integer len=llGetInventoryNumber(INVENTORY_ALL); while(i<len) { if(llGetInventoryName(INVENTORY_ALL, i)!=llGetScriptName()) { items+=llGetInventoryName(INVENTORY_ALL, i); } ++i; }}default{ state_entry() { buildList(); } changed(integer change) { if(change & CHANGED_INVENTORY) { buildList(); } } touch_start(integer num) { integer i=0; while(i<=num) { if(llDetectedGroup(i)) { if(llListFindList(clients, [llDetectedKey(i)]) >= 0) { llSay(0, "Sorry, you already received your gift. Each Groupmember gets only one"); return; } else { llGiveInventoryList(llDetectedKey(i), llGetObjectName(), items); clients += llDetectedKey(i); } } else { llSay(0, "Only groupmembers get a gift"); } ++i; } }} I don't know how big your group is, but if it's pretty big, you should think about compressing the keys
  24. On first sight, I only see one thing that's really wrong: clients should be a global variable and you should add the id of the ava after giving out the items.
×
×
  • Create New...