|
Shifting Dreamscape
Always questioning ...
Join date: 12 Dec 2007
Posts: 266
|
05-29-2008 05:45
Looked through the wiki and could not find anything that covered this ...
So with the on_rez event a script knows when the prim it is in has been rezed from inventory, and the default state runs when a script starts ... but is there anyway for a script to detect and respond when either the prim is taken into inventory or the prim itself is deleted?
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
05-29-2008 07:26
No.
There are workarounds for some applications, such as having another object that regularly scans for the one that you want to know has gone away (now this is pretty easy using llGetObjectDetails()), but they are limited in scope (for example if your object could possibly move between sims it breaks this solution). Another is to have the object check in to a server every once in a while (e.g. using llHTTPRequest()), but the external server probably won't take local simulator time dilation into acount, so lag/resets could mess this one up. Etc.
|
|
Shifting Dreamscape
Always questioning ...
Join date: 12 Dec 2007
Posts: 266
|
05-29-2008 09:17
Darn ....
Was looking to set up a way that I could control the number of instances of a script by having it 'register' with a central server prim (via email) and the central server would keep the count of active instances .. letting a script know if it was 'illegal'.
I guess instead of doing it in events like on_rez and the no existant remove ... I could just have the scripts check in at a predetermined interval and then they could be counted and disabled as needed.
|
|
Johan Laurasia
Fully Rezzed
Join date: 31 Oct 2006
Posts: 1,394
|
05-29-2008 12:50
From: Shifting Dreamscape Darn ....
Was looking to set up a way that I could control the number of instances of a script by having it 'register' with a central server prim (via email) and the central server would keep the count of active instances .. letting a script know if it was 'illegal'.
I guess instead of doing it in events like on_rez and the no existant remove ... I could just have the scripts check in at a predetermined interval and then they could be counted and disabled as needed. Right, or what you can do is have each rezzed item register with the central server, and every so often poll the items and see who responds back, those who don't are (most likely) gone.
|
|
Moon Corrigible
Registered User
Join date: 19 Jan 2007
Posts: 75
|
state_exit
05-29-2008 13:05
Now I honestly dont know I'm just asking - wouldnt state_exit be a way around that?
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
05-29-2008 17:34
From: Moon Corrigible Now I honestly dont know I'm just asking - wouldnt state_exit be a way around that? No. The 'state_exit' handler is triggered only when a script changes state, which only happens when your code explicitly executes a 'state <otherState>;' statement. Deletion or taking into inventory leaves the script in its current state (but pauses execution on take until the object is rezzed again). It has nothing to do with state changes.
|
|
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
|
05-30-2008 02:32
email is by-directional you know.
What you do is have the object on_rez register itself. Then when the users quota is exhausted have the server email all of the registered objects, those that don't respond with an email in a timely fashion you remove from the servers list. If they are still over quota you can tell the user.
Personally I don't like limited use scripts.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river. - Cyril Connolly
Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence. - James Nachtwey
|