Change font size
It is currently Sat Dec 15, 2018 2:43 pm

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: Script resetter
PostPosted: Tue Jul 07, 2009 9:03 am 
OSG Elite
User avatar

Joined: Fri Oct 17, 2008 11:30 am
Posts: 300
Location: Yorkshire, England
I knocked this little utility up yesterday because my ZHAO HUD kept freezing every time I logged in or crossed a border or sneezed or anything, requiring a reset. This does it for you - drop the script into any prim to reset all scripts in that prim (except itself) whenever anything big happens:
{L_CODE}:
Reset()
{
    integer N = llGetInventoryNumber(INVENTORY_SCRIPT) ;
    integer I = 0 ;
    string MyName = llGetScriptName() ;
    for ( ; I < N ; I++)
    {
        string Name = llGetInventoryName(INVENTORY_SCRIPT, I) ;
        if (Name != MyName)
        {
            llResetOtherScript(Name) ;
        }
    }
}
default
{
    on_rez(integer p)
    {
        Reset() ;
    }
    state_entry()
    {
        Reset() ;
    }
    attach(key ID)
    {
        Reset() ;
    }
    changed(integer Change)
    {
        if (Change & CHANGED_TELEPORT)
            Reset() ;
        if (Change & CHANGED_REGION)
            Reset() ;
    }
}

It seems to be a problem with OpenSim, not the ZHAO - other attachments also need at least some scripts resetting on login, border crossings, teleports, etc. If you don't have a problem like that, you don't need the script.

I'll try to get into the habit of sharing more code here.

_________________
John
UK resident; OSGrid & Second Life: "Barrington John"; code monkey in RL
OSGrid region server: P4/3.6GHz/2GB, Ubuntu Karmic/Mono 2.6/MySQL 14.14v5.1.37, home ADSL (~8.5Mbps/0.85Mbps), 8-14 regions, 2 users


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 1 post ]


Who is online

Users browsing this forum: legacy_google [bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net