Jump to content

Lili Renilo

Resident
  • Posts

    19
  • Joined

  • Last visited

Everything posted by Lili Renilo

  1. Thank you both of you, I will play around with the timer... I haven't come across timers yet in my very early scripting learnings but it sounds like fun
  2. llSensorRepeat("", NULL_KEY, AGENT, 5, PI, 15); Hello, I am working with the above within a script and keep wondering the following. Is there a way to write a script so that the timing for the initial sensor repeat is 5 seconds but subsequent ones are a different period of time. So for example, object senses avatar and it says something in local after 5 seconds but then with an avatar still in range its subsequent repeats are 10 minutes? And that it would only reset to 5 seconds after there are no avatars in range. I haven't seen it in any of the scripts I have looked at so far... just curious if it is even possible... Thank you, Lili
  3. Oooh thank you so much! I excited to go and try it out
  4. Thank you for your replies. I should have copied the script in in the first place to make it easier. Maybe there is an unnecessary element in it then? Basically the script is within my creation which can be purchased. So then when the customer buys it and rezzes it, it used to ask to grant pay permissions... I'm not sure why, maybe it was so that the permissions went over to them and not me? list thanks = [" *REMOVED ALL MY WORDING AS IT WAS LENGTHY* "]; float num_sayings; string floattext = "Donation Box"; ///////// BEGIN SCRIPT ////////////////// integer totaldonated; default { on_rez( integer sparam ) { llResetScript(); } state_entry() { llSetText("Waiting for Owner\nto Grant Pay Perms",<1,1,1>,1); llRequestPermissions(llGetOwner(),PERMISSION_DEBIT); num_sayings = llGetListLength(thanks); } touch_start(integer total_number) { } run_time_permissions(integer perm) { if(perm & PERMISSION_DEBIT) state ready; } } state ready { on_rez( integer sparam ) { llResetScript(); } state_entry() { llSetPayPrice(PAY_DEFAULT, [25, 50, 100, 500]); llSetText(floattext + "\nL$0 Donated so far",<1,1,1>,1); } money(key id, integer amount) { totaldonated = totaldonated + amount; llSetText(floattext + "\nL$" + (string)totaldonated + " Donated so far",<1,1,1>,1); integer saying2say = llFloor(llFrand(num_sayings)); llSay(0, llList2String(thanks,saying2say)); } }
  5. Hello I modified a script for a product a while back to enable people to click donate to an object and it would give back a phrase to them. I haven't had any problems with it until now. A customer has got back to me with the problem that she does not receive the yellow notice that asks her to grant the request to take payment. It maintains the hover text 'waiting for owner to grant permissions' over it. She uses Viewer 3, and I am not familir with that viewer and whether that might cause any issues. I am totally stumped on why it doesn't give her this request so that she can use it. Any ideas? Thank you in advance!
  6. Oh and to add, much as it would be a bonus to not have a repeated joke to a specified avatar, at this stage I am not so worried if they hear the same randomly selected joke.
  7. Thank you Rolig. I think I must have been typing my post as you posted your's. I hadn't seen it. I think I need to stop and think this all through now. So many possibilities and I now need to work out which direction to take. I like your idea and I agree the jokes need to be said out to the crowd, else it loses its punch.
  8. Wow I learn so much in every post written back to me, it's so vast and incredible. I didn't realise that the possibility even existed to speak directly to an avatar without it being via IM. I hadn't even considered some of the options presented to me like expiring visitor lists. It might seem an OTT statement but I really feel like I am awakening a whole different area of my brain LOL. I have never thought this way round about anything. AND much as it is making me cringe right now after all the input and guidance everyone has given me on that particular script... my re-focusing on my purpose has made me look at this in a totally new light and now I think I need to start back from scratch on this script. The way I am seeing it right now, is that for this purpose maybe I don't need to use an avatar sensor as a fire for the jokes. Maybe I should be looking in a different direction. I am thinking that the jokes should perhaps come at their own time intervals. Perhaps with a collision or sensor on/off function so that it isn't saying them when noone is within chat range. 1) Collision/Sensor avatar in 5m range = on 2) Say joke in local chat and then after every Xmins (havent yet decided what amount would be non-irritating) 3) No avatars detected = off Need to think this through a little more. Thanks to everyone for helping me on this path... and please don't hate me for my sudden u turn
  9. Ok... lots of ways and ideas to take in. I think at this point I need to refocus on my original intention for this script and clarify it on the forum. Although I have been working on a greeter based script, my purpose isn't exactly to use it as a traditional greeter. The whole reason I got into scripting is because of a recent creation in Secondlife. I wanted an object to be able to 'make jokes' or 'witty comments' as an avatar passed by. This could be used in the context of a store front for a bit of fun for the customers, or within a roleplay sim, or at a party. So... I am partly doing this now to get my head straight: 1) Senses avatars in close range, ever 5 seconds because I don't want it to miss the entry of someone. 2) Have they heard a joke in last 6 hours? 3) Crack a joke in local chat so that anyone around can also hear. 4) Don't repeat to listed avatars for 6 hours. Keep scanning ever 5 seconds. I keep coming up with new requirements as I tinker with the scripts. -I want it to check for avatars every 5 seconds but I don't want it firing jokes any more than every 1-2 mins because if someone was still standing there as others arrived they would get bombarded. So even though it is sensing, how do you control how often it fires out the randomsay? -If five avatars are standing there, it makes sense they should all hear the same joke rather than 5 jokes all at once. I'm getting lost somewhere between my purpose and the endless scripting options. Maybe this is where I should take on board the idea suggested where it speaks directly to one avatar (regionsayto)? What are people's thoughts?
  10. It is very confusing and more often than not I attempt to read it all, then go into panic mode and have to return when I have taken a few thousand deep breaths. LOL However! When I do return I try to pick apart what the forum is teaching me, some of it I have to accept that I don't understand at this stage. That which I can make sense of, I just throw questions back into the forum about. This is such an amazing learning curve for me though. A month ago I would never have thought I would be attempting to do anything to a script other than make the regular little adaptations that most people do. I'm both terrified by it and exhilerated at the same time. If I can achieve anything in this area, it will be so liberating as I can begin to use it alongside my building skills but even more so I will be beginning to learn a new skill in secondlife. So... for now I am in panic mode but I will read through all the posts again shortly and no doubt ask more about them Thanks, Lili
  11. I've been trying to adapt this script to suit my requirement. I added in the random say element and attempted to change the collision to a sensor but I have an error now on line 12 or thereabouts, where there is a bracket. The other thing I don't understand when I read this script is... I can see it is a 24 hour memory of if a person has visited but I don't understand the 12 hour part on the set timer event and lower down on the timer. I'd be grateful for any feedback people can give me I already feel very lucky to have found this community, thanks in advance...... list greetings = ["Hi", "Hello", "Greetings", "Welcome"]; list gVisitors; // Save Visitor UUIDs list gVtime; // Save visit times default { state_entry() { llSetTimerEvent(43200.0); // Start a 12-hour garbage collector } { llSensorRepeat("", NULL_KEY, AGENT, 5, PI, 5); } sensor(integer total_number) { integer temp = llListFindList(gVisitors,[llDetectedKey(0)]); if(~temp) //Has the Av visited before? { //Subtract saved Unix time from current Unix time. Was it it > 86400 (1 day) ago? if((llGetUnixTime() - llList2Integer(gVtime,temp)) > 86400) { // If yes ..... gVisitors = llDeleteSubList(gVisitors,temp,temp); //Remove Av from visitor list gVtime = llDeleteSubList(gVtime,temp,temp); // Remove Av's visit time too integer saying2say = (integer) llFrand( (greetings !=[]) ); llSay(0, llList2String(greetings,saying2say)); } } else //No previous visit { gVisitors += [llDetectedKey(0)]; // Add to the Visitor list gVtime += [llGetUnixTime()]; // Add current Unix time to the time list integer saying2say = (integer) llFrand( (greetings !=[]) ); llSay(0, llList2String(greetings,saying2say)); } } timer() //Every 12 hours ... { integer i; //(gVisitors !=[]) is the same thing as llGetListLength(gVisitors) for (i=((gVisitors !=[])-1);i>=0;--i) //Look through all the saved visitor times { // For each one ... if((llGetUnixTime() - llList2Integer(gVtime,i))> 86400) // If it was more than a day ago ... { gVisitors = llDeleteSubList(gVisitors,i,i); // Remove the person from the Visitor list gVtime = llDeleteSubList(gVtime,i,i); //Remove the visit time from the list } } } }
  12. K. I plucked up the courage to work on this script again. Is anyone about to tell me if I am on the right track?
  13. Ok. I will try and break it down into chunks. Thank you both for trying to help me. (Just for clarification, I didn't mean in any way to suggest Peter's explanation and reply was not adequate, as I said it's my newness to this that makes it difficult). I'll try to see what I can do
  14. Oh my goodness! Thanks so much for your reply. I am very new to scripting, just beginning to explore really so maybe I am getting in over my head... cos I really don't understand. Scary stuff! lol
  15. Ok, having spent a little time playing around with this script I feel I understand it better now. I can see how it works and now see where I need to adapt it for its purpose better. It does an avatar sensor every 60secs currently and then gathers a memory of avatars not to repeat to. Is it possible to retain the random greet element and the sensor but also add onto it the ability to not repeat within a certain time frame to an individual avatar so like this: Scans for avatars every 60secs Greets Avatar X with random phrase, then won't repeat to this specific avatar for say 3 hours. But will continue to scan for new avatars, greet them and then recall their name not to be repeated to for said time. I'm not sure if it is possible but I am aware how annoying greeters can be if they are not set up well
  16. Ok just tried... it keeps saying hi rather than going through them randomly. How/where do I insert the random script section that you suggested? Thanks
  17. Thank you both so much for your replies! The problem I was having with it was that when I tried to save the script each time, it was squeaking at me and telling me something was wrong in the writing. So I shall give the suggested script a go! And reply back here how I get along... Thank you thank you thank you !
  18. Hi. I am very new to scripting but I am trying my hardest to learn and develop a script. I need a script that will sense people within a specified range, i.e. 5m, and then greet them with a random sentence generated from a list, that would be included in the script. I don't want the person that it greets to be bombarded with multiple greetings, so I was trying to incorporate an avatar list of specified number for the script to remember and not repeat, for example last 25 avatars. This is how far I have got so far, can anybody help me progress? Thank you so much in advance to anyone who comes to my rescue! :) ____________ list greetings = ["Hi", "Hello", "Greetings", "Welcome"]; list recent_avatars; add_avatar(string name) { if(!seen(name)) { recent_avatars += name; if (llGetListLength(recent_avatars) > 25) { recent_avatars = llDeleteSubList(recent_avatars,0,0); } } } integer seen(string name) { if(llListFindList(recent_avatars,[name]) > -1) { return TRUE; } return FALSE; } default { state_entry() { llSensorRepeat("", NULL_KEY, AGENT, 5, PI, 5); } sensor(integer total_number) { if(!seen(llDetectedName(0))) { // speak out loud! llSay(0, llList2String(greetings,saying2say)); add_avatar(llDetectedName(0)); } } }
×
×
  • Create New...