llGetOwnerFunds() and on_error(void) !!!
|
Chance Small
Linden PITA
Join date: 30 Jul 2003
Posts: 170
|
01-12-2004 02:53
2 Script features I'd love to see.
1, being llGetOwnerFunds() function returning the integer value of the funds available by the object's owner. Why? So that I can have a bunch of money games in which a player is able to win money, and set them up so that if I am unable to cover the payout it'll just refund them and be out of service until the funds are available.
2, being on_error(void) event called when an error occurs in the script, wether it be a scripting error or a memory error. That way if I have a game that is unstable, if it errors, I can script it to refund the player(s), and they will not have to contact me, and wait until I arrive to handle it.
Any second oppinions? Lindens, whatta ya say?
|
Oz Spade
ReadsNoPostLongerThanHand
Join date: 23 Sep 2003
Posts: 2,708
|
01-12-2004 17:06
Sure, wouldn't mind seeing these, specialy the error one 
_____________________
"Don't anticipate outcome," the man said. "Await the unfolding of events. Remain in the moment." - Konrad
|
Christopher Omega
Oxymoron
Join date: 28 Mar 2003
Posts: 1,828
|
Re: llGetOwnerFunds() and on_error(void) !!!
01-12-2004 17:17
From: someone Originally posted by Chance Small 2, being on_error(void) event called when an error occurs in the script, wether it be a scripting error or a memory error. That way if I have a game that is unstable, if it errors, I can script it to refund the player(s), and they will not have to contact me, and wait until I arrive to handle it.
Any second oppinions? Lindens, whatta ya say? Please try to flip through the forums to see if things have been asked for already, having everyone's opinion coagulated in one thread will draw LL's attention more: See this thread.
|
Chance Small
Linden PITA
Join date: 30 Jul 2003
Posts: 170
|
01-12-2004 18:42
I saw my post about it being an event, different from your state suggestion. Would be nice to have an error event in each state in the script, but point taken.
Any comments on the llGetOwnerFunds() ?
|
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
|
01-12-2004 22:11
An event has been suggested, multiple times by myself alone not to mention other people.
However your implementation is incorrect. Do not do error(void). No no no. It is error(integer e) where e is a number to match a constant for the type of error.
_____________________
-- 010000010110110101100001001000000100111101101101011001010110011101100001 --
|
Carnildo Greenacre
Flight Engineer
Join date: 15 Nov 2003
Posts: 1,044
|
01-12-2004 23:42
How would you go about handling a stack-heap or other error occuring within the error() event?
_____________________
perl -le '$_ = 1; (1 x $_) !~ /^(11+)\1+$/ && print while $_++;'
|
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
|
01-13-2004 00:16
As you handle them now. Ideally what you get is a 'stack heap collision imminent' error, that says whoa, hey, I tried to do something and it would made me collide so instead here is the error event, wherin you send yourself and IM that x game at y pos in z sim is crashing due to e error.
Stack heaps aren't really a recoverable offense usually I think, but man it would be nice to know when it happens. Espeically if I can send some data out.
_____________________
-- 010000010110110101100001001000000100111101101101011001010110011101100001 --
|
Kex Godel
Master Slacker
Join date: 14 Nov 2003
Posts: 869
|
01-13-2004 11:04
I asked Cory about an error handler, and he seemed to indicate that when a run-time error happens, the script is too trashed to be able to continue running at all.
If that's so, then I don't foresee a run-time error handler being possible without some major rewriting of the LSL engine.
One thing I would like to see however to work around this problem is the ability for a script to reset another script. That would let us create what's known as a "watchdog" which can check to make sure a script is still running, and if not, reset it.
llResetScript() llGetScriptStatus()
Optimally, I'd also like to see some kind of method of persistent storage, so that crashes/resets aren't catastropic to scripts which may contain important information (ie credit in a gambling machine).
|
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
|
01-13-2004 11:42
From: someone I asked Cory about an error handler, and he seemed to indicate that when a run-time error happens, the script is too trashed to be able to continue running at all. If that's so, then I don't foresee a run-time error handler being possible without some major rewriting of the LSL engine. From: someone What we need then are some warning errors. When there is less than 500 bytes free, give an error. Actually if llGetfreeMemory worked I could do that myself more or less.
_____________________
-- 010000010110110101100001001000000100111101101101011001010110011101100001 --
|
Carnildo Greenacre
Flight Engineer
Join date: 15 Nov 2003
Posts: 1,044
|
01-13-2004 12:37
From: someone Originally posted by Kex Godel I asked Cory about an error handler, and he seemed to indicate that when a run-time error happens, the script is too trashed to be able to continue running at all. I can see that for stack-heap errors and bounds check errors, but not for math errors. If a divide-by-zero error occurs, it should be fairly simple to recover.
_____________________
perl -le '$_ = 1; (1 x $_) !~ /^(11+)\1+$/ && print while $_++;'
|
Hank Ramos
Lifetime Scripter
Join date: 15 Nov 2003
Posts: 2,328
|
01-14-2004 10:16
From: someone Originally posted by Kex Godel
One thing I would like to see however to work around this problem is the ability for a script to reset another script. That would let us create what's known as a "watchdog" which can check to make sure a script is still running, and if not, reset it.
llResetScript() llGetScriptStatus() Good News!  Version 1.2.6 Adds the following new functions which will make a "watchdog" timer script possible... From the Version 1.2.6 Release Notes... ============================ llResetOtherScript(string name) Resets script named "name" on an object. This allows one script to reset another. integer llGetScriptState(string name) Returns TRUE if script name is running. This allows one script to check on another. ============================
|
Kex Godel
Master Slacker
Join date: 14 Nov 2003
Posts: 869
|
01-14-2004 11:11
From: someone Originally posted by Hank Ramos Good News! Version 1.2.6 Adds the following new functions which will make a "watchdog" timer script possible...
Yay! I suggested this idea at the same meeting and Cory seemed to think it was a good idea... It's so exciting to see a suggestion implemented so quickly! =D
|