Jump to content

Mayazus Galicia

Resident
  • Posts

    9
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Breakthrough!!!!!!!!! I have it now. It totally makes sense to me now. Well I definitely appreciate the lesson, although I was frustrated but I definitely appreciate the way you helped me with this. I have a whole new appreciation for SL scripting now. Although it took me a lot of hints to get it, this is the first time I have done any scripting. I appreciate your help on this.
  2. Well i prefer that I don't have to go in and change the script everytime I have to give the pass to someone. So I like the script that already assumes the getunix time + whatever amount of seconds it would be for. Thank you for explaining the getunixtime. I still have a problem though: The reason I think I started messing with that piece of code is because even in your orginal sample, the object detaches after 10 seconds (||settimeevent). I guess I don't understand the point of the Expiry, if the first part of the code detaches after 10 sec. If I change where the 10 sec code is to something like 120.0, the object will just detach in 120.0 but the person can just reattach it for another 120.0sec anytime it detaches. If I change ||settimeevent to 0.0 it doesn't detatch. How I understart the ||settimeevent, is that this is for the script to check the expiry time. But I don't think it cares how long I set the expiry time to, because it just detaches after the ||settimeevent interval.
  3. *Hints* Can you find where the timer is set to check every 10.0 seconds? (YES, its the first piece of code)default{ attach(key ID){ if(NULL_KEY != ID){ llSetTimerEvent(10.0); } All calculations are in seconds. Two minutes is 120 seconds. Can you find where the expiry date/time is set to two minutes in the future?} listen(integer ChannelIn, string FromName, key FromID, string Message){ Expiry = llGetUnixTime() + 120; } You only have to change a single number. So what I tried was going to http://getunixtime.com/, to the getunixtime, and use the conversion app. And I put it into the code directly above ||Getunixtime() +120, but i put: } listen(integer ChannelIn, string FromName, key FromID, string Message){ Expiry = llGetUnixTime() + 1335592500; } The problem i have is that it still detaches no matter what on the 10sec code above. I've been trying to mess with it for two hours, i agree with you that the only way to learn is to try different things, but I'm totally stuck. Please help. At least give me some other clues.
  4. What codes would I manipluate for the following example: I want the pass valid for 60minutes, then I want it to detach and give the message the pass has expired. But my question is can the person just reattach it for another 60minutes? Or as the code stands, the intial is only for 60 minutes but the check time is 10 secs per say?
  5. PeterCanessa Oh wrote: To detach if no longer valid: a global variable to hold the expiry date-time, from http://wiki.secondlife.com/wiki/LlGetUnixTime an event-handler for http://wiki.secondlife.com/wiki/Attach in which you check whether the current date-time is greater than the expiry date-time if so then you need to auto-detach the object, which means asking for permission to do it http://wiki.secondlife.com/wiki/LlRequestPermissions then checking in http://wiki.secondlife.com/wiki/Run_time_permissions that you have permission and detaching http://wiki.secondlife.com/wiki/LlDetachFromAvatar Validating is then a matter of adding a number of seconds to the current time: http://wiki.secondlife.com/wiki/LlListen on some channel when you hear something http://wiki.secondlife.com/wiki/Listen check who said it and update the expiry date-time if they're authorised Although that stops something attaching after it has expired it does nothing to detach it when it expires, so http://wiki.secondlife.com/wiki/LlSetTimerEvent in attach() move all the checking that was in attach() to http://wiki.secondlife.com/wiki/Timer That way the object will detach once it has expired, won't stay re-attached and resetting it only makes it expired. The following example checks for expiry every 10s, giving a 2-minute validity whenever the person who created the object tells it to: integer Expiry;default{ attach(key ID){ if(NULL_KEY != ID){ llSetTimerEvent(10.0); } } listen(integer ChannelIn, string FromName, key FromID, string Message){ Expiry = llGetUnixTime() + 120; } run_time_permissions(integer Perms){ if(Perms & PERMISSION_ATTACH){ llDetachFromAvatar(); } } state_entry(){ llListen(275, "", llGetCreator(), "Validate"); } timer(){ if(llGetUnixTime() > Expiry){ llSetTimerEvent(0.0); llOwnerSay("This pass is no longer valid"); llRequestPermissions(llGetOwner(), PERMISSION_ATTACH); } }} Thank you so much for responding and all your help. So I tried this code and when I attach it to myself like expected it autuomatically deattaches and says "the pass is no longer valid," after 10seconds. The only problem that I see now is, that even though it detaches, it stays in the inventory and it allows the person to reattach it for another 10 secs. Let me know if I'm doing something wrong.
  6. PeterCanessa Oh wrote: I'd look at it from the point of view of how it's issued: "A pass" starts with an expiry-time in the past, so is worthless. If the owner resets it this is what they get, so no point resetting. Allow for validating a pass by anyone on a whitelist. EG; if someone on the whitelist says something on a particular channel, set the expiry-time to so long in the future (llGetUnixTime() + x). Object detaches itself automatically when now > expired. Using that method you don't care if passes are copied and transferred, worn, rezzed, reset or not. Even an expired pass can be (re)validated by rezzing it instead of wearing it. How do I set up a whitelist? How do I go about creating the code about this? Sorry I'm a noob for Scripting. How do i set the expiration up?
  7. Thank you everyone for responding. This is making sense to me. Bear with me, I'm an LSL noob. Innula Zenovka wrote: Just to clarify, you can't make it "self-destruct" while it's worn, and neither can you drop it by script. All you can do is make it detach itself when it expires, and refuse to reattach, or you could change its appearance to make it obvious it's no longer valid. Ela warns against resetting it -- you'll need to think of a way to stop the user doing precisely that, on purpose, to cheat by extending the pass's validity. Do you know the code for detaching and refusing to reattach after a certain time or specific date?
  8. So I role play a member a big bad gang in one of the Urban Noir Sims. Our gang wants to sell what esentially are like Hall Passes (we won't shoot and kill you) to the citizens of the city. The city has rp money that the gang needs and wants to use these "passes" as way of extortion (all for the fun of the rp). I've tried creating an object and putting a countdown clock but the problem is that it only counts down if the object is rezzed. I tried putting a self destruct timer, but again it only works if its rezzed, and if I attached it to my left eye ball, it doesn't self destruct. What I'm looking for is an easy way that we can give our "friends" these passes that expire, so they have to come back for more. If they self destruct is fine, since they won't be able to produce it, we would blast them. I was kind of hoping for a script that just says after a specified date, the object reads "time expired," or doesn't rezz. Please help thank you.
×
×
  • Create New...