<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://opensimulator.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://opensimulator.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nihlaeth</id>
		<title>OpenSimulator - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://opensimulator.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nihlaeth"/>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/Special:Contributions/Nihlaeth"/>
		<updated>2026-05-11T09:53:18Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.19.9</generator>

	<entry>
		<id>http://opensimulator.org/wiki/NPC_Automator_2.0</id>
		<title>NPC Automator 2.0</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/NPC_Automator_2.0"/>
				<updated>2013-02-01T01:36:26Z</updated>
		
		<summary type="html">&lt;p&gt;Nihlaeth: Created page with &amp;quot;==Instruction Notecard== For this script to work, ossl must be enabled with a threat level of VeryHigh.  NPCAutomator uses it's own kind of very simple script. All the commands a...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Instruction Notecard==&lt;br /&gt;
For this script to work, ossl must be enabled with a threat level of VeryHigh.&lt;br /&gt;
&lt;br /&gt;
NPCAutomator uses it's own kind of very simple script. All the commands are in the form of: &lt;br /&gt;
&lt;br /&gt;
===Rules===&lt;br /&gt;
*Command|optionalvalue|optionalvalue|&lt;br /&gt;
*Empty fields are maked by a &amp;quot;#&amp;quot; sign.&lt;br /&gt;
*Commands are not case sensitive.&lt;br /&gt;
*Spaces do matter! Do not use whitespace in commands or values that are not mean as text.&lt;br /&gt;
&lt;br /&gt;
===Commands===&lt;br /&gt;
*NpcCreate|Test Npc|&amp;lt;1,1,1&amp;gt;| This creates an npc named Test NPC at 1,1,1 (relative to object position).&lt;br /&gt;
*Wait|5|#| This makes the script sleep for 5 seconds. Build in waits at regular intervals to prevent flooding and make the npc come over more natural.&lt;br /&gt;
*GotoLine|4|#| This makes the script continue at the specified line number. The first line is 0. You can also replace the number with a label name.&lt;br /&gt;
*NpcFlyTo|&amp;lt;128,128,128&amp;gt;|#| This makes your npc fly to these coordinates (these are region coords).&lt;br /&gt;
*NpcMoveTo|&amp;lt;128,128,22&amp;gt;|#| Same as NpcFlyTo, but walking.&lt;br /&gt;
*NpcSetRot|Random|#|  Sets a timer that changes npc rotation to random angles at a set interval.&lt;br /&gt;
*NpcPlayAnimation|animationname|#| Plays an animation (has to be present in prim inventory).&lt;br /&gt;
*NpcStopAnimation|animationname|#| Stops the animation.&lt;br /&gt;
*NpcSay|Hey! I'm an npc :)|#| Makes the npc say stuff.&lt;br /&gt;
*NpcSit|objectkey|#| Makes the npc sit on object.&lt;br /&gt;
*NpcDelete|#|#| Remove the NPC.&lt;br /&gt;
*GreetStrangerFirst|Hey, |#| Message that is said before avatar name when meeting someone new.&lt;br /&gt;
*GreetStrangerLast|. Nice meeting you.|#| Message that is said after the avatar name when meeting someone new.&lt;br /&gt;
*GreetAquaintanceFirst|Hey, |#| Message that is said before avatar name when running into an aquaintance.&lt;br /&gt;
*GreetAquaintanceLast|. Good to see you again!|#| Message that is said after avatar name when running into an aquaintance.&lt;br /&gt;
*AddTrigger|Help|15| A trigger is a word that triggers a reaction in the npc. In this case, when someone says the word help, the code jumps to line 14. Instead of a line number you can also specify a label name.&lt;br /&gt;
*RemoveTrigger|Help|#| Removes a trigger word.&lt;br /&gt;
*GotoTrigger|#|#| This command makes the code check if a trigger word has been said and then jumps to the right line. The code waits for this command to make sure it doesn't skip lines that are important. So don't forget to include this.&lt;br /&gt;
*Label|Labelnaam|#| A label is a fixed point in the notecard that you can refer to so you don't have to keep counting lines.&lt;br /&gt;
&lt;br /&gt;
===Example===&lt;br /&gt;
The notecard HAS to be named &amp;quot;-NPC AI&amp;quot;. It's case sensitive.&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;NpcCreate|Test NPC|&amp;lt;1, 1,1&amp;gt;|#|&lt;br /&gt;
GreetAquaintanceFirst|You again! What are you doing here, |#|&lt;br /&gt;
GreetAquaintanceLast|?|#|&lt;br /&gt;
AddTrigger|help|help|&lt;br /&gt;
GOTOLINE|loop|#|&lt;br /&gt;
Label|help|#|&lt;br /&gt;
NpcSay|Do you want me te help you?|#|&lt;br /&gt;
AddTrigger|yes|yes|&lt;br /&gt;
GOTOLINE|loop|#|&lt;br /&gt;
Label|yes|#|&lt;br /&gt;
NpcSay|Sorry, I don't think I'm the right person for the job.|#|&lt;br /&gt;
RemoveTrigger|yes|#|&lt;br /&gt;
GOTOLINE|loop|#|&lt;br /&gt;
Label|loop|&lt;br /&gt;
WAIT|1|#|&lt;br /&gt;
GOTOTrigger|#|#|&lt;br /&gt;
NpcMoveTo|&amp;lt;112,112,22&amp;gt;|#|&lt;br /&gt;
GOTOTrigger|#|#|&lt;br /&gt;
WAIT|3|#|&lt;br /&gt;
GOTOTrigger|#|#|&lt;br /&gt;
NpcMoveTo|&amp;lt;109,112,22&amp;gt;|#|&lt;br /&gt;
GOTOTrigger|#|#|&lt;br /&gt;
GOTOLINE|loop|#|&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Planned===&lt;br /&gt;
*NpcStandUp&lt;br /&gt;
*NpcLookAt&lt;br /&gt;
*NpcAttach&lt;br /&gt;
*SaveAppearance&lt;br /&gt;
*Revising way notecards are accessed, dataserver event has to go.&lt;br /&gt;
&lt;br /&gt;
==Commands==&lt;br /&gt;
You can issue commands to the script directly too. I did however not revise this functionality and can't say if it works or not. For instructions, you'll have to read the script.&lt;br /&gt;
&lt;br /&gt;
==NPC Automator 2.0 script==&lt;br /&gt;
You don't need to change a thing about this script. Just put it in a prim together with the instruction notecard and maybe an appearance notecard and you're done.&lt;br /&gt;
&amp;lt;source lang = &amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
debug(string str)&lt;br /&gt;
{&lt;br /&gt;
    if(debugger)&lt;br /&gt;
    { &lt;br /&gt;
        llOwnerSay(str);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
list tempdata;&lt;br /&gt;
vector offset = &amp;lt;0,0,0&amp;gt;;&lt;br /&gt;
integer rezcount= 0;&lt;br /&gt;
integer debugger= FALSE;&lt;br /&gt;
integer rand= FALSE;&lt;br /&gt;
key npc = NULL_KEY;&lt;br /&gt;
string npcfirstname ;&lt;br /&gt;
string npclastname;&lt;br /&gt;
vector npcrezpos = &amp;lt;202,119,25&amp;gt;;&lt;br /&gt;
string detectname = &amp;quot;NPC Name&amp;quot;;&lt;br /&gt;
integer channel = 77;&lt;br /&gt;
integer line;&lt;br /&gt;
float delay = 1;&lt;br /&gt;
string config = &amp;quot;-NPC AI&amp;quot;;&lt;br /&gt;
key readLineId;&lt;br /&gt;
string NpcCommand;&lt;br /&gt;
string NpcValue;&lt;br /&gt;
string command;&lt;br /&gt;
string value =&amp;quot;value&amp;quot;;&lt;br /&gt;
string extra=&amp;quot;extra&amp;quot;;&lt;br /&gt;
string aq;&lt;br /&gt;
list greet;&lt;br /&gt;
list aqaintance;&lt;br /&gt;
string hiufirst=&amp;quot;Hello, &amp;quot;;&lt;br /&gt;
string hiulast=&amp;quot;. Nice to meet you!&amp;quot;;&lt;br /&gt;
string hikfirst=&amp;quot;Good to see you again, &amp;quot;;&lt;br /&gt;
string hiklast=&amp;quot;.&amp;quot;;&lt;br /&gt;
list triggers;&lt;br /&gt;
list goto;&lt;br /&gt;
list gotoqueue;&lt;br /&gt;
list labels;&lt;br /&gt;
list labelpos;&lt;br /&gt;
&lt;br /&gt;
ResetScript()&lt;br /&gt;
{&lt;br /&gt;
    //llResetScript()&lt;br /&gt;
    tempdata =[];&lt;br /&gt;
    npcfirstname = &amp;quot;&amp;quot;;&lt;br /&gt;
    npclastname = &amp;quot;&amp;quot;;&lt;br /&gt;
    rezcount=0;&lt;br /&gt;
    npc = &amp;quot;&amp;quot;;&lt;br /&gt;
    line = 0;&lt;br /&gt;
    triggers=[];&lt;br /&gt;
    goto=[];&lt;br /&gt;
    gotoqueue=[];&lt;br /&gt;
    greet=[];&lt;br /&gt;
    labels=[];&lt;br /&gt;
    labelpos=[];&lt;br /&gt;
    init();&lt;br /&gt;
    state default;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
integer get_aqaintance(string name)&lt;br /&gt;
{&lt;br /&gt;
    if(llListFindList(aqaintance,[name])&amp;lt;0){return 0;}&lt;br /&gt;
    else{return 1;}    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
set_aqaintance(string name)&lt;br /&gt;
{&lt;br /&gt;
        string aq=osGetNotecard(&amp;quot;Aqaintances&amp;quot;);&lt;br /&gt;
        aq+=&amp;quot;,&amp;quot;+name;&lt;br /&gt;
        aqaintance=llCSV2List(aq);&lt;br /&gt;
        llRemoveInventory(&amp;quot;Aqaintances&amp;quot;);&lt;br /&gt;
        osMakeNotecard(&amp;quot;Aqaintances&amp;quot;,[aq]);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
init_labels()&lt;br /&gt;
{&lt;br /&gt;
    debug(&amp;quot;Starting label initialization&amp;quot;);&lt;br /&gt;
    integer i=0;&lt;br /&gt;
    string templine;&lt;br /&gt;
    while (templine != EOF) {&lt;br /&gt;
        templine=osGetNotecardLine(config,i);&lt;br /&gt;
        debug(&amp;quot;Reading line: &amp;quot; + templine);&lt;br /&gt;
        list templist = llParseString2List(templine,[&amp;quot;|&amp;quot;],[]);&lt;br /&gt;
        string tempcommand = llToLower(llList2String(templist,0));&lt;br /&gt;
        string tempvalue = llList2String(templist,1);&lt;br /&gt;
        if(tempcommand==&amp;quot;label&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            labels=labels + [(string)tempvalue];&lt;br /&gt;
            labelpos=labelpos + [(integer)i];&lt;br /&gt;
            debug(&amp;quot;Added label &amp;quot; + tempvalue + &amp;quot; to labels.&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
        i++;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer label2line(string lblname)&lt;br /&gt;
{&lt;br /&gt;
    integer tmppos=llListFindList(labels, llToLower(lblname));&lt;br /&gt;
    if(tmppos&amp;lt;0)&lt;br /&gt;
    {&lt;br /&gt;
        debug(&amp;quot;label &amp;quot; + lblname + &amp;quot;not found, return to line 0&amp;quot;);&lt;br /&gt;
        return 0;&lt;br /&gt;
    }&lt;br /&gt;
    else{&lt;br /&gt;
        return llList2Integer(labelpos, tmppos);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer IsInteger(string var)&lt;br /&gt;
{&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0;i&amp;lt;llStringLength(var);++i)&lt;br /&gt;
    {&lt;br /&gt;
        if(!~llListFindList([&amp;quot;1&amp;quot;,&amp;quot;2&amp;quot;,&amp;quot;3&amp;quot;,&amp;quot;4&amp;quot;,&amp;quot;5&amp;quot;,&amp;quot;6&amp;quot;,&amp;quot;7&amp;quot;,&amp;quot;8&amp;quot;,&amp;quot;9&amp;quot;,&amp;quot;0&amp;quot;],[llGetSubString(var,i,i)]))&lt;br /&gt;
        {&lt;br /&gt;
            return FALSE;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    return TRUE;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
init()&lt;br /&gt;
{&lt;br /&gt;
    init_labels();&lt;br /&gt;
    //read aquaintances notecard&lt;br /&gt;
    aq=osGetNotecard(&amp;quot;Aqaintances&amp;quot;);&lt;br /&gt;
    aqaintance=llCSV2List(aq);&lt;br /&gt;
    llSensorRepeat(&amp;quot;&amp;quot;,NULL_KEY,AGENT,30.0,PI,15);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    // reset configuration values to default&lt;br /&gt;
    NpcCommand = &amp;quot;Unknown&amp;quot;;&lt;br /&gt;
    NpcValue = &amp;quot;None&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    // make sure the file exists and is a notecard&lt;br /&gt;
    if(llGetInventoryType(config) != INVENTORY_NOTECARD)&lt;br /&gt;
    {&lt;br /&gt;
        // notify owner of missing file&lt;br /&gt;
        debug(&amp;quot;Missing inventory notecard: &amp;quot; + config);&lt;br /&gt;
        return; // don't do anything else&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // initialize to start reading from first line&lt;br /&gt;
    line = 0;&lt;br /&gt;
&lt;br /&gt;
    // read the first line&lt;br /&gt;
    readLineId = llGetNotecardLine(config, line++);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
processConfiguration(string data)&lt;br /&gt;
{&lt;br /&gt;
    // if we are at the end of the file&lt;br /&gt;
    if(data == EOF)&lt;br /&gt;
    {&lt;br /&gt;
        // notify the owner&lt;br /&gt;
        debug(&amp;quot;We are done reading the configuration&amp;quot;);&lt;br /&gt;
        // reset&lt;br /&gt;
        line=0;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // if we are not working with a blank line&lt;br /&gt;
    if(data != &amp;quot;&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        // if the line does not begin with a comment&lt;br /&gt;
        if(llSubStringIndex(data, &amp;quot;#&amp;quot;) != 0)&lt;br /&gt;
        {&lt;br /&gt;
            // find first pipe &amp;quot;|&amp;quot; and smoke it&lt;br /&gt;
            integer i = llSubStringIndex(data, &amp;quot;|&amp;quot;);&lt;br /&gt;
            &lt;br /&gt;
            // if line contains equal sign&lt;br /&gt;
            if(i != -1)&lt;br /&gt;
            {&lt;br /&gt;
                tempdata = llParseString2List(data,[&amp;quot;|&amp;quot;],[]);&lt;br /&gt;
                command = llToLower(llList2String(tempdata,0));&lt;br /&gt;
                value = llList2String(tempdata,1);&lt;br /&gt;
                extra = llDumpList2String(llList2List(tempdata,2,-1),&amp;quot; &amp;quot;);&lt;br /&gt;
                &lt;br /&gt;
                debug( &amp;quot; Command &amp;quot; +command + &amp;quot; Value &amp;quot; + value + &amp;quot; Extra &amp;quot; +extra);&lt;br /&gt;
                if(command == &amp;quot;npccreate&amp;quot; &amp;amp;&amp;amp; value !=&amp;quot;&amp;quot; )&lt;br /&gt;
                {&lt;br /&gt;
                    //NpcCommand = value;&lt;br /&gt;
                    list tempname = llParseString2List(value,[&amp;quot; &amp;quot;],[]);&lt;br /&gt;
                    string fname = llList2String(tempname,0);&lt;br /&gt;
                    string lname = llList2String(tempname,1);&lt;br /&gt;
                    npcfirstname = (string)fname;&lt;br /&gt;
                    npclastname = (string)lname;&lt;br /&gt;
                    offset = (vector)extra;&lt;br /&gt;
                    if (CardExists(npcfirstname + &amp;quot;_&amp;quot; + npclastname))&lt;br /&gt;
                    {&lt;br /&gt;
                        debug(&amp;quot;A saved appearance for &amp;quot; + npcfirstname + &amp;quot; &amp;quot; + npclastname + &amp;quot; was found.&amp;quot;);&lt;br /&gt;
                        npc = osNpcCreate(npcfirstname, npclastname, llGetPos()+offset, npcfirstname + &amp;quot;_&amp;quot; + npclastname);&lt;br /&gt;
                        lognpc(npc);&lt;br /&gt;
                        debug(&amp;quot;Created NPC &amp;quot; + (string)npc + &amp;quot; with the name &amp;quot; + npcfirstname + &amp;quot; &amp;quot; + npclastname + &amp;quot;.&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
                    }&lt;br /&gt;
                    else{&lt;br /&gt;
                        debug(&amp;quot;No appearance for &amp;quot; + npcfirstname + &amp;quot; &amp;quot; + npclastname + &amp;quot; found. Copying your appearance.&amp;quot;);&lt;br /&gt;
                        osOwnerSaveAppearance(npcfirstname + &amp;quot;_&amp;quot; + npclastname);&lt;br /&gt;
                        npc = osNpcCreate(npcfirstname, npclastname, llGetPos()+offset, npcfirstname + &amp;quot;_&amp;quot; + npclastname);&lt;br /&gt;
                        lognpc(npc);&lt;br /&gt;
                        debug(&amp;quot;Created NPC &amp;quot; + (string)npc + &amp;quot; with the name &amp;quot; + npcfirstname + &amp;quot; &amp;quot; + npclastname + &amp;quot;.&amp;quot; +(string)npcrezpos);&lt;br /&gt;
                        debug( &amp;quot;Created &amp;quot; + npcfirstname + &amp;quot;_&amp;quot; + npclastname + &amp;quot; @ &amp;quot; +extra);&lt;br /&gt;
                        // color&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;wait&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    llSetTimerEvent((float)value);&lt;br /&gt;
                    debug( &amp;quot;wait &amp;quot; + value);&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;gotoline&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    if(IsInteger(value))&lt;br /&gt;
                    {&lt;br /&gt;
                        line = (integer)value;&lt;br /&gt;
                    }&lt;br /&gt;
                    else{&lt;br /&gt;
                        line = label2line(value);&lt;br /&gt;
                    }&lt;br /&gt;
                    debug( &amp;quot;go to line &amp;quot; + value);&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;npcflyto&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    osNpcMoveToTarget(npc, (vector)value, OS_NPC_FLY);&lt;br /&gt;
                    debug( &amp;quot;move to &amp;quot; + value);&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;npcmoveto&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    osNpcMoveToTarget(npc, (vector)value, OS_NPC_NO_FLY);&lt;br /&gt;
                    debug( &amp;quot;move to &amp;quot; + value + &amp;quot; &amp;quot; +extra);&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;npcsetrot&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    if(value == llToLower(&amp;quot;set&amp;quot;))&lt;br /&gt;
                    {&lt;br /&gt;
                        rand = FALSE;&lt;br /&gt;
                        debug( &amp;quot;No Rotaion Timer&amp;quot;);&lt;br /&gt;
                    }&lt;br /&gt;
                    else if(value == llToLower(&amp;quot;random&amp;quot;))&lt;br /&gt;
                    {&lt;br /&gt;
                        rand = TRUE;&lt;br /&gt;
                        debug( &amp;quot;Random rotation set every timer&amp;quot;);&lt;br /&gt;
                    } &lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;npcplayanimation&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    osNpcPlayAnimation(npc, value);&lt;br /&gt;
                    debug( &amp;quot;animate &amp;quot; + value);&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;npcstopanimation&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    osNpcStopAnimation(npc, value);&lt;br /&gt;
                    debug( &amp;quot;stop animate &amp;quot; + value);&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;npcsay&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    osNpcSay(npc, value);&lt;br /&gt;
                    //debug( &amp;quot;stop animate &amp;quot; + value);&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;wait&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    delay = (float)value;&lt;br /&gt;
                    debug( &amp;quot; setimer &amp;quot; + value);&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;npcsit&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    osNpcSit(npc,(key)value,1);&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;npcdelete&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    NpcDelete();&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;greetstrangerfirst&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    hiufirst=value;&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;greetstrangerlast&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    hiulast=value;&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;greetaquaintancefirst&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    hikfirst=value;&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;greetaquaintancelast&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    hiklast=value;&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;addtrigger&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    integer tmpline;&lt;br /&gt;
                    triggers=triggers + [llToLower(value)];&lt;br /&gt;
                    if(IsInteger(extra))&lt;br /&gt;
                    {&lt;br /&gt;
                        tmpline = (integer)extra;&lt;br /&gt;
                    }&lt;br /&gt;
                    else{&lt;br /&gt;
                        tmpline = label2line(extra);&lt;br /&gt;
                    }&lt;br /&gt;
                    goto=goto + [(integer)tmpline];&lt;br /&gt;
                    debug(&amp;quot;Added trigger \&amp;quot;&amp;quot; + value + &amp;quot; with goto value of &amp;quot; + extra + &amp;quot;.&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;removetrigger&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    integer pos=llListFindList(triggers,llToLower(value));&lt;br /&gt;
                    if(pos&amp;lt;0){debug(&amp;quot;Trigger not found&amp;quot;);}&lt;br /&gt;
                    else{&lt;br /&gt;
                        triggers=llDeleteSubList(triggers,pos,pos);&lt;br /&gt;
                        goto=llDeleteSubList(goto,pos,pos);&lt;br /&gt;
                        debug(&amp;quot;Deleted trigger with value \&amp;quot;&amp;quot; + value);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;gototrigger&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    integer length=llGetListLength(gotoqueue);&lt;br /&gt;
                    if(length&amp;gt;0)&lt;br /&gt;
                    {&lt;br /&gt;
                        integer goto=llList2Integer(gotoqueue, 0);&lt;br /&gt;
                        line = goto;&lt;br /&gt;
                        gotoqueue=llDeleteSubList(gotoqueue,0,0);&lt;br /&gt;
                        debug( &amp;quot;loops back to line &amp;quot; + goto);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
                else if(command == &amp;quot;label&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    debug(&amp;quot;Now at label &amp;quot; + value);&lt;br /&gt;
                }&lt;br /&gt;
                // unknown name osNpcSit(npc,&amp;quot;bca94960-4fd9-4512-85e1-fd7faf130aba&amp;quot;,1);&lt;br /&gt;
                else{&lt;br /&gt;
                    //debug(&amp;quot;Unknown configuration value: &amp;quot; + name + &amp;quot; on line &amp;quot; + (string)line);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            else // line does not contain equal sign&lt;br /&gt;
            {&lt;br /&gt;
                debug(&amp;quot;Configuration could not be read on line &amp;quot; + (string)line);&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    // read the next line&lt;br /&gt;
    // readLineId = llGetNotecardLine(config, line++);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Enter multiple NPCs into a list just incase of name change, Send linked message to other script(s) if needed&lt;br /&gt;
lognpc(key npcl)&lt;br /&gt;
{&lt;br /&gt;
    llSetObjectDesc(npc);&lt;br /&gt;
    dead = FALSE;&lt;br /&gt;
    integer i;&lt;br /&gt;
    for (i=0;i&amp;lt;rezcount;i++)&lt;br /&gt;
    {&lt;br /&gt;
        npc = osNpcCreate(npcfirstname, npclastname + &amp;quot; &amp;quot; + (string)i, llGetPos()+offset, npcfirstname + &amp;quot;_&amp;quot; + npclastname);&lt;br /&gt;
        llMessageLinked(LINK_THIS,-5,&amp;quot;npcid&amp;quot;,npc);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer CardExists(string cardname)&lt;br /&gt;
{&lt;br /&gt;
    if (llGetInventoryType(cardname) == INVENTORY_NONE)&lt;br /&gt;
    {&lt;br /&gt;
        return FALSE;&lt;br /&gt;
    }&lt;br /&gt;
    else{&lt;br /&gt;
        return TRUE;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NpcCreate(list cmdline, integer cmdlength)&lt;br /&gt;
{&lt;br /&gt;
    // Create a new NPC. Use an existing appearance if a&lt;br /&gt;
    // notecard matching the given name exists, otherwise&lt;br /&gt;
    // use the creator's appearance.&lt;br /&gt;
    if (npc != NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        debug(llGetObjectName() + &amp;quot; thinks you still have an active NPC. Either delete that NPC, use the clearid command, or reset the scripts in &amp;quot; + llGetObjectName() + &amp;quot;.&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    if (cmdlength != 3)&lt;br /&gt;
    {&lt;br /&gt;
        debug(&amp;quot;Command usage: create &amp;lt;firstname&amp;gt; &amp;lt;lastName&amp;gt;&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    npcfirstname = llList2String(cmdline, 1);&lt;br /&gt;
    npclastname = llList2String(cmdline, 2);&lt;br /&gt;
    if (CardExists(npcfirstname + &amp;quot;_&amp;quot; + npclastname))&lt;br /&gt;
    {&lt;br /&gt;
        debug(&amp;quot;A saved appearance for &amp;quot; + npcfirstname + &amp;quot; &amp;quot; + npclastname + &amp;quot; was found.&amp;quot;);&lt;br /&gt;
        npc = osNpcCreate(npcfirstname, npclastname, llGetPos()+offset, npcfirstname + &amp;quot;_&amp;quot; + npclastname);&lt;br /&gt;
        lognpc(npc);&lt;br /&gt;
        debug(&amp;quot;Created NPC &amp;quot; + (string)npc + &amp;quot; with the name &amp;quot; + npcfirstname + &amp;quot; &amp;quot; + npclastname + &amp;quot;.&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    else{&lt;br /&gt;
        debug(&amp;quot;No appearance for &amp;quot; + npcfirstname + &amp;quot; &amp;quot; + npclastname + &amp;quot; found. Copying your appearance.&amp;quot;);&lt;br /&gt;
        osOwnerSaveAppearance(npcfirstname + &amp;quot;_&amp;quot; + npclastname);&lt;br /&gt;
        npc = osNpcCreate(npcfirstname, npclastname, llGetPos()+offset, npcfirstname + &amp;quot;_&amp;quot; + npclastname);&lt;br /&gt;
        lognpc(npc);&lt;br /&gt;
        debug(&amp;quot;Created NPC &amp;quot; + (string)npc + &amp;quot; with the name &amp;quot; + npcfirstname + &amp;quot; &amp;quot; + npclastname + &amp;quot;.&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NpcSave(list cmdline, integer cmdlength)&lt;br /&gt;
{&lt;br /&gt;
    // Save the NPC's current appearance to a notecare. Accepts a&lt;br /&gt;
    // notecard name as an optional parameter. Card name will be&lt;br /&gt;
    // the NPC's name if not specified, i.e.: John_Smith&lt;br /&gt;
&lt;br /&gt;
    if (npc == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        debug(&amp;quot;Can't save appearance because no NPC has been created. Create an NPC, or use setid to specify a rezzed NPC.&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    if (cmdlength = 1)&lt;br /&gt;
    {&lt;br /&gt;
        osNpcSaveAppearance(npc, npcfirstname + &amp;quot;_&amp;quot; + npclastname);&lt;br /&gt;
        debug(&amp;quot;NPC appearance saved as: &amp;quot; + npcfirstname + &amp;quot;_&amp;quot; + npclastname);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    else if (cmdlength = 2)&lt;br /&gt;
    {&lt;br /&gt;
        osNpcSaveAppearance(npc, llList2String(cmdline, 1));&lt;br /&gt;
        debug(&amp;quot;NPC appearance saved as: &amp;quot; + llList2String(cmdline, 1));&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    else{&lt;br /&gt;
        debug(&amp;quot;Command usage: save [&amp;lt;cardname&amp;gt;]&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NpcLoad(list cmdline, integer cmdlength)&lt;br /&gt;
{&lt;br /&gt;
    // Load an appearance from a notecard, and apply it to the NPC.&lt;br /&gt;
    if (npc == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        debug(&amp;quot;Cannot load an appearance because there is no NPC. Either create one, or assign the UUID of an existing NPC with setid.&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    if (cmdlength == 1)&lt;br /&gt;
    {&lt;br /&gt;
        // No appearance was specified, so use the notecard created when the&lt;br /&gt;
        // NPC was created.&lt;br /&gt;
        if (CardExists(&amp;quot;Test_NPC&amp;quot;))&lt;br /&gt;
        {&lt;br /&gt;
            osNpcLoadAppearance(npc, &amp;quot;Test_NPC&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Default appearance loaded.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            debug(&amp;quot;Cannot load an appearance. No NPC may have been created yet.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    else if (cmdlength == 2)&lt;br /&gt;
    {&lt;br /&gt;
        // Attempt to load an appearance notecard from a specified notecard.&lt;br /&gt;
        string cardname = llList2String(cmdline, 1);&lt;br /&gt;
        if (CardExists(cardname))&lt;br /&gt;
        {&lt;br /&gt;
            osNpcLoadAppearance(npc, cardname);&lt;br /&gt;
            debug(&amp;quot;NPC appearance loaded from the notecard &amp;quot; + cardname + &amp;quot;.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            debug(&amp;quot;The notecard &amp;quot; + cardname + &amp;quot; was not found.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    else if (cmdlength == 3)&lt;br /&gt;
    {&lt;br /&gt;
        // Attempt to load an appearance notcard associated with provided NPC name.&lt;br /&gt;
        string cardname = llList2String(cmdline, 1) + &amp;quot;_&amp;quot; + llList2String(cmdline, 2);&lt;br /&gt;
        if(CardExists(cardname))&lt;br /&gt;
        {&lt;br /&gt;
            osNpcLoadAppearance(npc, cardname);&lt;br /&gt;
            debug(&amp;quot;Loaded the stored appearance for &amp;quot; + llList2String(cmdline,1) + &amp;quot; &amp;quot; + llList2String(cmdline, 2) + &amp;quot;.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            debug(&amp;quot;Cannot load the requested appearance. No notecard associated with &amp;quot; + llList2String(cmdline, 1) + &amp;quot; &amp;quot; + llList2String(cmdline, 2) + &amp;quot; was found.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    else{&lt;br /&gt;
        debug(&amp;quot;Command usage: load [&amp;lt;cardname&amp;gt; | &amp;lt;firstname&amp;gt; &amp;lt;lastname&amp;gt;]&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NpcDelete()&lt;br /&gt;
{&lt;br /&gt;
    // Derez the NPC and clear associated info.&lt;br /&gt;
    if (npc == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        debug(&amp;quot;Can't delete because no NPC has been created. Create an NPC, or use setid to specify a rezzed NPC.&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    string name = llKey2Name(npc);&lt;br /&gt;
    osNpcRemove(npc);&lt;br /&gt;
    npc = NULL_KEY;&lt;br /&gt;
    dead = TRUE;&lt;br /&gt;
    llSetObjectDesc(NULL_KEY);&lt;br /&gt;
    // npcfirstname = &amp;quot;&amp;quot;;&lt;br /&gt;
    //npclastname = &amp;quot;&amp;quot;;&lt;br /&gt;
    debug(&amp;quot;Deleted the NPC named &amp;quot; + name + &amp;quot;.&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NpcCopy()&lt;br /&gt;
{&lt;br /&gt;
    // Copy the appearance of the user to the NPC, and save it to a default&lt;br /&gt;
    // notecard named Test_NPC.&lt;br /&gt;
    if (npc == NULL_KEY)&lt;br /&gt;
    {&lt;br /&gt;
        debug(&amp;quot;Cannot copy your appearance to the NPC because no NPC exists. Either create one, or assign the UUID of an existing NPC with setid.&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    osOwnerSaveAppearance(&amp;quot;Test_NPC&amp;quot;);&lt;br /&gt;
    osNpcLoadAppearance(npc, &amp;quot;Test_NPC&amp;quot;);&lt;br /&gt;
    debug(&amp;quot;Your appearance has been saved to the NPC.&amp;quot;);&lt;br /&gt;
    return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
NpcSetUUID(list cmdline, integer cmdlength)&lt;br /&gt;
{&lt;br /&gt;
    // Assign currently active agent UUID.&lt;br /&gt;
    if (cmdlength &amp;lt; 2 || cmdlength &amp;gt; 3)&lt;br /&gt;
    {&lt;br /&gt;
        debug(&amp;quot;Command usage: setid &amp;lt;UUID&amp;gt;&amp;quot;);&lt;br /&gt;
        debug(&amp;quot;Command usage: setid &amp;lt;firstname&amp;gt; &amp;lt;lastname&amp;gt;&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    key newUUID = llList2Key(cmdline, 1);&lt;br /&gt;
    string name = llKey2Name(newUUID);&lt;br /&gt;
    if (cmdlength == 2)&lt;br /&gt;
    {&lt;br /&gt;
        if (name != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Set the active NPC UUID to the one provided.&lt;br /&gt;
            debug(&amp;quot;This UUID matches the entity named &amp;quot; + name + &amp;quot;.&amp;quot;);&lt;br /&gt;
            npc = newUUID;&lt;br /&gt;
            llSetObjectDesc(newUUID);&lt;br /&gt;
            list namelist = llParseString2List(name, [&amp;quot; &amp;quot;], []);&lt;br /&gt;
            npcfirstname = llList2String(namelist, 0);&lt;br /&gt;
            npclastname = llList2String(namelist, 1);&lt;br /&gt;
            debug(&amp;quot;The NPC's UUID is now &amp;quot; + npc + &amp;quot;.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            debug(&amp;quot;No existing NPC was found for this UUID.&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    if (cmdlength = 3)&lt;br /&gt;
    {&lt;br /&gt;
        // Attempt to detect and assign the NPC UUID by detecting it from&lt;br /&gt;
        // a provided agent name.&lt;br /&gt;
        detectname = llList2String(cmdline, 1) + &amp;quot; &amp;quot; + llList2String(cmdline, 2);&lt;br /&gt;
        state DetectAgent;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
CommandExec(list cmdline)&lt;br /&gt;
{&lt;br /&gt;
    // Commands are interpreted and executed in this function.&lt;br /&gt;
    string cmd = llToLower(llList2String(cmdline, 0));&lt;br /&gt;
    integer cmdlength = llGetListLength(cmdline);&lt;br /&gt;
    if (cmd == &amp;quot;create&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        rezcount=0;&lt;br /&gt;
        NpcCreate(cmdline, cmdlength);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    else if (cmd == &amp;quot;setupnpc&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        npc = osNpcCreate(npcfirstname, npclastname, llGetPos() + &amp;lt;0, 1, 0&amp;gt;, &amp;quot;Test_NPC&amp;quot;);&lt;br /&gt;
        lognpc(npc);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    else if (cmd == &amp;quot;save&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        NpcSave(cmdline, cmdlength);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    else if (cmd == &amp;quot;load&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        NpcLoad(cmdline, cmdlength);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    else if (cmd == &amp;quot;delete&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        NpcDelete(); &lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    else if (cmd == &amp;quot;copy&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        NpcCopy();&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    else if (cmd == &amp;quot;setid&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        NpcSetUUID(cmdline, cmdlength);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    else if (cmd == &amp;quot;getid&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        debug(&amp;quot;Current NPC is &amp;quot; + npcfirstname + &amp;quot; &amp;quot; + npclastname + &amp;quot;, with the UUID: &amp;quot; + (string)npc);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    else if (cmd == &amp;quot;clearid&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        npc = NULL_KEY;&lt;br /&gt;
        llSetObjectDesc(NULL_KEY);&lt;br /&gt;
        debug(&amp;quot;NPC UUID has been set to NULL_KEY.&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    else if (cmd == &amp;quot;help&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        CommandHelp(cmdline);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    else if (cmd == &amp;quot;test&amp;quot;)&lt;br /&gt;
    {&lt;br /&gt;
        string s = llKey2Name(npc);&lt;br /&gt;
        debug(s);&lt;br /&gt;
    }&lt;br /&gt;
    else{&lt;br /&gt;
        debug(&amp;quot;Unknown command: &amp;quot; + llDumpList2String(cmdline, &amp;quot; &amp;quot;));&lt;br /&gt;
        debug(&amp;quot;Use the help command for a list of commands.&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
CommandHelp(list cmdline)&lt;br /&gt;
{&lt;br /&gt;
    // This function provides command instructions and usage information.&lt;br /&gt;
    string cmd = llList2String(cmdline, 0);&lt;br /&gt;
    integer cmdlength = llGetListLength(cmdline);&lt;br /&gt;
    if (cmdlength == 1)&lt;br /&gt;
    {&lt;br /&gt;
        debug(&amp;quot;The following commands are available:&amp;quot;);&lt;br /&gt;
        debug(&amp;quot;\thelp \tcreate \tsave \tload \tdelete&amp;quot;);&lt;br /&gt;
        debug(&amp;quot;\tcopy \tsetid \tgetid \tclearid&amp;quot;);&lt;br /&gt;
        debug(&amp;quot;Use \&amp;quot;help &amp;lt;command&amp;gt;\&amp;quot; to get more information on an item in the list.&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
    else if (cmdlength == 2)&lt;br /&gt;
    {&lt;br /&gt;
        string param = llList2String(cmdline, 1);&lt;br /&gt;
        if (param == &amp;quot;save&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            debug(&amp;quot;The save command saves the current appearance of the NPC to a notecard. If no notecard name is specified, the name is set to the first and last names of the NPC, seperated by an underscore.&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Command usage: save [&amp;lt;cardname&amp;gt;]&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Example: save John_Smith&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        if (param == &amp;quot;load&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            debug(&amp;quot;The load command saves the current appearance of the NPC to a notecard. When not given an parameters, it attempts to load the card created when the NPC was created. It will also attempt to load any notecard when a name is spefified. Finally, it will try to load a notecard named after an NPC.&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Command usage: load [&amp;lt;cardname&amp;gt; | &amp;lt;firstname&amp;gt; &amp;lt;lastname&amp;gt;]&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Example: load&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Example: load mynotecard&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Example: load John Smith&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        else if (param == &amp;quot;delete&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            debug(&amp;quot;The delete command removes the current NPC from the scene.&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Command usage: delete&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        else if (param == &amp;quot;create&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            debug(&amp;quot;The create command creates a new NPC. If it does not find a previously stored appearance for the given NPC name, it copies the appearance of its creator. All subsequent commands will be applied to this new NPC.&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Command usage: create &amp;lt;firstname&amp;gt; &amp;lt;lastName&amp;gt;&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Example: create John Smith&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        else if (param == &amp;quot;copy&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            debug(&amp;quot;The copy command makes a copy of the user's appearance, and applies it to the NPC.&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Command usage: copy&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        else if (param == &amp;quot;setid&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            debug(&amp;quot;The setid command tells &amp;quot; + llGetObjectName() + &amp;quot; which NPC it is working with. Can be provided with an explicit UUID, or given a first and last name from which it will attempt to detect the UUID.&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Command usage: setid &amp;lt;UUID&amp;gt;&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Command usage: setid &amp;lt;firstname&amp;gt; &amp;lt;lastname&amp;gt;&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Example: setid e254e947-65d0-4bc8-b70a-6e6c05bf0535&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        else if (param == &amp;quot;getid&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            debug(&amp;quot;The getid command retrieves and displays the UUID for the current active NPC.&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Command usage: getid&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        else if (param == &amp;quot;clearid&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            debug(&amp;quot;The clearid command sets the NPC's UUID to NULL_KEY.&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Command usage: clearid&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
        else if (param == &amp;quot;help&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            debug(&amp;quot;Please see the help command.&amp;quot;);&lt;br /&gt;
            debug(&amp;quot;Command usage: help&amp;quot;);&lt;br /&gt;
            return;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    else{&lt;br /&gt;
        debug(&amp;quot;Command usage: help [&amp;lt;command&amp;gt;]&amp;quot;);&lt;br /&gt;
        return;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
integer anim = FALSE;&lt;br /&gt;
integer dead = TRUE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    on_rez(integer start_param)&lt;br /&gt;
    {&lt;br /&gt;
        ResetScript();&lt;br /&gt;
    }&lt;br /&gt;
    changed(integer change)&lt;br /&gt;
    {&lt;br /&gt;
        if(change &amp;amp; CHANGED_INVENTORY) &lt;br /&gt;
        {&lt;br /&gt;
            NpcDelete();&lt;br /&gt;
            llSleep(3); &lt;br /&gt;
            ResetScript();&lt;br /&gt;
        }&lt;br /&gt;
        else if(change &amp;amp; CHANGED_OWNER) &lt;br /&gt;
        {&lt;br /&gt;
            ResetScript();&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llListen(channel, &amp;quot;&amp;quot;, NULL_KEY, &amp;quot;&amp;quot;);&lt;br /&gt;
        llListen(0,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        init();&lt;br /&gt;
        llSetObjectDesc(NULL_KEY);&lt;br /&gt;
        //llSensor(&amp;quot;&amp;quot;, NULL_KEY, AGENT, 4.0, PI);&lt;br /&gt;
        debug(llGetObjectName() + &amp;quot; started on channel &amp;quot; + (string)channel + &amp;quot;.&amp;quot;);&lt;br /&gt;
        debug(&amp;quot;Use the help command to get started.&amp;quot;);&lt;br /&gt;
        debug(&amp;quot;Example: /&amp;quot; + (string)channel + &amp;quot; help&amp;quot;);&lt;br /&gt;
        anim = FALSE;&lt;br /&gt;
        llSetTimerEvent(1);&lt;br /&gt;
        debug(&amp;quot;RUNNING&amp;quot;);&lt;br /&gt;
    } &lt;br /&gt;
    timer()&lt;br /&gt;
    {&lt;br /&gt;
        if ((llKey2Name(npc) == &amp;quot;&amp;quot; &amp;amp;&amp;amp; (dead != TRUE)))&lt;br /&gt;
        {&lt;br /&gt;
            ResetScript(); &lt;br /&gt;
        }&lt;br /&gt;
        else{&lt;br /&gt;
            // osNpcPlayAnimation(npc, &amp;quot;Hello&amp;quot;;&lt;br /&gt;
            if(rand)&lt;br /&gt;
            {&lt;br /&gt;
                osNpcSetRot(npc, llGetRot() * (llEuler2Rot(&amp;lt;0, 0, llFrand(360)&amp;gt; * DEG_TO_RAD))); // Setting Random Rotation every wait&lt;br /&gt;
            }&lt;br /&gt;
            readLineId = llGetNotecardLine(config, line++);&lt;br /&gt;
        }&lt;br /&gt;
        llSetTimerEvent(delay); &lt;br /&gt;
    }&lt;br /&gt;
    dataserver(key request_id, string data)&lt;br /&gt;
    {&lt;br /&gt;
        if(request_id == readLineId)&lt;br /&gt;
        {&lt;br /&gt;
            processConfiguration(data);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    listen(integer chan, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if(chan==channel)&lt;br /&gt;
        {&lt;br /&gt;
            if (msg == &amp;quot;&amp;quot; ) { return; }&lt;br /&gt;
            if (id != llGetOwner())&lt;br /&gt;
            {&lt;br /&gt;
                // llSay(0, &amp;quot;Only the owner of &amp;quot; + llGetObjectName() + &amp;quot; may issue commands.&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            list commandline = llParseString2List(msg, [&amp;quot; &amp;quot;], []);&lt;br /&gt;
            CommandExec(commandline);&lt;br /&gt;
        }&lt;br /&gt;
        if(chan==0)&lt;br /&gt;
        {&lt;br /&gt;
            //conversations&lt;br /&gt;
            if(id!=npc)&lt;br /&gt;
            {&lt;br /&gt;
                integer length = llGetListLength(triggers);&lt;br /&gt;
                integer i;&lt;br /&gt;
                for (i = 0; i &amp;lt; length; ++i) {&lt;br /&gt;
                    string word = llList2String(triggers, i);&lt;br /&gt;
                    integer found=llSubStringIndex(llToLower(msg),word);&lt;br /&gt;
                    if(found&amp;gt;-1)&lt;br /&gt;
                    {&lt;br /&gt;
                        integer address=llList2Integer(goto,i);&lt;br /&gt;
                        gotoqueue= [(integer)address] + gotoqueue;&lt;br /&gt;
                        debug(&amp;quot;Added address &amp;quot; + address + &amp;quot; to gotoqueue.&amp;quot;);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    sensor(integer num)&lt;br /&gt;
    {&lt;br /&gt;
        integer count=0;&lt;br /&gt;
        while(count&amp;lt;num)&lt;br /&gt;
        {&lt;br /&gt;
            string myname=npcfirstname + &amp;quot; &amp;quot; + npclastname;&lt;br /&gt;
            string name=llKey2Name(llDetectedKey(count));&lt;br /&gt;
            if(name!=myname)&lt;br /&gt;
            {&lt;br /&gt;
                if(llListFindList(greet,[name])&amp;lt;0)&lt;br /&gt;
                {&lt;br /&gt;
                    greet+=[name];&lt;br /&gt;
                    integer space=llSubStringIndex(name,&amp;quot; &amp;quot;);&lt;br /&gt;
                    string firstName=llGetSubString(name,0,space-1);&lt;br /&gt;
                    integer known=get_aqaintance(name);&lt;br /&gt;
                    llSleep(0.5);&lt;br /&gt;
                    if(known==0){&lt;br /&gt;
                    osNpcSay(npc,hiufirst + firstName + hiulast);&lt;br /&gt;
                    set_aqaintance(name);&lt;br /&gt;
                }&lt;br /&gt;
                    else{&lt;br /&gt;
                        osNpcSay(npc,hikfirst + firstName + hiklast);&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            count++;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    no_sensor()&lt;br /&gt;
    {&lt;br /&gt;
        greet=[];&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
state DetectAgent&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llSensor(detectname, NULL_KEY, AGENT, 96, PI);&lt;br /&gt;
    }&lt;br /&gt;
    sensor(integer number)&lt;br /&gt;
    {&lt;br /&gt;
        debug(&amp;quot;The entity named &amp;quot; + detectname + &amp;quot; was found.&amp;quot;);&lt;br /&gt;
        npc = llDetectedKey(0);&lt;br /&gt;
        llSetObjectDesc(llDetectedKey(0));&lt;br /&gt;
        list namelist = llParseString2List(detectname, [&amp;quot; &amp;quot;], []);&lt;br /&gt;
        npcfirstname = llList2String(namelist, 0);&lt;br /&gt;
        npclastname = llList2String(namelist, 1);&lt;br /&gt;
        debug(&amp;quot;The NPC's UUID is now &amp;quot; + npc + &amp;quot;.&amp;quot;);&lt;br /&gt;
        detectname = &amp;quot;&amp;quot;;&lt;br /&gt;
        state default;&lt;br /&gt;
    }&lt;br /&gt;
    no_sensor()&lt;br /&gt;
    {&lt;br /&gt;
        debug(&amp;quot;The entity named &amp;quot; + detectname + &amp;quot; was not found.&amp;quot;);&lt;br /&gt;
        detectname = &amp;quot;&amp;quot;;&lt;br /&gt;
        gotoqueue=[];&lt;br /&gt;
        state default;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Credit==&lt;br /&gt;
Original script by Paintball Magic. Rewritten, corrected and expanded by Nihlaeth Melody.&lt;/div&gt;</summary>
		<author><name>Nihlaeth</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/wiki/OSSLNPC</id>
		<title>OSSLNPC</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/OSSLNPC"/>
				<updated>2013-02-01T01:33:12Z</updated>
		
		<summary type="html">&lt;p&gt;Nihlaeth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Quicklinks}}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
Since OpenSimulator 0.7.2, a number of functions are provided for for creating and manipulating server-side NPCs. These replace the previous functions, that had stopped working by OpenSimulator 0.7.1.1 (possibly broken since OpenSimulator 0.6.9).&lt;br /&gt;
&lt;br /&gt;
The general philosophy in creating these new functions is to &lt;br /&gt;
&lt;br /&gt;
# Give script writers the simple tools needed to create more sophisticated behaviour.&lt;br /&gt;
# Avoid duplicating existing LSL and OSSL functions. For instance, finding out what state an agent is in can be done through llGetAgentInfo() rather than creating a special NPC function. &lt;br /&gt;
&lt;br /&gt;
NPCs are controlled via a script which must be in the same region as the NPC. This could be housed in an attachment that is attached to the avatar.&lt;br /&gt;
&lt;br /&gt;
NPCs created user these scripts cannot leave the region in which they were born. If you want region crossing behaviour, please look at the options on the [[NPC]] wiki page.&lt;br /&gt;
&lt;br /&gt;
NPC appearance is saved and loaded by serializing the appearance data structure to a notecard present in the same prim as the script. The required textures should be preserved when an OAR is saved and loaded.&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the appearance data format is currently the same used for the OpenSimulator wire format, and so is not designed to be edited directly.  However, with great care this should be possible, see [[Appearance Formats]] for more details.&lt;br /&gt;
&lt;br /&gt;
= Enabling =&lt;br /&gt;
&lt;br /&gt;
To use these functions, in the OpenSim.ini file you will need the following config&lt;br /&gt;
&lt;br /&gt;
# Enabled = true set in the [NPC] section.&lt;br /&gt;
# Enabled = true set in the [XEngine] section.&lt;br /&gt;
# AllowOSFunctions = true in the [XEngine] section.&lt;br /&gt;
# OSFunctionThreatLevel = VeryHigh in the [XEngine] section. The functions osAgentSaveAppearance(), osAvatarPlayAnimation() and osAvatarStopAnimation() need this level. If you don't need these functions, then a &amp;quot;High&amp;quot; level will suffice.&lt;br /&gt;
&lt;br /&gt;
See [[Configuring Simulator Parameters#Getting information about parameters]] if you need to double check that these parameters have been set correctly.&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
&lt;br /&gt;
* When using your avatar to model appearance before saving, you will need to wait a few seconds before invoking any save appearance command. This is because appearance saving currently operates on a timer in order to manage multiple appearance updates from the viewer.&lt;br /&gt;
* OpenSimulator 0.7.3-rc1 introduces the concept of 'owned' and 'unowned' NPC. An 'owned' NPC is one where only the creating script and other scripts with the same owner can manipulate the NPC. An 'unowned' NPC is one where any script with the right permissions (as defined in the [XEngine] configuration section) can manipulate it. In OpenSimulator 0.7.3, all avatars are 'owned' by default unless otherwise specified in the osNpcCreate() call.&lt;br /&gt;
&lt;br /&gt;
= Sensing =&lt;br /&gt;
&lt;br /&gt;
llAgentSensor() can be used to set up a sensor that will detected NPCs instead/of as well as other region entities.&lt;br /&gt;
&lt;br /&gt;
In OpenSimulator 0.7.2, LSL sensors will detect NPCs as ordinary agents.&lt;br /&gt;
&lt;br /&gt;
In OpenSimulator 0.7.3-rc1 onwards, unless otherwise specified, NPCs will only be detected using the OpenSimulator-specific NPC flag, e.g.&lt;br /&gt;
&lt;br /&gt;
As of git master bcfc392 (Fri Jul 20 21:08:04 2012), the constant OS_NPC should now be used instead of NPC, in order to avoid future issues if LL decide to use NPC themselves for some other function.  The NPC constant will be deprecated in the forthcoming OpenSimulator 0.7.4 release but will remain useble.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
//Author: mewtwo0641&lt;br /&gt;
&lt;br /&gt;
list keys = []; &lt;br /&gt;
key npc;&lt;br /&gt;
string toucher;&lt;br /&gt;
key toucherkey;&lt;br /&gt;
vector toucherPos;&lt;br /&gt;
integer npc_on = FALSE;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{ &lt;br /&gt;
    touch_start(integer x)&lt;br /&gt;
    {   &lt;br /&gt;
        toucherkey = llDetectedKey(0);&lt;br /&gt;
        toucherPos = llDetectedPos(0);&lt;br /&gt;
        vector npcPos = llGetPos() + &amp;lt;1,1,1&amp;gt;;&lt;br /&gt;
    &lt;br /&gt;
        if(npc_on == FALSE)&lt;br /&gt;
        {    &lt;br /&gt;
            npc = osNpcCreate(&amp;quot;Fred&amp;quot;, &amp;quot;Flintstone&amp;quot;, npcPos, toucherkey);&lt;br /&gt;
            npc_on = TRUE;&lt;br /&gt;
            llSensor(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, AGENT | NPC, 96.0, PI); //Will always return NPC key regardless of npc create option&lt;br /&gt;
            return;&lt;br /&gt;
        }   &lt;br /&gt;
    &lt;br /&gt;
        if(npc_on == TRUE)&lt;br /&gt;
        {   &lt;br /&gt;
            osNpcRemove(npc);&lt;br /&gt;
            llResetScript();&lt;br /&gt;
        }   &lt;br /&gt;
    }   &lt;br /&gt;
    &lt;br /&gt;
    sensor(integer num)&lt;br /&gt;
    {   &lt;br /&gt;
        keys = []; &lt;br /&gt;
        integer i = 0;&lt;br /&gt;
    &lt;br /&gt;
        for(i; i &amp;lt; num; i++)&lt;br /&gt;
        {   &lt;br /&gt;
            keys += llDetectedKey(i); &lt;br /&gt;
        }   &lt;br /&gt;
    &lt;br /&gt;
        llOwnerSay(llDumpList2String(keys, &amp;quot;\n&amp;quot;));&lt;br /&gt;
    }   &lt;br /&gt;
    &lt;br /&gt;
    no_sensor()&lt;br /&gt;
    {   &lt;br /&gt;
        keys = [];   &lt;br /&gt;
    }   &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can get NPCs to be detected as AGENTs again using the OS_NPC_SENSE_AS_AGENT option below in osNpcCreate().&lt;br /&gt;
&lt;br /&gt;
The justification is that detecting NPCs as AGENTs by default may make some scripts unusable (e.g. radars that know nothing about NPCs). However, conversely other scripts may not behave as expected if NPCs aren't sensed as agents (e.g. doors that open automatically for avatars would not open for NPCs).&lt;br /&gt;
&lt;br /&gt;
From OpenSimulator git master commit ecf7bb26 (Fri Jul 20 21:36:33 2012), llGetDetectedType() will set the OS_NPC flag if an NPC was detected.  If the NPC was created with the OS_NPC_SENSE_AS_AGENT option then the AGENT flag will also be set.&lt;br /&gt;
&lt;br /&gt;
= Data Formats =&lt;br /&gt;
For more information about the format used to store appearance information in notecards, see [[Appearance Formats]].&lt;br /&gt;
&lt;br /&gt;
= Functions =&lt;br /&gt;
&lt;br /&gt;
== Create and Remove ==&lt;br /&gt;
=== [[osNpcCreate]] ===&lt;br /&gt;
&lt;br /&gt;
 osNpcCreate(string firstname, string lastname, vector position, string cloneFrom):key&lt;br /&gt;
&lt;br /&gt;
cloneFrom may be:&lt;br /&gt;
&lt;br /&gt;
* Name of the notecard containing a serialized avatar appearance, or&lt;br /&gt;
* Asset UUID of the Notecard, or&lt;br /&gt;
* UUID of an avatar logged into the same region. However, please note that this appearance will not be persisted unless osNpcSaveAppearance() is called.&lt;br /&gt;
&lt;br /&gt;
If the NPC is successfully created, then its UUID is returned, which is required for all subsequent functions. Example is available at [[osNpcCreate]]&lt;br /&gt;
&lt;br /&gt;
(OpenSimulator 0.7.3-rc1 onwards only). This creates an NPC that is 'owned' by the creating script and sensed using the OpenSimulator-only NPC flag for sensors.&lt;br /&gt;
&lt;br /&gt;
=== osNpcCreate ===&lt;br /&gt;
&lt;br /&gt;
OpenSimulator 0.7.3-rc1 onwards.&lt;br /&gt;
&lt;br /&gt;
 osNpcCreate(string firstname, string lastname, vector position, string cloneFrom, integer options):key&lt;br /&gt;
&lt;br /&gt;
cloneFrom may be:&lt;br /&gt;
&lt;br /&gt;
* Name of the notecard containing a serialized avatar appearance, or&lt;br /&gt;
* Asset UUID of the Notecard, or&lt;br /&gt;
* UUID of an avatar logged into the same region. However, please note that this appearance will not be persisted unless osNpcSaveAppearance() is called.&lt;br /&gt;
&lt;br /&gt;
integer is a set of flags that may be 0 or one or more of&lt;br /&gt;
&lt;br /&gt;
* OS_NPC_NOT_OWNED - create an unowned NPC.&lt;br /&gt;
* OS_NPC_SENSE_AS_AGENT - create an NPC that is sensed as an AGENT with LSL sensors &lt;br /&gt;
&lt;br /&gt;
If the NPC is successfully created, then its UUID is returned, which is required for all subsequent functions. Example is available at [[osNpcCreate]]&lt;br /&gt;
&lt;br /&gt;
=== [[osNpcRemove]] ===&lt;br /&gt;
&lt;br /&gt;
 osNpcRemove(key npc):void&lt;br /&gt;
&lt;br /&gt;
Remove the given avatar from the region. Example at [[osNpcRemove]].&lt;br /&gt;
&lt;br /&gt;
== Get and Set ==&lt;br /&gt;
=== osIsNpc ===&lt;br /&gt;
&lt;br /&gt;
OpenSimulator 0.7.3-rc1 onwards.&lt;br /&gt;
&lt;br /&gt;
 osIsNpc(key npc):integer&lt;br /&gt;
&lt;br /&gt;
Returns TRUE if the given key is an NPC, false otherwise.&lt;br /&gt;
&lt;br /&gt;
=== [[osNpcGetRot]] ===&lt;br /&gt;
&lt;br /&gt;
Gets the rotation of the avatar. Only the rotation around the Z plane in Euler rotation (horizontal rotation) has any meaning.&lt;br /&gt;
&lt;br /&gt;
 osNpcGetRot(key npc):rotation&lt;br /&gt;
&lt;br /&gt;
=== [[osNpcSetRot]] ===&lt;br /&gt;
&lt;br /&gt;
 osNpcSetRot(key npc, rotation rot):void&lt;br /&gt;
&lt;br /&gt;
Set the rotation of the avatar. Only setting the rotation in the Z plane in Euler rotation will have any meaningful effect (turning the avatar to point in one direction or another). Setting X or Y Euler values will result in the avatar rotating in an undefined manner.&lt;br /&gt;
&lt;br /&gt;
=== [[osNpcGetPos]] ===&lt;br /&gt;
&lt;br /&gt;
 osNpcGetPos(key npc):vector&lt;br /&gt;
&lt;br /&gt;
Return the current position of the NPC.&lt;br /&gt;
&lt;br /&gt;
=== [[osNpcGetOwner]] ===&lt;br /&gt;
&lt;br /&gt;
OpenSimulator 0.7.3-rc1 onwards.&lt;br /&gt;
&lt;br /&gt;
 osNpcGetOwner(key npc):key&lt;br /&gt;
&lt;br /&gt;
Return the owner of the given NPC (i.e. the owner of the script that created it). If the NPC is unowned or the input key does not belong to an NPC then returns NULL_KEY.&lt;br /&gt;
&lt;br /&gt;
== Movement ==&lt;br /&gt;
&lt;br /&gt;
=== [[osNpcMoveTo]] ===&lt;br /&gt;
&lt;br /&gt;
 osNpcMoveTo(key npc, vector position):void&lt;br /&gt;
&lt;br /&gt;
An older function that performs an osNpcMoveToTarget() by flying and landing at the target.&lt;br /&gt;
&lt;br /&gt;
=== [[osNpcMoveToTarget]] ===&lt;br /&gt;
&lt;br /&gt;
 osNpcMoveToTarget(key npc, vector target, int options):void&lt;br /&gt;
&lt;br /&gt;
Move the avatar to a given target over time. How the avatar will get there depends on the following options.&lt;br /&gt;
&lt;br /&gt;
* OS_NPC_FLY - Fly the avatar to the given position. The avatar will not land unless the OS_NPC_LAND_AT_TARGET option is also given.&lt;br /&gt;
* OS_NPC_NO_FLY - Do not fly to the target. The NPC will attempt to walk to the location. If it's up in the air then the avatar will keep bouncing hopeless until another move target is given or the move is stopped&lt;br /&gt;
* OS_NPC_LAND_AT_TARGET - If given and the avatar is flying, then it will land when it reaches the target. If OS_NPC_NO_FLY is given then this option has no effect.&lt;br /&gt;
* OS_NPC_RUNNING - if given, NPC avatar moves at running/fast flying speed, otherwise moves at walking/slow flying speed.&lt;br /&gt;
&lt;br /&gt;
OS_NPC_FLY and OS_NPC_NO_FLY are options that cannot be combined - the avatar will end up doing one or the other. If you want the avatar to fly and land at the target, then OS_NPC_LAND_AT_TARGET must be combined with OS_NPC_FLY. For instance,&lt;br /&gt;
&lt;br /&gt;
 osNpcMoveToTarget(npc, llGetPos() + &amp;lt;9,9,5&amp;gt;, OS_NPC_FLY|OS_NPC_LAND_AT_TARGET);&lt;br /&gt;
&lt;br /&gt;
=== [[osNpcStopMoveToTarget]] ===&lt;br /&gt;
&lt;br /&gt;
 osNpcStopMoveToTarget(key npc):void&lt;br /&gt;
&lt;br /&gt;
Stop a current move to a target.&lt;br /&gt;
&lt;br /&gt;
== Sitting and standing ==&lt;br /&gt;
&lt;br /&gt;
=== osNpcSit ===&lt;br /&gt;
&lt;br /&gt;
OpenSimulator 0.7.3-rc1 onwards.&lt;br /&gt;
&lt;br /&gt;
 osNpcSit(key npc, key target, int options):void&lt;br /&gt;
&lt;br /&gt;
Sit an NPC on a prim target. As yet there are no options, so always input 0.&lt;br /&gt;
&lt;br /&gt;
=== osNpcStand ===&lt;br /&gt;
&lt;br /&gt;
OpenSimulator 0.7.3-rc1 onwards.&lt;br /&gt;
&lt;br /&gt;
 osNpcStand(key npc):void&lt;br /&gt;
&lt;br /&gt;
Make an npc stand up.&lt;br /&gt;
&lt;br /&gt;
== Communication ==&lt;br /&gt;
&lt;br /&gt;
=== [[osNpcSay]] ===&lt;br /&gt;
&lt;br /&gt;
 osNpcSay(key npc, string message):void &lt;br /&gt;
 osNpcSay(key npc, int channel, string message):void&lt;br /&gt;
&lt;br /&gt;
Get the NPC to say the given message. &lt;br /&gt;
&lt;br /&gt;
If channel is specified then the chat is said on the given channel.  The channel parameter is only available in OpenSimulator 0.7.4 development code at this time.&lt;br /&gt;
&lt;br /&gt;
=== [[osNpcShout]] ===&lt;br /&gt;
&lt;br /&gt;
Only in OpenSimulator 0.7.4 development code at this time.&lt;br /&gt;
&lt;br /&gt;
 osNpcShout(key npc, int channel, string message):void&lt;br /&gt;
&lt;br /&gt;
Get the NPC to shout the given message on the given channel.&lt;br /&gt;
&lt;br /&gt;
=== [[osNpcWhisper]] ===&lt;br /&gt;
&lt;br /&gt;
Only in OpenSimulator 0.7.4 development code at this time.&lt;br /&gt;
&lt;br /&gt;
 osNpcWhisper(key npc, int channel, string message):void&lt;br /&gt;
&lt;br /&gt;
Get the NPC to whisper the given message on the given channel.&lt;br /&gt;
&lt;br /&gt;
== Animations ==&lt;br /&gt;
&lt;br /&gt;
=== osNpcPlayAnimation ===&lt;br /&gt;
&lt;br /&gt;
OpenSimulator 0.7.3-rc1 onwards.&lt;br /&gt;
&lt;br /&gt;
 osNpcPlayAnimation(key npc, string animation):void&lt;br /&gt;
&lt;br /&gt;
Get an NPC to play an animation. The animation can either be a key or the name of an animation in the same inventory as the script.&lt;br /&gt;
&lt;br /&gt;
=== osNpcStopAnimation ===&lt;br /&gt;
&lt;br /&gt;
In OpenSimulator 0.7.3-rc1 there is a bug which makes this play the animation instead. This will be corrected for the final release but in the mean time please use osAvatarStopAnimation() instead.&lt;br /&gt;
&lt;br /&gt;
 osNpcStopAnimation(key npc, string animation):void&lt;br /&gt;
&lt;br /&gt;
Get an NPC to stop playing an animation. The animation can either be a key or the name of an animation in the same inventory as the script.&lt;br /&gt;
&lt;br /&gt;
== Appearance ==&lt;br /&gt;
&lt;br /&gt;
NPC appearance is manipulated by saving and loading appearance data to notecards from the same inventory as the invoking script.&lt;br /&gt;
&lt;br /&gt;
=== [[osOwnerSaveAppearance]] ===&lt;br /&gt;
&lt;br /&gt;
 osOwnerSaveAppearance(string notecard):key&lt;br /&gt;
&lt;br /&gt;
Save the owner's current appearance to a notecard in the prim's inventory. This includes body part data, clothing items and attachments. If a notecard with the same name already exists then it is replaced. The owner must be present in the region when this function is invoked. The baked textures for the owner (necessary to recreate appearance on the NPC) are saved permanently.&lt;br /&gt;
&lt;br /&gt;
=== [[osAgentSaveAppearance]] ===&lt;br /&gt;
&lt;br /&gt;
 osAgentSaveAppearance(key agentId, string notecard):key&lt;br /&gt;
&lt;br /&gt;
Save an arbitrary avatar's appearance to a notecard in the prim's inventory. This includes body part data, clothing items and attachments. If a notecard with the same name already exists then it is replaced. The avatar must be present in the region when this function is invoked. The baked textures for the avatar (necessary to recreate appearance on the NPC) are saved permanently.&lt;br /&gt;
&lt;br /&gt;
=== [[osNpcSaveAppearance]] ===&lt;br /&gt;
&lt;br /&gt;
 osNpcSaveAppearance(key npc, string notecard):key&lt;br /&gt;
&lt;br /&gt;
Save the NPC's current appearance to a notecard in the prim's inventory. This includes body part data, clothing items and attachments. If a notecard with the same name already exists then it is replaced. The avatar must be present in the region when this function is invoked. The baked textures for the avatar (necessary to recreate appearance) are saved permanently.&lt;br /&gt;
&lt;br /&gt;
=== [[osNpcLoadAppearance]] ===&lt;br /&gt;
&lt;br /&gt;
 osNpcLoadAppearance(key npc, string notecard):void&lt;br /&gt;
&lt;br /&gt;
Load appearance from a notecard. This notecard must contain appearance data created with one of the save appearance functions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Touch ==&lt;br /&gt;
=== [[osNpcTouch]] ===&lt;br /&gt;
&lt;br /&gt;
OpenSimulator 0.7.4 development code at this time.&lt;br /&gt;
&lt;br /&gt;
 osNpcTouch(key npc, key objectKey, integer linkNum)&lt;br /&gt;
&lt;br /&gt;
Allows the NPC to touch objects.&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
*[[NPC Automator 2.0]]&lt;br /&gt;
&lt;br /&gt;
This is a rough example script for most of the current NPC functionality.  One of its major current deficiencies is that it doesn't track more than one created avatar at a time.  Please feel free to improve it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang = &amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
key npc;&lt;br /&gt;
integer listenChannel = 10;&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    // NPC manipulator adapted by justincc 0.0.3 released 20121025&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llListen(listenChannel,&amp;quot;&amp;quot;,NULL_KEY,&amp;quot;&amp;quot;);&lt;br /&gt;
        llSetText(&amp;quot;Listening on &amp;quot; + listenChannel, &amp;lt;0, 255, 0&amp;gt;, 1);&lt;br /&gt;
        llOwnerSay(&amp;quot;Say /&amp;quot; + (string)listenChannel + &amp;quot; help for commands&amp;quot;);&lt;br /&gt;
    }  &lt;br /&gt;
     &lt;br /&gt;
    listen(integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if (msg != &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            list commands = llParseString2List(msg, [ &amp;quot; &amp;quot; ], []);&lt;br /&gt;
            string msg0 = llList2String(commands, 0);&lt;br /&gt;
            string msg1 = llList2String(commands, 1);            &lt;br /&gt;
            string msg2 = llList2String(commands, 2);&lt;br /&gt;
            string msg3 = llList2String(commands, 3);&lt;br /&gt;
         &lt;br /&gt;
            if (msg0 == &amp;quot;create&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                if (msg1 != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    string notecardName = msg1;&lt;br /&gt;
                &lt;br /&gt;
                    npc = osNpcCreate(&amp;quot;Jane&amp;quot;, &amp;quot;Doe&amp;quot;, llGetPos() + &amp;lt;5, 5, 0&amp;gt;, notecardName);&lt;br /&gt;
                &lt;br /&gt;
                    llOwnerSay(&amp;quot;Created npc from notecard &amp;quot; + notecardName);&lt;br /&gt;
                }&lt;br /&gt;
                else&lt;br /&gt;
                {&lt;br /&gt;
                    llOwnerSay(&amp;quot;Usage: create &amp;lt;notecard-name&amp;gt;&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
            }  &lt;br /&gt;
            else if (msg0 ==&amp;quot;createm&amp;quot; &amp;amp;&amp;amp; msg1 != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                osOwnerSaveAppearance(&amp;quot;appearance&amp;quot;);&lt;br /&gt;
                vector pos = llGetPos();&lt;br /&gt;
                integer i;&lt;br /&gt;
                for (i = 0; i &amp;lt; (integer)msg1; i++)&lt;br /&gt;
                {&lt;br /&gt;
                    osNpcCreate(&amp;quot;John&amp;quot;, &amp;quot;Doe&amp;quot;, pos + &amp;lt;8, 0, 0&amp;gt;, &amp;quot;appearance&amp;quot;);&lt;br /&gt;
                    llSleep(1);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg0 == &amp;quot;remove&amp;quot; &amp;amp;&amp;amp; npc != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                osNpcSay(npc, &amp;quot;You will pay for this with your liiiiiivvveeessss!!!.....&amp;quot;);&lt;br /&gt;
                osNpcRemove(npc);&lt;br /&gt;
            }   &lt;br /&gt;
            else if (msg0 == &amp;quot;say&amp;quot; &amp;amp;&amp;amp; npc != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                osNpcSay(npc, &amp;quot;I am your worst Nightmare!!!!&amp;quot;);&lt;br /&gt;
            }   &lt;br /&gt;
            else if (msg0 == &amp;quot;move&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                if (msg1 != &amp;quot;&amp;quot; &amp;amp;&amp;amp; msg2 != &amp;quot;&amp;quot; &amp;amp;&amp;amp; npc != NULL_KEY)&lt;br /&gt;
                {                &lt;br /&gt;
                    vector delta = &amp;lt;(integer)msg1, (integer)msg2, 0&amp;gt;;&lt;br /&gt;
                    &lt;br /&gt;
                    if (msg3 != &amp;quot;&amp;quot;)&lt;br /&gt;
                    {&lt;br /&gt;
                        delta.z = (integer)msg3;&lt;br /&gt;
                    }&lt;br /&gt;
                    &lt;br /&gt;
                    osNpcMoveTo(npc, osNpcGetPos(npc) + delta);                    &lt;br /&gt;
                }                            &lt;br /&gt;
                else&lt;br /&gt;
                {&lt;br /&gt;
                    llOwnerSay(&amp;quot;Usage: move &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; [&amp;lt;z&amp;gt;]&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
            }   &lt;br /&gt;
            else if (msg0 == &amp;quot;moveto&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                if (msg1 != &amp;quot;&amp;quot; &amp;amp;&amp;amp; msg2 != &amp;quot;&amp;quot; &amp;amp;&amp;amp; npc != NULL_KEY)&lt;br /&gt;
                {                &lt;br /&gt;
                    vector pos = &amp;lt;(integer)msg1, (integer)msg2, 0&amp;gt;;&lt;br /&gt;
                    &lt;br /&gt;
                    if (msg3 != &amp;quot;&amp;quot;)&lt;br /&gt;
                    {&lt;br /&gt;
                        pos.z = (integer)msg3;&lt;br /&gt;
                    }&lt;br /&gt;
                    &lt;br /&gt;
                    osNpcMoveTo(npc, pos);                    &lt;br /&gt;
                }                            &lt;br /&gt;
                else&lt;br /&gt;
                {&lt;br /&gt;
                    llOwnerSay(&amp;quot;Usage: move &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; [&amp;lt;z&amp;gt;]&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
            }            &lt;br /&gt;
            else if (msg0 == &amp;quot;movetarget&amp;quot; &amp;amp;&amp;amp; npc != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                osNpcMoveToTarget(npc, llGetPos() + &amp;lt;9,9,5&amp;gt;, OS_NPC_FLY|OS_NPC_LAND_AT_TARGET);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg0 == &amp;quot;movetargetnoland&amp;quot; &amp;amp;&amp;amp; npc != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                osNpcMoveToTarget(npc, llGetPos() + &amp;lt;9,9,5&amp;gt;, OS_NPC_FLY);&lt;br /&gt;
            }            &lt;br /&gt;
            else if (msg0 == &amp;quot;movetargetwalk&amp;quot; &amp;amp;&amp;amp; npc != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                osNpcMoveToTarget(npc, llGetPos() + &amp;lt;9,9,0&amp;gt;, OS_NPC_NO_FLY);                &lt;br /&gt;
            }&lt;br /&gt;
            else if (msg0 == &amp;quot;rot&amp;quot; &amp;amp;&amp;amp; npc != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                vector xyz_angles = &amp;lt;0,0,90&amp;gt;; // This is to define a 1 degree change&lt;br /&gt;
                vector angles_in_radians = xyz_angles * DEG_TO_RAD; // Change to Radians&lt;br /&gt;
                rotation rot_xyzq = llEuler2Rot(angles_in_radians); // Change to a Rotation                &lt;br /&gt;
                rotation rot = osNpcGetRot(npc);&lt;br /&gt;
                osNpcSetRot(npc, rot * rot_xyzq);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg0 == &amp;quot;rotabs&amp;quot; &amp;amp;&amp;amp; msg1 != &amp;quot;&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                vector xyz_angles = &amp;lt;0, 0, (integer)msg1&amp;gt;;&lt;br /&gt;
                vector angles_in_radians = xyz_angles * DEG_TO_RAD; // Change to Radians&lt;br /&gt;
                rotation rot_xyzq = llEuler2Rot(angles_in_radians); // Change to a Rotation                &lt;br /&gt;
                osNpcSetRot(npc, rot_xyzq);                &lt;br /&gt;
            }&lt;br /&gt;
            else if (msg0 == &amp;quot;animate&amp;quot; &amp;amp;&amp;amp; npc != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                osAvatarPlayAnimation(npc, &amp;quot;stabbed+die_2&amp;quot;);&lt;br /&gt;
                llSleep(3);&lt;br /&gt;
                osAvatarStopAnimation(npc, &amp;quot;stabbed+die_2&amp;quot;);&lt;br /&gt;
            }   &lt;br /&gt;
            else if (msg0 == &amp;quot;save&amp;quot; &amp;amp;&amp;amp; msg1 != &amp;quot;&amp;quot; &amp;amp;&amp;amp; npc != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                osNpcSaveAppearance(npc, msg1);&lt;br /&gt;
                llOwnerSay(&amp;quot;Saved appearance &amp;quot; + msg1 + &amp;quot; to &amp;quot; + npc);                &lt;br /&gt;
            }&lt;br /&gt;
            else if (msg0 == &amp;quot;load&amp;quot; &amp;amp;&amp;amp; msg1 != &amp;quot;&amp;quot; &amp;amp;&amp;amp; npc != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                osNpcLoadAppearance(npc, msg1);&lt;br /&gt;
                llOwnerSay(&amp;quot;Loaded appearance &amp;quot; + msg1 + &amp;quot; to &amp;quot; + npc);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg0 == &amp;quot;clone&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                if (msg1 != &amp;quot;&amp;quot;)&lt;br /&gt;
                {&lt;br /&gt;
                    osOwnerSaveAppearance(msg1);&lt;br /&gt;
                    llOwnerSay(&amp;quot;Cloned your appearance to &amp;quot; + msg1);&lt;br /&gt;
                }&lt;br /&gt;
                else&lt;br /&gt;
                {&lt;br /&gt;
                    llOwnerSay(&amp;quot;Usage: clone &amp;lt;notecard-name-to-save&amp;gt;&amp;quot;);&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg0 == &amp;quot;stop&amp;quot; &amp;amp;&amp;amp; npc != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                osNpcStopMoveToTarget(npc);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg0 == &amp;quot;sit&amp;quot; &amp;amp;&amp;amp; msg1 != &amp;quot;&amp;quot; &amp;amp;&amp;amp; npc != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                osNpcSit(npc, msg1, OS_NPC_SIT_NOW);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg0 == &amp;quot;stand&amp;quot; &amp;amp;&amp;amp; npc != NULL_KEY)&lt;br /&gt;
            {&lt;br /&gt;
                osNpcStand(npc);&lt;br /&gt;
            }&lt;br /&gt;
            else if (msg0 == &amp;quot;help&amp;quot;)&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;Commands are:&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;create &amp;lt;notecard-name&amp;gt; - Create NPC from a stored notecard&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;createm&amp;quot;);       &lt;br /&gt;
                llOwnerSay(&amp;quot;remove - Remove current NPC&amp;quot;);     &lt;br /&gt;
                llOwnerSay(&amp;quot;clone &amp;lt;notecard-name&amp;gt; - Clone own appearance to a notecard&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;load &amp;lt;notecard-name&amp;gt;  - Load appearance on notecard to current npc&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;save &amp;lt;notecard-name&amp;gt;  - Save appearance of current NPC to notecard&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;animate&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;move&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;moveto &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; &amp;lt;z&amp;gt; - move to absolute position&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;movetarget&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;movetargetnoland&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;movetargetwalk&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;rot&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;say&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;sit &amp;lt;target-uuid&amp;gt;&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;stop&amp;quot;);&lt;br /&gt;
                llOwnerSay(&amp;quot;stand&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
            else&lt;br /&gt;
            {&lt;br /&gt;
                llOwnerSay(&amp;quot;I don't understand [&amp;quot; + msg + &amp;quot;]&amp;quot;);&lt;br /&gt;
            }&lt;br /&gt;
        }   &lt;br /&gt;
    }   &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Questions/Comments =&lt;br /&gt;
&lt;br /&gt;
Please leave your questions and comments on [[Talk:OSSLNPC|this article's talk page]].&lt;br /&gt;
&lt;br /&gt;
[[Category:OSSL Functions]]&lt;br /&gt;
[[Category:Scripting]]&lt;/div&gt;</summary>
		<author><name>Nihlaeth</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/wiki/OsMakeNotecard</id>
		<title>OsMakeNotecard</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/OsMakeNotecard"/>
				<updated>2011-09-12T00:40:15Z</updated>
		
		<summary type="html">&lt;p&gt;Nihlaeth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{osslfunc&lt;br /&gt;
|threat_level=High&lt;br /&gt;
|function_syntax=void osMakeNotecard(string notecardName, list contents)&lt;br /&gt;
|ossl_example=&amp;lt;source lang=&amp;quot;lsl&amp;quot;&amp;gt;&lt;br /&gt;
//&lt;br /&gt;
//osMakeNotecard example&lt;br /&gt;
//By Tom Earth&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    touch_start(integer n)&lt;br /&gt;
    {&lt;br /&gt;
        key id = llDetectedKey(0);&lt;br /&gt;
        string name = llKey2Name(id);&lt;br /&gt;
        list contents; //The variable we are going to use for the contents of the notecard.&lt;br /&gt;
        contents += [&amp;quot;Name: &amp;quot;+name+&amp;quot;\n&amp;quot;];&lt;br /&gt;
        contents += [&amp;quot;Key: &amp;quot;+(string)id+&amp;quot;\n&amp;quot;];&lt;br /&gt;
        contents += [&amp;quot;Pos: &amp;quot;+(string)llDetectedPos(0)+&amp;quot;\n&amp;quot;];&lt;br /&gt;
        contents += [&amp;quot;Rotation: &amp;quot;+(string)llDetectedRot(0)+&amp;quot;\n&amp;quot;];&lt;br /&gt;
        &lt;br /&gt;
        osMakeNotecard(name,contents); //Makes the notecard.&lt;br /&gt;
        &lt;br /&gt;
        llGiveInventory(id,name); //Gives the notecard to the person.&lt;br /&gt;
        llRemoveInventory(name);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|description=Creates a notecard with text in the prim that contains the script.&lt;br /&gt;
|&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Nihlaeth</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/wiki/Talk:OsMakeNotecard</id>
		<title>Talk:OsMakeNotecard</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/Talk:OsMakeNotecard"/>
				<updated>2011-09-12T00:39:08Z</updated>
		
		<summary type="html">&lt;p&gt;Nihlaeth: New page: In the function specification it states that osMakeNotecard takes a list as a second argument, but in the code example it takes a string. Testing revealed that it actually does expect a li...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;In the function specification it states that osMakeNotecard takes a list as a second argument, but in the code example it takes a string. Testing revealed that it actually does expect a list.&lt;br /&gt;
I corrected this in the example. ~Nihlaeth&lt;/div&gt;</summary>
		<author><name>Nihlaeth</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/wiki/OSSL_Proposals</id>
		<title>OSSL Proposals</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/OSSL_Proposals"/>
				<updated>2010-11-08T13:43:40Z</updated>
		
		<summary type="html">&lt;p&gt;Nihlaeth: /* OSSL Proposal Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Template:Quicklinks}}&lt;br /&gt;
&lt;br /&gt;
[[Technical Reference | Technical Reference]] -&amp;gt; [[Technical Reference/terms | Terms]] -&amp;gt; [[OSSL Status | OSSL Status]] -&amp;gt; [[OSSL_Proposals | OSSL Proposal List]] &lt;br /&gt;
&lt;br /&gt;
{{proposal}}&lt;br /&gt;
{{content}}&lt;br /&gt;
&lt;br /&gt;
=What is OSSL?=&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
This is a page dedicated to OpenSim's very own home brew custom scripting language Known as &amp;quot;'''O'''pen '''S'''im '''S'''cripting '''L'''anguage&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Please see [[OSSL_Standards|OSSL Standards]] for proposed naming schema'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Please post your osFunction along with a brief description of what it would be for, or do and an example of it. &lt;br /&gt;
* Make sure it begins with os NOT ll.&lt;br /&gt;
* And remember, almost anything within reason can be posted here as an idea, who knows, maybe a variation of your request can be possible.&lt;br /&gt;
* If a function could implemented in standard LSL, there is no reason to make an OS function. LSL code and function code executes at the same speed in OpenSim.&lt;br /&gt;
== OSSL Proposal Table ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;width:100%;border:1px solid #000000;border-collapse: collapse; white-space:normal;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF;font-size:6pt;font-weight:bold;border-bottom:1px solid;&amp;quot; align=&amp;quot;center&amp;quot; valign=&amp;quot;bottom&amp;quot;&lt;br /&gt;
| osFunction &lt;br /&gt;
| Description &lt;br /&gt;
| Example Usage &lt;br /&gt;
| Signed&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| list osGetRegionAgentKeys(); &lt;br /&gt;
| C# Code: &lt;br /&gt;
        public LSL_List osGetRegionAgentKeys()&lt;br /&gt;
       {&lt;br /&gt;
           CheckThreatLevel(ThreatLevel.None, &amp;quot;osGetRegionAgentKeys&amp;quot;);&lt;br /&gt;
           LSL_List result = new LSL_List();&lt;br /&gt;
           foreach (ScenePresence avatar in World.GetAvatars())&lt;br /&gt;
           {&lt;br /&gt;
               result.Add(avatar.UUID);&lt;br /&gt;
           }&lt;br /&gt;
           return result;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
Returns a list of keys for every agent in the region &lt;br /&gt;
&lt;br /&gt;
| list keys=osGetRegionAgentKeys(); &lt;br /&gt;
integer i; integer l=llGetListLength(keys); string names; for(i=0;i&amp;amp;lt;l;i++) { key id=llList2Key(keys,i); string add=llKey2Name(id); integer dist=llVecDist(llGetPos(),llList2Vector(llGetObjectDetails(id,[OBJECT_POS]),0))); add+=&amp;quot;[&amp;quot;+(string)dist+&amp;quot;]\n&amp;quot;; names+=add; } llSetText(names,&amp;amp;lt;1,1,1&amp;amp;gt;,1.0); &lt;br /&gt;
&lt;br /&gt;
| Joshua Driver&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| [NEW] various os functions including osDerezObject(), osMessageAgentAttachment(), ... &lt;br /&gt;
| see http://opensimulator.org/wiki/User:Athlon_Maurer for full source code &lt;br /&gt;
| tested on local opensimulator 0.6.9 (some of them doesnt seem to work on 0.7.x) &lt;br /&gt;
| Athlon Maurer&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| string osBin(string char); &lt;br /&gt;
| To convert a char into its binary value. Will only convert 1 char at a time. &lt;br /&gt;
| string bin_a = osBin(&amp;quot;A&amp;quot;); // bin_a = &amp;quot;01000001&amp;quot;; &lt;br /&gt;
| Athlon Maurer (please send me a notecard into secondlife, if that are too much ideas xD, this hint can be deleted by an opensimulator admin, if neccesary xD)&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| string osHex(integer number); &lt;br /&gt;
| To convert a number into its hexadecimal value. &lt;br /&gt;
| string str_ff = osHex(255); // str_ff = &amp;quot;FF&amp;quot;; &lt;br /&gt;
| Athlon Maurer&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osAsc(string char); &lt;br /&gt;
| To convert a char into its ascii index. Will only convert 1 char at a time. &lt;br /&gt;
| integer asc_a = osAsc(&amp;quot;A&amp;quot;); // asc_a = 65; &lt;br /&gt;
| Athlon Maurer&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osScanRegionRemove(); &lt;br /&gt;
| Remove an osScanRegionRepeat(). [ nearly the same as llSensorRemove() ] &lt;br /&gt;
| osScanRegionRemove(); &lt;br /&gt;
| Athlon Maurer&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osScanRegion(string name, key id, integer type); &lt;br /&gt;
| Scan the whole region where the script task object is in regardless where it is positioned. Triggers sensor() or no_sensor(). &lt;br /&gt;
| osScanRegion(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, AGENT); &lt;br /&gt;
| Athlon Maurer&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osScanRegionRepeat(string name, key id, integer type, float rate); &lt;br /&gt;
| Scan the whole region where the script task object is in regardless where it is positioned with rate. Triggers sensor() or no_sensor(). &lt;br /&gt;
| osScanRegionRepeat(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, AGENT, 15.0); &lt;br /&gt;
| Athlon Maurer&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| key osGetRegionMapTexture(string RegionName) &lt;br /&gt;
| return the map texture uuid for the region named by RegionName. &lt;br /&gt;
| llSetTexture(osGetRegionMapTexture(&amp;quot;OpenSim Test&amp;quot;), ALL_SIDES); &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
create a php file which is public&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;	// mapquery.php by Athlon Maurer (SL, OL, OS)&lt;br /&gt;
	//&lt;br /&gt;
	// hello, ive just started to learn php/mysql and this is one of my first&lt;br /&gt;
	// scripts for opensim. this script returns the texture uuid for a given&lt;br /&gt;
	// region by calling: mapquery.php?region=REGIONNAME&lt;br /&gt;
	// if a region has been found, it returns that regions map texture uuid, &lt;br /&gt;
	// otherwise it returns a null key uuid&lt;br /&gt;
	// mysql connection info is here, please make this more safe&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;	// region name (do not change this)&lt;br /&gt;
	$region = htmlspecialchars($_GET['region']);&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;	// default uuid (do not change this)&lt;br /&gt;
	$uuid = '00000000-0000-0000-0000-000000000000';&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;	// your mysql host name (change this)&lt;br /&gt;
	$dbhost = 'localhost';&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;	// your mysql user name (change this)&lt;br /&gt;
	$dbuser = 'root';&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;	// your mysql user password (change this)&lt;br /&gt;
	$dbpass = '';&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;	// your mysql opensim database (change this)&lt;br /&gt;
	$dbname = 'opensim';&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;	// try to connect&lt;br /&gt;
	if ($conn = mysql_connect($dbhost, $dbuser, $dbpass))&lt;br /&gt;
	{&lt;br /&gt;
		// try to select&lt;br /&gt;
		if ($select = mysql_select_db($dbname, $conn))&lt;br /&gt;
		{&lt;br /&gt;
			$sql = 'SELECT regionName, regionMapTexture FROM regions';&lt;br /&gt;
			$result = mysql_query($sql);&lt;br /&gt;
			while ($row = mysql_fetch_array($result, MYSQL_ASSOC))&lt;br /&gt;
			{&lt;br /&gt;
				if ($row['regionName'] == $region)&lt;br /&gt;
				{&lt;br /&gt;
					$uuid = $row['regionMapTexture'];&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			// free result&lt;br /&gt;
			mysql_free_result($result);&lt;br /&gt;
		}&lt;br /&gt;
		// close connection&lt;br /&gt;
		mysql_close($conn);&lt;br /&gt;
	}&lt;br /&gt;
	// output&lt;br /&gt;
	echo $uuid;&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;?&amp;gt;&lt;br /&gt;
then llHTTPRequest(&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
| Athlon Maurer (This function is available as of November 12, 2009)&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| list osGetLinkPrimitiveParams(integer link, list params); &lt;br /&gt;
| Function llSetLinkPrimitiveParams() does exist, but no chance to get params from a prim in a linkset, like llGetPrimitiveParams() and llSetPrimitiveParams(). &lt;br /&gt;
| list linkparams = osGetLinkPrimitiveParams([PRIM_TYPE, PRIM_TEXTURE, ...]); &lt;br /&gt;
| Athlon Maurer (This function is available as of August 09, 2009)&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osDerezObject(key object) &lt;br /&gt;
| Deletes an InWorld-Object specified by object as uuid. Only successful if the object the script is attached to and the object which should be derezzed is owned by the same owner&amp;amp;nbsp;:). Useful if the object to be deleted should be unscripted. &lt;br /&gt;
| osDerezObject(&amp;quot;key_of_object&amp;quot;); &lt;br /&gt;
| Athlon Maurer&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| int osRestartRegion() &lt;br /&gt;
| Restarts the region the script is currently in. The script this is run in has to be owned by the master avatar for that region. Returns 1 if the region is restarting, 0 on failure. &lt;br /&gt;
| osRestartRegion(); &lt;br /&gt;
| gryc (Implemented by AFrisby)&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| int osWebTexture() &lt;br /&gt;
| Sets the texture from a web-url &lt;br /&gt;
| osWebTexture(string url,integer maptype); &lt;br /&gt;
| AFrisby?&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osGroupAdd(key, string Role) &lt;br /&gt;
| Adds user to a group with given role, default role Everyone. Returns 1 if successful 0 if fail. &lt;br /&gt;
| osGroupAdd(87f6e6a0-d884-11dc-95ff-0800200c9a66, &amp;quot;Officer&amp;quot;) &lt;br /&gt;
| Nitrus Nori&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| int osShutdownRegion() &lt;br /&gt;
| Shuts down the region the script is currently in. The script this is run in has to be owned by the master avatar for that region. Returns 1 if the region is going down, 0 on failure. &lt;br /&gt;
| osShutdownRegion(); &lt;br /&gt;
| gryc&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osAttachmentSay(integer channel, string msg) &lt;br /&gt;
| Provide a secure, low lag method of communicating between attachments over the chat channels by only sending messages to objects attached to the same avatar. Would fail (or not be heard) if in a non-attached object. &lt;br /&gt;
| osAttachmentSay(-20, &amp;quot;detatch&amp;quot;); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osMessageSecure(string message_key, string str, integer num, key id);&amp;lt;br&amp;gt;secure_message(string message_key, string str, integer num, key id); &lt;br /&gt;
| Provide a method of sending secure, salt encripted messages sim wide. Messages would only be able to be received by scripts with the matching key in the secure_message method. &lt;br /&gt;
| osMessageSecure(&amp;quot;myPassPhrase&amp;quot;, &amp;quot;Hello World&amp;quot;, 0, NULL_KEY); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osSetText( vector color, string text [,vector color, string text]); &lt;br /&gt;
| Allow setting of multiple colors on the prim text &lt;br /&gt;
| osSetText(&amp;amp;lt;1,0,0&amp;amp;gt;,&amp;quot;Red&amp;quot;, &amp;amp;lt;0,1,0&amp;amp;gt;, &amp;quot;\nGreen&amp;quot;, &amp;amp;lt;0,0,1&amp;amp;gt;, &amp;quot;\nBlue&amp;quot;); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osSensor &lt;br /&gt;
| Gets ALL the objects in the specified range not just the first 16 &lt;br /&gt;
| (same as standard) &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| list lst=osDetectObjectsInSim(key id) &lt;br /&gt;
| given an Agent Key, provide a list of ALL object owned by that agent &lt;br /&gt;
| osDetectObjectsInSim(key id) returning a strided list of [ name, &amp;amp;lt;pos&amp;amp;gt; ] &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer=osDialog([ title, label1, type1, len1, label2, type2, len2].... &lt;br /&gt;
| given title and a listing of fields, builds up a real form where to put structured checked data &lt;br /&gt;
| will return a [ value1, value2, valuen ] corresponding to fields read. Type might be something like (string, text (multiline), integer, float, currency(decimals), options(combobox) &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| key id=osMakeTextureText(string name,integer width, integer height,[posx1,posy1,font1,color1,size1,text1,posx2,posy2,font2,color2,size2,text2....]) &lt;br /&gt;
| allow for producing a texture on the fly with desired Font content from a selected font selection. Width, Height in pixels 1024x512 to control how big will be the texture &lt;br /&gt;
| will generate a texture with defined text. (Allow some support for at least ISO-8859-1) texture will be created in the object inventory. posx, posy in the range 0-1 to be pixel independent &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osMakeNotecard(string name, [ line1, line2, line3, ...]) &lt;br /&gt;
| allow creation of new notecards in current object repository &lt;br /&gt;
| generate a new asset id useful for storing modified configuration &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer handler=osReadNotecardKey(string notecard, string key) &lt;br /&gt;
| allows reading notecards (through dataserver) in format key=value in convenient and efficient way &lt;br /&gt;
| ... &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osWriteNotecardKey(string notecard, string key,string value) &lt;br /&gt;
| allows WRITING notecards in format key=value in convenient and efficient way. Might be optimized having a fixed record length &amp;quot;file&amp;quot; so to avoid rewriting of the entire notecard &lt;br /&gt;
| ... &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer handle=osXMLParser(string xml) &lt;br /&gt;
| will activate a listener xmlparser(integer handler,string parent, string field, string value) &lt;br /&gt;
| to easily parse xml without writing php external code &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osReturnObjects(key owner, integer type); &lt;br /&gt;
| Provide a scriptable method of returning objects from a sim. type would be OBJECT_SCRIPTED, OBJECT_PASSIVE or OBJECT_ALL. Would return a binary Success/Fail, and work inline with land permissions for the script owner. &lt;br /&gt;
| osReturnObjects( target, OBJECT_ALL); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osReturnItem(key item); &lt;br /&gt;
| Provide a scriptable method of returning individual objects from a sim. Would return a binary Success/Fail, and work inline with land permissions for the script owner. &lt;br /&gt;
| osReturnItem(uuid); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osSetTimerEvent(integer timer, float rate); &amp;lt;br&amp;gt; (event) timer(integer timer_num) &lt;br /&gt;
| Support for multiple timers in a script. &lt;br /&gt;
| osSetTimerEvent(2, 0.5); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osTimerOnce(integer timer, float rate); &lt;br /&gt;
| Allow for a one shot timer event, rather than the normal repeating heartbeat type &lt;br /&gt;
| osTimerOnce(2, 10); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osVerifyScripts(); &lt;br /&gt;
| Check to see if all scripts in an object are created by the owner of the script calling the function. Return TRUE if they are, FALSE otherwise, to prevent insertion of alien scripts into an object &lt;br /&gt;
| if (!osVerifyScripts()) { llDie(); } &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osStopOtherAnimations(list animation_exceptions); &lt;br /&gt;
| Provide a method of stopping all animations on an avatar, except those defined in the list &lt;br /&gt;
| osStopOtherAnimations([&amp;quot;my_sitting_anim&amp;quot;]); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osPutScriptInLinkedSet(string name,integer linknum, integer starting_parm, integer running) &lt;br /&gt;
| Use this to propagate one script to ALL or part of linked set. &lt;br /&gt;
| Useful to have all objects in a linked set sharing a common behaviour &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osRezObject(string name, string description, integer permissionmask, list setPrimitiveObjectLikeList) will trigger the object_rez object as usual &lt;br /&gt;
| similar to llRezObject, but without the need of having a prim inside the inventory (which produced a lot of problems in deploying and in sl). Newly created object will have the same owner of current object where script is running. &lt;br /&gt;
| In case list is empty or position not specified, suitable defaults should apply like pos being 1 m higher in the z axis &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| string osGetOwnerName(); &lt;br /&gt;
| Provide a method of getting the owner name without having to use llKey2Name &lt;br /&gt;
| myName = osGetOwnerName(); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osXMPPOpen(string server, string username, string password, string resource); &lt;br /&gt;
| Open an XMPP session to a jabber or other XMPP server, returning a handle to be able to manipulate the connection. Incoming messages to be parsed through a xmpp_message(integer handle, string sender, string service, string message) event. Accounts would have to be set up manually by the scripter, or by some other method, to prevent scripted spamming of a server, and to allow users to set up gateways and other services if needed. &lt;br /&gt;
| handle = osXMPPOpen(&amp;quot;jabber.org&amp;quot;, &amp;quot;MyObject&amp;quot;, &amp;quot;MyPassword&amp;quot;, &amp;quot;OpenSim&amp;quot;); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| list osXMPPGetRosta(integer handle); &lt;br /&gt;
| Get the rosta from the XMPP server, list in the strided form of [username, presence, resource]; &lt;br /&gt;
| list presence = osXMPPGetRosta(handle); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| list osXMPPGetServices(integer handle); &lt;br /&gt;
| Get a list of available services from the XMPP Server. &lt;br /&gt;
| list services = osXMPPGetServices(handle); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osXMPPAdd(string username, string service) &lt;br /&gt;
| Add a username to the account rosta. Return boolean success or fail &lt;br /&gt;
| if (osXMPPAdd(&amp;quot;Test User&amp;quot;, &amp;quot;Yahoo&amp;quot;)) { ... } &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer oxXMPPDelete(string username) &lt;br /&gt;
| Remove a username from the account rosta. Return boolean success or fail &lt;br /&gt;
| if (osXMPPDelete(&amp;quot;Test User&amp;quot;)) { ... } &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osXMPPGetStatus(string username); &lt;br /&gt;
| Poll the server for the status of a specific username on the rosta - returns would be OFFLINE, BUSY, AWAY and ONLINE &lt;br /&gt;
| if (osXMPPGetStatus(&amp;quot;Test User&amp;quot;) &amp;amp;amp; ONLINE) { ... } &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osXMPPSendMessage(integer handle, string message, string target); &lt;br /&gt;
| Send a message via the open XMPP channel, to the specified target. Return boolean success values &lt;br /&gt;
| if (osXMPPSendMessage(handle, &amp;quot;Hello World&amp;quot;, osGetOwnerName()) { llOwnerSay(&amp;quot;Successfully sent message&amp;quot;); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osXMPPClose(integer handle); &lt;br /&gt;
| Close the XMPP session &lt;br /&gt;
| osXMPPClose(); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osRezObjectKey(key object,vector pos,vector vel,rotation rot, int param); &lt;br /&gt;
| Basically llGodLikeRezObject[http://lslwiki.net/lslwiki/wakka.php?wakka=llGodLikeRezObject] with the features of llRezObject[http://lslwiki.net/lslwiki/wakka.php?wakka=llRezObject] but for everyone to use. Calls object_rez. &lt;br /&gt;
| osRezObjectKey(object_key,llGetPos(),ZERO_VECTOR,llGetRot(),0); &lt;br /&gt;
| Tdub&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osRezFromURL(string url, vector pos, vector vel, rotation rot, integer param) - calls on_rez &lt;br /&gt;
| Fetch a fragment of xml from a web server and rez its contents in-world as in 'load-xml'. Off or intergrid object repositories, such as objects stored in SVN via websvn, CMS, etc. &lt;br /&gt;
| osRezFromURL(&amp;quot;http://my.objectstore.com/myawesomeprims.xml&amp;quot;, &amp;amp;lt;1, 1, 1&amp;amp;gt;, &amp;amp;lt;0, 0, 0&amp;amp;gt;, &amp;amp;lt;0, 0, 0&amp;amp;gt;, 0) &lt;br /&gt;
| Jimbo2120&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| list osRunCustom(string function, list params) &lt;br /&gt;
| Allow scripts to call external custom routines that are grid-specific without modifying the set of LSL and OSL functions. &lt;br /&gt;
| list results = osRunCustom(&amp;quot;function1&amp;quot;, [...]) &lt;br /&gt;
| Ezekiel&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osSetScriptServer() &lt;br /&gt;
| Create a 'Server' prim that allows for extended scripting capabilities: more memory, higher bandwidth when communicating with external servers, probably some database connectivity, no artificial delays, can receive IMs, etc. Could be limited to one server per prim / parcel or per avatar, could be forced to remain in a fixed position. A server is important for residents that want to set up a virtual business. &lt;br /&gt;
| osSetScriptServer() &lt;br /&gt;
| Ezekiel&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osRemoteLoadScript(string url, string target) &lt;br /&gt;
| Load a source file in txt format from &amp;quot;URL&amp;quot; and compile it into script &amp;quot;target&amp;quot; in the inventory of the same prim. Requires permission of the object owner (RequestPermission). Returns boolean success value. Replaces an existing script with same name. This function would allow updates to scripted solutions that operate in any grid and sim worldwide, allowing the creator of the solution to distribute code fixes and implement new functions. Since the source code is distributed openly, it can be copied and modified by anyone. A function that would allow for secure code distribution, protecting copyrights and certificates, would also be very interesting but should be far more difficult to implement. &lt;br /&gt;
| integer updatestatus = osRemoteLoadScript(&amp;quot;http://www.xyz.com/updates/script1013.txt&amp;quot;, &amp;quot;betterscript&amp;quot; ) &lt;br /&gt;
| Ezekiel&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osSetCustomPrimitiveAttributes(list params) &lt;br /&gt;
| Set some custom persistent primitive attributes, the same way as llSetPrimitiveParams do. The attribute name has to be specified as a string, then the attribute type using a lSL constant. In the example, we set a &amp;quot;magnet&amp;quot; custom attribute as -0.5, supposing a customized physic engine handles this attribute to provide prim attraction. &lt;br /&gt;
| integer osSetCustomPrimitiveAttributes([&amp;quot;magnet&amp;quot;, TYPE_FLOAT, -0.5]) &lt;br /&gt;
| Grumly&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| list osGetCustomPrimitiveAttributes(list paramNames) &lt;br /&gt;
| Return a list values of the specified attributes names, the same way as llGetPrimitiveParams do. &lt;br /&gt;
| list osGetCustomPrimitiveAttributes([&amp;quot;Magnetic&amp;quot;]) &lt;br /&gt;
| Grumly &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osSyncUUID(key oldUUID, key newUUID); &lt;br /&gt;
| Allows to change the UUID of an avatar or item(requires permission from owner). &lt;br /&gt;
| Suppose a terminal in the LL-grid wants to communicate with an OS-Grid terminal. It can only send messages, if the UUID's of avatars match. An OS-Grid script can get the avatar's LL-UUID by calling the dataserver script. Then it calls osSyncUUID(llDetectedKey(0), keyFromHTTPRequest); . Now the two keys are equal, and avatar-avatar communication between grids can take place! &lt;br /&gt;
| Phrearch &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osTeleport(string RegionName, int x, int y, int z); &lt;br /&gt;
| Teleports an avatar to a custom region &lt;br /&gt;
as&amp;amp;nbsp;: osTeleportAgent(key agentId, string regionName, vector position, vector lookAt); &lt;br /&gt;
&lt;br /&gt;
| (this is implemented now - edited April 2009 by Wordfromthe Wise) &lt;br /&gt;
| Phrearch&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osSetStatus(integer status, integer value); &lt;br /&gt;
| Improved verion of the LSL function llSetStatus. &lt;br /&gt;
| The function works basically the same way as llSetStatus, except that an extra flag is added named STATUS_PHYSICS_ROOT. When this flag is TRUE, physics would be enabled Only for the root prim in a linked set, while the other prims in the set would behave as phantom. This would be useful for bypassing the 32-prim physics limit for vehicles by using only the root prim as a collision mesh. &lt;br /&gt;
| Pesho&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| vector osGetBonePos(); &lt;br /&gt;
| When called from an Attachment, retrieves the position of the bone it is attached to, in Region Coordinates. &lt;br /&gt;
| When llGetPos() is called from an attachment, the vector returned is the one of the avatar center, whereas llGetLocalPos() returns the local offset from the bone it is attached to. It would be useful to know where the attachment's location really is in world space. &lt;br /&gt;
| Pesho&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| string osGetOSLLRelease(); &lt;br /&gt;
| When called return the actual release of OSSL running on the sim. &lt;br /&gt;
| if osGetOSSLRelease() &amp;amp;gt; 1.1 {llSay(0,&amp;quot;good&amp;quot;);} &lt;br /&gt;
| Sacha Magne&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| List osGetServerLib(); &lt;br /&gt;
| When called return a list of all the additional libraries loaded on the server. it will avoid any scripts using a specific library to crash in case of missing libs. &lt;br /&gt;
| List lib=osGetServerLib(); &lt;br /&gt;
| Sacha Magne&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osSetAttachmentPoint(integer attachment); &lt;br /&gt;
| When called from an Attachment sets the default attachment point to attachment value. &lt;br /&gt;
| osSetAttachmentPoint(ATTACH_HUD_BOTTOM_RIGHT); &lt;br /&gt;
| Peter&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| string osMySQLQuery(string query); &lt;br /&gt;
| Used to get informations out of a sql database. Works together with osMySQLConnect(), osMySQLSelectDatabase() and osMySQLClose(). &lt;br /&gt;
| osMySQLQuery(&amp;quot;Select name FROM user LIMIT 0,1;&amp;quot;); &lt;br /&gt;
| Peter&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| string osGetGridName(); &lt;br /&gt;
| When called it return the hostname of the grid server. Useful to find out what grid you are on. &lt;br /&gt;
| string gridHostname = osGetGridHostname(); &lt;br /&gt;
| Patnad&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| key osName2Key(string avatarname); &lt;br /&gt;
| When called it return the key associated with a Avatar Name. &lt;br /&gt;
| key avKey = osName2Key(&amp;quot;avatar name&amp;quot;); &lt;br /&gt;
| Patnad&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| vector osParcelCenterpoint(vector pos); &lt;br /&gt;
| When called it return the vector that represent the center point of the current parcel. Same height as the object running the script but centerpoint for x,y. &lt;br /&gt;
| vector parcel_center = osParcelCenterpoint(llGetPos()); &lt;br /&gt;
| Patnad&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osSetMapDestination(integer mode, string simname, vector position, vector lookat); &lt;br /&gt;
| Sets a new &amp;quot;beacon&amp;quot; (red pole) without opening the worldmap: mode is for 1 (simname is a standard region name) or 0 (simname is a SLURL). If the code can handle standard sim names and SLURL(s) at the same time, the &amp;quot;mode&amp;quot; flag can be left behind. &lt;br /&gt;
| integer error = osSetMapDestination(TRUE, &amp;quot;cyberlandia&amp;quot;, &amp;amp;lt;128.0, 128.0, 0.0&amp;amp;gt;, ZERO_VECTOR); &lt;br /&gt;
&amp;amp;nbsp;If error is FALSE then no errors have occurred setting up the new beacon. &amp;amp;nbsp;Errors can arise using unknown simnames/SLURL(s), out of ranges vector coords and so on (nearly the same as llSetMapDestination). &lt;br /&gt;
&lt;br /&gt;
| Elwe Ewing&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osTeleportAgentPerm(key agentId, string regionName, vector position, vector lookAt); &lt;br /&gt;
osTeleportAgentPerm(key agentId, vector position, vector lookAt); &lt;br /&gt;
&lt;br /&gt;
| Works similarly as the two implemented osTeleportAgent but requires (at least the first time) the PERMISSION_TELEPORT flag set (via llRequestPermissions(key id, PERMISSION_TELEPORT); which should be implemented) and can be used by everyone (or restricted to a member of the group wich the region is deed, maybe with a new &amp;quot;Restrict teleports&amp;quot; Estate flag). &lt;br /&gt;
| &lt;br /&gt;
 // requests permission to Teleport then do it&lt;br /&gt;
 &lt;br /&gt;
 key  avie = NULL_KEY;&lt;br /&gt;
 &lt;br /&gt;
 default&lt;br /&gt;
 {&lt;br /&gt;
   state_entry()&lt;br /&gt;
   {&lt;br /&gt;
       llSay(0, &amp;quot;Touch to be teleported&amp;quot;);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   run_time_permissions(integer vBitPermissions)&lt;br /&gt;
   {&lt;br /&gt;
       if(PERMISSION_TELEPORT &amp;amp;amp; vBitPermissions){&lt;br /&gt;
           osTeleportAgentPerm(avie, &amp;amp;lt;128.0,128.0,0.0&amp;amp;gt;,&lt;br /&gt;
 ZERO_VECTOR);&lt;br /&gt;
       } else {&lt;br /&gt;
           llSay(0, &amp;quot;You deny teleport permission&amp;quot;);&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   touch_start(integer num_detected)&lt;br /&gt;
   {&lt;br /&gt;
       avie = llDetectedKey(0);&lt;br /&gt;
 &lt;br /&gt;
       llRequestPermissions(avie,&lt;br /&gt;
           PERMISSION_TELEPORT &amp;amp;#124;&lt;br /&gt;
           PERMISSION_TRIGGER_ANIMATION &amp;amp;#124;&lt;br /&gt;
           0);&lt;br /&gt;
       integer perm = llGetPermissions();&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
| Elwe Ewing&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osGetSimulatorStatus(string Simulator) &lt;br /&gt;
| Extended / Enhanced version of llGetSimulatorData. &lt;br /&gt;
Purpose: When an avatar is Teleported with osTeleportAgent, there is no check to see if a given simulator is available. If it's down, Agent is Teleported to NULL resulting in Agent being fragged and viewer broken, requiring a relog. This would be especially useful for HyperGrid Teleporting. Returns: integer &amp;quot;0 = DOWN&amp;quot;, &amp;quot;1 = UP&amp;quot;, &amp;quot;2 = UNKNOWN&amp;quot; Security: Would require some form of Throttle to prevent recurring requests of destination Simulator. Command: osGetSimulatorStatus(string Simulator) Where Simulator = &amp;quot;RegionName&amp;quot;, &amp;quot;IPAddress:PortNum&amp;quot;, &amp;quot;HostName:PortNum&amp;quot; &lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
 // CHecks if simulator is online before teleporting agent -kizmut&lt;br /&gt;
 &lt;br /&gt;
 string destination = &amp;quot;Wright Plaza&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 default&lt;br /&gt;
 {&lt;br /&gt;
   state_entry()&lt;br /&gt;
   {&lt;br /&gt;
       llSay(0, &amp;quot;Touch to be teleported to: &amp;quot;+destination);&lt;br /&gt;
   }&lt;br /&gt;
   touch_start(integer num_detected)&lt;br /&gt;
   {&lt;br /&gt;
       llSay(0,llDetectedName(0)+&amp;quot; requesting teleport to: &amp;quot;+destination);&lt;br /&gt;
       integer sim_stat = osGetSimulatorStatus(destination);&lt;br /&gt;
       if (sim_stat == 2) {&lt;br /&gt;
           llSay(0, &amp;quot;Could not teleport to &amp;quot;+destination+&amp;quot;: Region status unknown.&amp;quot;);&lt;br /&gt;
       } &lt;br /&gt;
       else if (sim_stat) {&lt;br /&gt;
           osTeleportAgent(llDetectedKey(0),destination,ZERO_VECTOR);&lt;br /&gt;
       }&lt;br /&gt;
       else {&lt;br /&gt;
           llSay(0, &amp;quot;Could not teleport to &amp;quot;+destination+&amp;quot;: Region is down&amp;quot;);&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
| WhiteStar Magic&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osTeleportOwner(string regionName, vector position, vector lookAt); &lt;br /&gt;
| Works similarly as osTeleportAgent but could only teleport the owner of the script itself. Would be very useful for HUD and would not require any authorization. &lt;br /&gt;
| integer error=osTeleportOwner(&amp;quot;Snoopies&amp;quot;,&amp;amp;lt;100,25,25&amp;amp;gt;,ZERO_VECTOR); &lt;br /&gt;
| Agnes Chalet &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| string osName2Key(string name); &lt;br /&gt;
| A command which gives the UUID of an agent. Would work in the same way as llKey2Name, but in reverse. (Linden Lab may implement this first) &lt;br /&gt;
| osName2Key(&amp;quot;Bob Smith&amp;quot;); &lt;br /&gt;
| Drava&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osHyperGrid(); &lt;br /&gt;
| Detects whether or not the region the person is in is Hypergrid enabled. Could be expanded to any region in the current grid. &lt;br /&gt;
| osHyperGrid() == TRUE &lt;br /&gt;
| Drava&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osTurnAvatar(rotation rot); &lt;br /&gt;
| Turns an avatar about the vertical axis to rotation rot relative to the grid rotation. &lt;br /&gt;
| osTurnAvatar(newrot); // turns the avatar to the new rotation specified by newrot. &lt;br /&gt;
| Valradica&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osRezLink(string inventory, vector position, vector velocity, rotation rot, integer param) ;&lt;br /&gt;
| osRezLink would work just like llRezObject but instead of a separate object it would be directly part of the original object's link system. This would be very useful in HUDs and attachments.&lt;br /&gt;
| osRezLink(&amp;quot;myobject&amp;quot;,llGetPos()+&amp;lt;0.0,0.0,0.5&amp;gt;,ZERO_VECTOR,ZERO_ROTATION,10);&lt;br /&gt;
| Nihlaeth&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osSaveObject();&lt;br /&gt;
| osSaveObject would be used in attachments and HUDs to save changes made while the object was worn.&lt;br /&gt;
| osSaveObject();&lt;br /&gt;
| Nihlaeth&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[LSL Status|LSL/OSSL Status Page]]&lt;br /&gt;
* LSL&lt;br /&gt;
** [[LSL Status/Types|LSL Types Status Page]]&lt;br /&gt;
** [[LSL Status/Events|LSL Events Status Page]]&lt;br /&gt;
** [[LSL Status/Functions|LSL Functions Status Page]]&lt;br /&gt;
** [[LSL_Status/functions/summary | LSL Functions Status Summary]]&lt;br /&gt;
** [[LSL_Known_Issues| LSL Known Issues]]&lt;br /&gt;
** [[Kan-Ed_Tests| Kan-Ed Tests]]&lt;br /&gt;
* OSSL&lt;br /&gt;
** [[OSSL Status/Types |OSSL Types Status Page]]&lt;br /&gt;
** [[OSSL Status/Events |OSSL Events Status Page]]&lt;br /&gt;
** [[OSSL_Proposals | OSSL Proposed Functions]]&lt;br /&gt;
** [[OSSL_Implemented | OSSL Implemented Functions]]&lt;br /&gt;
** [[OSSL_Standards | OSSL Standards]]&lt;br /&gt;
* [[Technical_Reference|Technical Reference Page]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Main]]&lt;br /&gt;
[[Category:Users]]&lt;br /&gt;
[[Category:Support]]&lt;br /&gt;
[[Category:Tech Reference]] &lt;br /&gt;
[[Category:Help]]&lt;br /&gt;
[[Category:Configuration]]&lt;br /&gt;
[[Category:Getting_Started]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Todo]]&lt;/div&gt;</summary>
		<author><name>Nihlaeth</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/wiki/Performance</id>
		<title>Performance</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/Performance"/>
				<updated>2010-10-26T22:46:10Z</updated>
		
		<summary type="html">&lt;p&gt;Nihlaeth: /* Hardware Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Quicklinks}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
OpenSim performance is a very complex issue.  Performance can be affected by any number of things, including the number of prims on a region, number of regions, number of avatars, network quality between server and viewer, network quality between simulator and grid services, etc.&lt;br /&gt;
&lt;br /&gt;
==Hardware Requirements==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, this is a very difficult question in light of all the factors mentioned above.  Below are some examples of hardware people use/have used.  Please feel free to add to the list, or to add any reports to the performance studies and blog posts section.  '''These are examples to help you in your selection, not necessarily recommendations.'''&lt;br /&gt;
&lt;br /&gt;
Object Parts ~= # prim&lt;br /&gt;
&lt;br /&gt;
Sensors and Timers are generally more intensive then regular scripts, so please specify quantity of each.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Description&lt;br /&gt;
!Operating System (please add Mono version if appropriate)&lt;br /&gt;
!OpenSim version&lt;br /&gt;
!RAM/AVG_USE_%&lt;br /&gt;
!CPU&lt;br /&gt;
!#/type of regions&lt;br /&gt;
!# simultaneous avs&lt;br /&gt;
!#scripts/timers/Sensors&lt;br /&gt;
!Location&lt;br /&gt;
!#objectparts&lt;br /&gt;
|-&lt;br /&gt;
|hosted Xen VPS&lt;br /&gt;
|Ubuntu Intrepid (8.10)&lt;br /&gt;
|Unknown&lt;br /&gt;
|540MB/?&lt;br /&gt;
|1x quad-core 2.5GHz Xeon (L5420)&lt;br /&gt;
|1 region + 9 voids&lt;br /&gt;
|generally 1-2&lt;br /&gt;
|few&lt;br /&gt;
|Knifejaw Atoll &amp;amp; surrounding on OSGrid&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|hosted Xen VPS&lt;br /&gt;
|Ubuntu Jaunty (9.04)&lt;br /&gt;
|Unknown&lt;br /&gt;
|360MB/?&lt;br /&gt;
|2x dual-core 2.0GHz Xeon (5130)&lt;br /&gt;
|1 void&lt;br /&gt;
|generally 1-2 &lt;br /&gt;
|none&lt;br /&gt;
|Knifejaw Road on OSGrid&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|Dedicated Server from A+&lt;br /&gt;
|Windows Server 2003&lt;br /&gt;
|Unknown&lt;br /&gt;
|1 Meg&lt;br /&gt;
|1x single-core 2.8GHz Celeron&lt;br /&gt;
|2regions per server&lt;br /&gt;
|6 at once with no issues&lt;br /&gt;
|Waterfalls, texture anims, window texture switchers, lots of sound loops&lt;br /&gt;
|Pleasure Planet Welcome center &amp;amp; Region Pleasure Planet in OSGrid&lt;br /&gt;
|20000 prims per region&lt;br /&gt;
|-&lt;br /&gt;
|Amazon EC2 &amp;quot;high-CPU medium instance&amp;quot; (Xen VM)&lt;br /&gt;
|Windows Server 2003&lt;br /&gt;
|Unknown&lt;br /&gt;
|1.7GB&lt;br /&gt;
|1x dual-core 2.3GHz (Intel E5345)&lt;br /&gt;
|1 region with sailing race course&lt;br /&gt;
|7 avs, 4 in boats&lt;br /&gt;
|scripted start line&lt;br /&gt;
|Castle Rock, OSGrid&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Dedicated Server from simhost.com&lt;br /&gt;
|SuSe 11.2 x64&lt;br /&gt;
|Unknown&lt;br /&gt;
|8gb / 50%&lt;br /&gt;
|4x Core2Quad Q9300 2.6ghz&lt;br /&gt;
|1 region (Wright Plaza) uses approx 4gb ram&lt;br /&gt;
|20-25 users&lt;br /&gt;
|Freebie Stores / Meeting Center / Video Theater&lt;br /&gt;
|@osgrid.org Heavy Use Sim&lt;br /&gt;
|17500 prims aprox 1500 scripts&lt;br /&gt;
|-&lt;br /&gt;
|Home machine&lt;br /&gt;
|Windows XP SP3&lt;br /&gt;
|0.7.0.1 (Diva r13558)&lt;br /&gt;
|3GB / 15-40% incl. Opensim and MySQL&lt;br /&gt;
|4x Core2Quad Q6600 2.4 GHz. Use: generally, 0-10%&lt;br /&gt;
|11 regions&lt;br /&gt;
|1-6 users&lt;br /&gt;
|Many scripted objects (1934 scripts)&lt;br /&gt;
|[http://zonjacapalini.wordpress.com/2010/08/25/condensation-land-a-status-report/ Condensation Land]&lt;br /&gt;
|38,065 prims&lt;br /&gt;
|-&lt;br /&gt;
|Home machine&lt;br /&gt;
|Ubuntu Lucid 10.04 (32 bit pae)&lt;br /&gt;
|0.7.0.1 (Diva r13558)&lt;br /&gt;
|160Mb no users, add 5Mb/user incl Opensim and MySQL&lt;br /&gt;
|I7-920 (dual threaded quad core), 3.8Ghz, 6Gb RAM, 0-10% Load&lt;br /&gt;
|4 regions (Diva default config)&lt;br /&gt;
|1-4 users (approx 20Kb/sec bandwidth/user)&lt;br /&gt;
|Few scripted objects (&amp;lt;10)&lt;br /&gt;
|[http://mars-simulator.hobby-site.org:9000/wifi Mars Simulation]- Based on [http://metatek.blogspot.com/2010/06/mars-simulation-for-distribution.html Erik Nauman's Open Blackboard]&lt;br /&gt;
|158 prims&lt;br /&gt;
|-&lt;br /&gt;
|Parallels Virtuozzo Container 4.5&lt;br /&gt;
|Win/Net (32 run)&lt;br /&gt;
|0.7 (D2)&lt;br /&gt;
|320Mb total, incl Opensim and MySQL&lt;br /&gt;
|Q6600 Quad, 2.8Ghz, 2Gb RAM, 0-2% Avg Load&lt;br /&gt;
|9 regions (3x3 mega-region)&lt;br /&gt;
|&amp;lt;6 users&lt;br /&gt;
|vehicle scripted objects (&amp;lt;5)&lt;br /&gt;
|[http://metaversesailing.com:9000/wifi Metaverse Sailing]&lt;br /&gt;
|&amp;lt;1000 prims&lt;br /&gt;
|-&lt;br /&gt;
|VPS&lt;br /&gt;
|Debian Lenny 5 (mono 2.4.2.3)&lt;br /&gt;
|OSgrid 0.7.1 (Dev) cd4d7a7: 2010-10-15&lt;br /&gt;
|655MB average out of 1722MB RAM, incl. MySQL&lt;br /&gt;
|Intel Quadcore 2.5 Ghz (1 core assigned to vps) average use: 40-45% &lt;br /&gt;
|20 regions&lt;br /&gt;
|&amp;lt;4 users&lt;br /&gt;
|about 20 different light scripts, but we're also experimenting with heavier HUD scripts (timers, lots of ll(Get/Set)PrimitiveParams and large lists) and custom IRC relay&lt;br /&gt;
|Phoenix Rising Isles on OsGrid&lt;br /&gt;
|3727 prims&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Performance studies and blog posts==&lt;br /&gt;
&lt;br /&gt;
These provide some interesting data on the performance limitations of OpenSim at various points in time.&lt;br /&gt;
&lt;br /&gt;
* [https://lists.berlios.de/pipermail/opensim-users/2010-August/005189.html https://lists.berlios.de/pipermail/opensim-users/2010-August/005189.html] - Some interesting information from Mr Blue.  Physical objects and max avatars are limited by single thread performance in OpenSim.&lt;br /&gt;
* [http://www.sciencesim.com/wiki/doku.php/vwperf/start http://www.sciencesim.com/wiki/doku.php/vwperf/start] - Links to ScienceSim performance studies, including some very recent ones.&lt;br /&gt;
* [[Improving Performance]] - An old page from July 2009 detailing some performance issues on OpenSim.  Some of these issues are still valid (e.g. ODE issues).&lt;br /&gt;
* [[NHibernate Performance Testing]] &amp;amp;mdash; SQLite and MySQL performance tests with NHibernate.&lt;br /&gt;
* [[LibSecondLife performance problems]] - Another old page from November 2007 detailing issues with libsecondlife (now called libopenmetaverse).&lt;br /&gt;
* [http://opensim.cybertechnews.org/?p=71 Experiences from Operating a 3D Region Server in OSGrid - Part 1]&lt;br /&gt;
* [http://opensim.cybertechnews.org/?p=104 Experiences from Operating a 3D Region Server in OSGrid - Part 2]&lt;br /&gt;
&lt;br /&gt;
==Performance hints==&lt;br /&gt;
&lt;br /&gt;
Here are some specific things you might be able to do to improve performance&lt;br /&gt;
&lt;br /&gt;
===Home Based systems===&lt;br /&gt;
&lt;br /&gt;
The most obvious performance difference between a home based cable/dsl system and a &amp;quot;commercial&amp;quot; server is the upload bandwidth. A typical home system allows 100Kb/s upload with 12Mb/s download, a &amp;quot;commercial&amp;quot; system typically has a &amp;quot;symmetrical&amp;quot; bandwidth of say 12Mb/s UP AND DOWN! &amp;quot;Commercial&amp;quot; systems can essentially buy unlimited bandwidth as needed, but it does get expensive to buy bandwidth that you don't need!&lt;br /&gt;
&lt;br /&gt;
In practice this limits the number of &amp;quot;external&amp;quot; users on a &amp;quot;home system&amp;quot; to 4 or 5, but LAN users (NPCs/bots etc.) are essentially unlimited.&lt;br /&gt;
&lt;br /&gt;
A reasonable strategy (i.e. MY strategy) is to use the home system for experimentation and then move the entire sim to a &amp;quot;commercial&amp;quot; VPS service if the sim gets popular (and produces enough $$$ to pay the freight!) &lt;br /&gt;
&lt;br /&gt;
===Running Squid on your region server as a reverse proxy to the asset server===&lt;br /&gt;
1. Download and install the Squid Proxy from: http://www.squid-cache.org/Download/&amp;lt;br&amp;gt;&lt;br /&gt;
2. Create your [[squid.conf]] configuration file.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Change your asset_server configuration in your OpenSim.ini to point to http://localhost:3128/&amp;lt;br&amp;gt;&lt;br /&gt;
4. Start everything up!&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now assets will be cached in the squid cache on the region server, and will be served up much faster, especially on region restart.&lt;br /&gt;
&lt;br /&gt;
=== GC_NO_EXPLICIT ===&lt;br /&gt;
&lt;br /&gt;
Sometimes this patch applied to mono-svn has helped my sim run a lot faster and not slowly get bogged down.&lt;br /&gt;
&lt;br /&gt;
$mono-svn-root$/mono&lt;br /&gt;
  mono/metadata/boehm-gc.c&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Index: boehm-gc.c&lt;br /&gt;
===================================================================&lt;br /&gt;
--- boehm-gc.c	(revision 105684)&lt;br /&gt;
+++ boehm-gc.c	(working copy)&lt;br /&gt;
@@ -107,6 +107,10 @@&lt;br /&gt;
 void&lt;br /&gt;
 mono_gc_collect (int generation)&lt;br /&gt;
 {&lt;br /&gt;
+	static int no_explicite_gc = 0; if (no_explicite_gc==0) {if (getenv(&amp;quot;GC_NO_EXPLICIT&amp;quot;)) {no_explicite_gc = 1;return;} else {no_explicite_gc = 2;}} else if (no_explicite_gc==1) {&lt;br /&gt;
+		g_print(&amp;quot;\n --------GC_NO_EXPLICIT \n&amp;quot;);&lt;br /&gt;
+		return;&lt;br /&gt;
+		}&lt;br /&gt;
 	MONO_PROBE_GC_BEGIN (generation);&lt;br /&gt;
 	&lt;br /&gt;
 	GC_gcollect ();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Not only this, but I recompile the mono runtime:&lt;br /&gt;
&amp;lt;pre&amp;gt;--with-large-heap=yes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Otherwise, the Sim is limited to 3GB RAM.  Probably, this second peice is more important.  But still, afterwards it's worth a shot to test with both to see if there is a difference in performance:&lt;br /&gt;
&lt;br /&gt;
 export GC_NO_EXPLICIT=1&lt;br /&gt;
and&lt;br /&gt;
 unset GC_NO_EXPLICIT&lt;br /&gt;
&lt;br /&gt;
What I think, (only a guess) is that Mono starts internally GC thrashing in fishing expeditions to gaining maybe 1k of RAM at time. And by having a large heap (&amp;gt;3GB), it is possible might keep mono less apt to do stop world complete collections as often.&lt;/div&gt;</summary>
		<author><name>Nihlaeth</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/wiki/Performance</id>
		<title>Performance</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/Performance"/>
				<updated>2010-10-26T22:44:11Z</updated>
		
		<summary type="html">&lt;p&gt;Nihlaeth: /* Hardware Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Quicklinks}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
OpenSim performance is a very complex issue.  Performance can be affected by any number of things, including the number of prims on a region, number of regions, number of avatars, network quality between server and viewer, network quality between simulator and grid services, etc.&lt;br /&gt;
&lt;br /&gt;
==Hardware Requirements==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, this is a very difficult question in light of all the factors mentioned above.  Below are some examples of hardware people use/have used.  Please feel free to add to the list, or to add any reports to the performance studies and blog posts section.  '''These are examples to help you in your selection, not necessarily recommendations.'''&lt;br /&gt;
&lt;br /&gt;
Object Parts ~= # prim&lt;br /&gt;
&lt;br /&gt;
Sensors and Timers are generally more intensive then regular scripts, so please specify quantity of each.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Description&lt;br /&gt;
!Operating System (please add Mono version if appropriate)&lt;br /&gt;
!OpenSim version&lt;br /&gt;
!RAM/AVG_USE_%&lt;br /&gt;
!CPU&lt;br /&gt;
!#/type of regions&lt;br /&gt;
!# simultaneous avs&lt;br /&gt;
!#scripts/timers/Sensors&lt;br /&gt;
!Location&lt;br /&gt;
!#objectparts&lt;br /&gt;
|-&lt;br /&gt;
|hosted Xen VPS&lt;br /&gt;
|Ubuntu Intrepid (8.10)&lt;br /&gt;
|Unknown&lt;br /&gt;
|540MB/?&lt;br /&gt;
|1x quad-core 2.5GHz Xeon (L5420)&lt;br /&gt;
|1 region + 9 voids&lt;br /&gt;
|generally 1-2&lt;br /&gt;
|few&lt;br /&gt;
|Knifejaw Atoll &amp;amp; surrounding on OSGrid&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|hosted Xen VPS&lt;br /&gt;
|Ubuntu Jaunty (9.04)&lt;br /&gt;
|Unknown&lt;br /&gt;
|360MB/?&lt;br /&gt;
|2x dual-core 2.0GHz Xeon (5130)&lt;br /&gt;
|1 void&lt;br /&gt;
|generally 1-2 &lt;br /&gt;
|none&lt;br /&gt;
|Knifejaw Road on OSGrid&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|Dedicated Server from A+&lt;br /&gt;
|Windows Server 2003&lt;br /&gt;
|Unknown&lt;br /&gt;
|1 Meg&lt;br /&gt;
|1x single-core 2.8GHz Celeron&lt;br /&gt;
|2regions per server&lt;br /&gt;
|6 at once with no issues&lt;br /&gt;
|Waterfalls, texture anims, window texture switchers, lots of sound loops&lt;br /&gt;
|Pleasure Planet Welcome center &amp;amp; Region Pleasure Planet in OSGrid&lt;br /&gt;
|20000 prims per region&lt;br /&gt;
|-&lt;br /&gt;
|Amazon EC2 &amp;quot;high-CPU medium instance&amp;quot; (Xen VM)&lt;br /&gt;
|Windows Server 2003&lt;br /&gt;
|Unknown&lt;br /&gt;
|1.7GB&lt;br /&gt;
|1x dual-core 2.3GHz (Intel E5345)&lt;br /&gt;
|1 region with sailing race course&lt;br /&gt;
|7 avs, 4 in boats&lt;br /&gt;
|scripted start line&lt;br /&gt;
|Castle Rock, OSGrid&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Dedicated Server from simhost.com&lt;br /&gt;
|SuSe 11.2 x64&lt;br /&gt;
|Unknown&lt;br /&gt;
|8gb / 50%&lt;br /&gt;
|4x Core2Quad Q9300 2.6ghz&lt;br /&gt;
|1 region (Wright Plaza) uses approx 4gb ram&lt;br /&gt;
|20-25 users&lt;br /&gt;
|Freebie Stores / Meeting Center / Video Theater&lt;br /&gt;
|@osgrid.org Heavy Use Sim&lt;br /&gt;
|17500 prims aprox 1500 scripts&lt;br /&gt;
|-&lt;br /&gt;
|Home machine&lt;br /&gt;
|Windows XP SP3&lt;br /&gt;
|0.7.0.1 (Diva r13558)&lt;br /&gt;
|3GB / 15-40% incl. Opensim and MySQL&lt;br /&gt;
|4x Core2Quad Q6600 2.4 GHz. Use: generally, 0-10%&lt;br /&gt;
|11 regions&lt;br /&gt;
|1-6 users&lt;br /&gt;
|Many scripted objects (1934 scripts)&lt;br /&gt;
|[http://zonjacapalini.wordpress.com/2010/08/25/condensation-land-a-status-report/ Condensation Land]&lt;br /&gt;
|38,065 prims&lt;br /&gt;
|-&lt;br /&gt;
|Home machine&lt;br /&gt;
|Ubuntu Lucid 10.04 (32 bit pae)&lt;br /&gt;
|0.7.0.1 (Diva r13558)&lt;br /&gt;
|160Mb no users, add 5Mb/user incl Opensim and MySQL&lt;br /&gt;
|I7-920 (dual threaded quad core), 3.8Ghz, 6Gb RAM, 0-10% Load&lt;br /&gt;
|4 regions (Diva default config)&lt;br /&gt;
|1-4 users (approx 20Kb/sec bandwidth/user)&lt;br /&gt;
|Few scripted objects (&amp;lt;10)&lt;br /&gt;
|[http://mars-simulator.hobby-site.org:9000/wifi Mars Simulation]- Based on [http://metatek.blogspot.com/2010/06/mars-simulation-for-distribution.html Erik Nauman's Open Blackboard]&lt;br /&gt;
|158 prims&lt;br /&gt;
|-&lt;br /&gt;
|Parallels Virtuozzo Container 4.5&lt;br /&gt;
|Win/Net (32 run)&lt;br /&gt;
|0.7 (D2)&lt;br /&gt;
|320Mb total, incl Opensim and MySQL&lt;br /&gt;
|Q6600 Quad, 2.8Ghz, 2Gb RAM, 0-2% Avg Load&lt;br /&gt;
|9 regions (3x3 mega-region)&lt;br /&gt;
|&amp;lt;6 users&lt;br /&gt;
|vehicle scripted objects (&amp;lt;5)&lt;br /&gt;
|[http://metaversesailing.com:9000/wifi Metaverse Sailing]&lt;br /&gt;
|&amp;lt;1000 prims&lt;br /&gt;
|-&lt;br /&gt;
|VPS&lt;br /&gt;
|Debian Lenny 5 (mono 2.4.2.3)&lt;br /&gt;
|OSgrid 0.7.1 (Dev) cd4d7a7: 2010-10-15&lt;br /&gt;
|655MB average out of 1722MB RAM, incl. MySQL&lt;br /&gt;
|Intel Quadcore 2.5 Ghz (1 core assigned to vps) average use: 40-45% &lt;br /&gt;
|20 regions (4x5 mega-region)&lt;br /&gt;
|&amp;lt;4 users&lt;br /&gt;
|about 20 different light scripts, but we're also experimenting with heavier HUD scripts (timers, lots of ll(Get/Set)PrimitiveParams and large lists) and custom IRC relay&lt;br /&gt;
|Phoenix Rising Isles on OsGrid&lt;br /&gt;
|3727 prims&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Performance studies and blog posts==&lt;br /&gt;
&lt;br /&gt;
These provide some interesting data on the performance limitations of OpenSim at various points in time.&lt;br /&gt;
&lt;br /&gt;
* [https://lists.berlios.de/pipermail/opensim-users/2010-August/005189.html https://lists.berlios.de/pipermail/opensim-users/2010-August/005189.html] - Some interesting information from Mr Blue.  Physical objects and max avatars are limited by single thread performance in OpenSim.&lt;br /&gt;
* [http://www.sciencesim.com/wiki/doku.php/vwperf/start http://www.sciencesim.com/wiki/doku.php/vwperf/start] - Links to ScienceSim performance studies, including some very recent ones.&lt;br /&gt;
* [[Improving Performance]] - An old page from July 2009 detailing some performance issues on OpenSim.  Some of these issues are still valid (e.g. ODE issues).&lt;br /&gt;
* [[NHibernate Performance Testing]] &amp;amp;mdash; SQLite and MySQL performance tests with NHibernate.&lt;br /&gt;
* [[LibSecondLife performance problems]] - Another old page from November 2007 detailing issues with libsecondlife (now called libopenmetaverse).&lt;br /&gt;
* [http://opensim.cybertechnews.org/?p=71 Experiences from Operating a 3D Region Server in OSGrid - Part 1]&lt;br /&gt;
* [http://opensim.cybertechnews.org/?p=104 Experiences from Operating a 3D Region Server in OSGrid - Part 2]&lt;br /&gt;
&lt;br /&gt;
==Performance hints==&lt;br /&gt;
&lt;br /&gt;
Here are some specific things you might be able to do to improve performance&lt;br /&gt;
&lt;br /&gt;
===Home Based systems===&lt;br /&gt;
&lt;br /&gt;
The most obvious performance difference between a home based cable/dsl system and a &amp;quot;commercial&amp;quot; server is the upload bandwidth. A typical home system allows 100Kb/s upload with 12Mb/s download, a &amp;quot;commercial&amp;quot; system typically has a &amp;quot;symmetrical&amp;quot; bandwidth of say 12Mb/s UP AND DOWN! &amp;quot;Commercial&amp;quot; systems can essentially buy unlimited bandwidth as needed, but it does get expensive to buy bandwidth that you don't need!&lt;br /&gt;
&lt;br /&gt;
In practice this limits the number of &amp;quot;external&amp;quot; users on a &amp;quot;home system&amp;quot; to 4 or 5, but LAN users (NPCs/bots etc.) are essentially unlimited.&lt;br /&gt;
&lt;br /&gt;
A reasonable strategy (i.e. MY strategy) is to use the home system for experimentation and then move the entire sim to a &amp;quot;commercial&amp;quot; VPS service if the sim gets popular (and produces enough $$$ to pay the freight!) &lt;br /&gt;
&lt;br /&gt;
===Running Squid on your region server as a reverse proxy to the asset server===&lt;br /&gt;
1. Download and install the Squid Proxy from: http://www.squid-cache.org/Download/&amp;lt;br&amp;gt;&lt;br /&gt;
2. Create your [[squid.conf]] configuration file.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Change your asset_server configuration in your OpenSim.ini to point to http://localhost:3128/&amp;lt;br&amp;gt;&lt;br /&gt;
4. Start everything up!&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now assets will be cached in the squid cache on the region server, and will be served up much faster, especially on region restart.&lt;br /&gt;
&lt;br /&gt;
=== GC_NO_EXPLICIT ===&lt;br /&gt;
&lt;br /&gt;
Sometimes this patch applied to mono-svn has helped my sim run a lot faster and not slowly get bogged down.&lt;br /&gt;
&lt;br /&gt;
$mono-svn-root$/mono&lt;br /&gt;
  mono/metadata/boehm-gc.c&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Index: boehm-gc.c&lt;br /&gt;
===================================================================&lt;br /&gt;
--- boehm-gc.c	(revision 105684)&lt;br /&gt;
+++ boehm-gc.c	(working copy)&lt;br /&gt;
@@ -107,6 +107,10 @@&lt;br /&gt;
 void&lt;br /&gt;
 mono_gc_collect (int generation)&lt;br /&gt;
 {&lt;br /&gt;
+	static int no_explicite_gc = 0; if (no_explicite_gc==0) {if (getenv(&amp;quot;GC_NO_EXPLICIT&amp;quot;)) {no_explicite_gc = 1;return;} else {no_explicite_gc = 2;}} else if (no_explicite_gc==1) {&lt;br /&gt;
+		g_print(&amp;quot;\n --------GC_NO_EXPLICIT \n&amp;quot;);&lt;br /&gt;
+		return;&lt;br /&gt;
+		}&lt;br /&gt;
 	MONO_PROBE_GC_BEGIN (generation);&lt;br /&gt;
 	&lt;br /&gt;
 	GC_gcollect ();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Not only this, but I recompile the mono runtime:&lt;br /&gt;
&amp;lt;pre&amp;gt;--with-large-heap=yes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Otherwise, the Sim is limited to 3GB RAM.  Probably, this second peice is more important.  But still, afterwards it's worth a shot to test with both to see if there is a difference in performance:&lt;br /&gt;
&lt;br /&gt;
 export GC_NO_EXPLICIT=1&lt;br /&gt;
and&lt;br /&gt;
 unset GC_NO_EXPLICIT&lt;br /&gt;
&lt;br /&gt;
What I think, (only a guess) is that Mono starts internally GC thrashing in fishing expeditions to gaining maybe 1k of RAM at time. And by having a large heap (&amp;gt;3GB), it is possible might keep mono less apt to do stop world complete collections as often.&lt;/div&gt;</summary>
		<author><name>Nihlaeth</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/wiki/Performance</id>
		<title>Performance</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/Performance"/>
				<updated>2010-10-26T22:43:12Z</updated>
		
		<summary type="html">&lt;p&gt;Nihlaeth: /* Hardware Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Quicklinks}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
OpenSim performance is a very complex issue.  Performance can be affected by any number of things, including the number of prims on a region, number of regions, number of avatars, network quality between server and viewer, network quality between simulator and grid services, etc.&lt;br /&gt;
&lt;br /&gt;
==Hardware Requirements==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, this is a very difficult question in light of all the factors mentioned above.  Below are some examples of hardware people use/have used.  Please feel free to add to the list, or to add any reports to the performance studies and blog posts section.  '''These are examples to help you in your selection, not necessarily recommendations.'''&lt;br /&gt;
&lt;br /&gt;
Object Parts ~= # prim&lt;br /&gt;
&lt;br /&gt;
Sensors and Timers are generally more intensive then regular scripts, so please specify quantity of each.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Description&lt;br /&gt;
!Operating System (please add Mono version if appropriate)&lt;br /&gt;
!OpenSim version&lt;br /&gt;
!RAM/AVG_USE_%&lt;br /&gt;
!CPU&lt;br /&gt;
!#/type of regions&lt;br /&gt;
!# simultaneous avs&lt;br /&gt;
!#scripts/timers/Sensors&lt;br /&gt;
!Location&lt;br /&gt;
!#objectparts&lt;br /&gt;
|-&lt;br /&gt;
|hosted Xen VPS&lt;br /&gt;
|Ubuntu Intrepid (8.10)&lt;br /&gt;
|Unknown&lt;br /&gt;
|540MB/?&lt;br /&gt;
|1x quad-core 2.5GHz Xeon (L5420)&lt;br /&gt;
|1 region + 9 voids&lt;br /&gt;
|generally 1-2&lt;br /&gt;
|few&lt;br /&gt;
|Knifejaw Atoll &amp;amp; surrounding on OSGrid&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|hosted Xen VPS&lt;br /&gt;
|Ubuntu Jaunty (9.04)&lt;br /&gt;
|Unknown&lt;br /&gt;
|360MB/?&lt;br /&gt;
|2x dual-core 2.0GHz Xeon (5130)&lt;br /&gt;
|1 void&lt;br /&gt;
|generally 1-2 &lt;br /&gt;
|none&lt;br /&gt;
|Knifejaw Road on OSGrid&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|Dedicated Server from A+&lt;br /&gt;
|Windows Server 2003&lt;br /&gt;
|Unknown&lt;br /&gt;
|1 Meg&lt;br /&gt;
|1x single-core 2.8GHz Celeron&lt;br /&gt;
|2regions per server&lt;br /&gt;
|6 at once with no issues&lt;br /&gt;
|Waterfalls, texture anims, window texture switchers, lots of sound loops&lt;br /&gt;
|Pleasure Planet Welcome center &amp;amp; Region Pleasure Planet in OSGrid&lt;br /&gt;
|20000 prims per region&lt;br /&gt;
|-&lt;br /&gt;
|Amazon EC2 &amp;quot;high-CPU medium instance&amp;quot; (Xen VM)&lt;br /&gt;
|Windows Server 2003&lt;br /&gt;
|Unknown&lt;br /&gt;
|1.7GB&lt;br /&gt;
|1x dual-core 2.3GHz (Intel E5345)&lt;br /&gt;
|1 region with sailing race course&lt;br /&gt;
|7 avs, 4 in boats&lt;br /&gt;
|scripted start line&lt;br /&gt;
|Castle Rock, OSGrid&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Dedicated Server from simhost.com&lt;br /&gt;
|SuSe 11.2 x64&lt;br /&gt;
|Unknown&lt;br /&gt;
|8gb / 50%&lt;br /&gt;
|4x Core2Quad Q9300 2.6ghz&lt;br /&gt;
|1 region (Wright Plaza) uses approx 4gb ram&lt;br /&gt;
|20-25 users&lt;br /&gt;
|Freebie Stores / Meeting Center / Video Theater&lt;br /&gt;
|@osgrid.org Heavy Use Sim&lt;br /&gt;
|17500 prims aprox 1500 scripts&lt;br /&gt;
|-&lt;br /&gt;
|Home machine&lt;br /&gt;
|Windows XP SP3&lt;br /&gt;
|0.7.0.1 (Diva r13558)&lt;br /&gt;
|3GB / 15-40% incl. Opensim and MySQL&lt;br /&gt;
|4x Core2Quad Q6600 2.4 GHz. Use: generally, 0-10%&lt;br /&gt;
|11 regions&lt;br /&gt;
|1-6 users&lt;br /&gt;
|Many scripted objects (1934 scripts)&lt;br /&gt;
|[http://zonjacapalini.wordpress.com/2010/08/25/condensation-land-a-status-report/ Condensation Land]&lt;br /&gt;
|38,065 prims&lt;br /&gt;
|-&lt;br /&gt;
|Home machine&lt;br /&gt;
|Ubuntu Lucid 10.04 (32 bit pae)&lt;br /&gt;
|0.7.0.1 (Diva r13558)&lt;br /&gt;
|160Mb no users, add 5Mb/user incl Opensim and MySQL&lt;br /&gt;
|I7-920 (dual threaded quad core), 3.8Ghz, 6Gb RAM, 0-10% Load&lt;br /&gt;
|4 regions (Diva default config)&lt;br /&gt;
|1-4 users (approx 20Kb/sec bandwidth/user)&lt;br /&gt;
|Few scripted objects (&amp;lt;10)&lt;br /&gt;
|[http://mars-simulator.hobby-site.org:9000/wifi Mars Simulation]- Based on [http://metatek.blogspot.com/2010/06/mars-simulation-for-distribution.html Erik Nauman's Open Blackboard]&lt;br /&gt;
|158 prims&lt;br /&gt;
|-&lt;br /&gt;
|Parallels Virtuozzo Container 4.5&lt;br /&gt;
|Win/Net (32 run)&lt;br /&gt;
|0.7 (D2)&lt;br /&gt;
|320Mb total, incl Opensim and MySQL&lt;br /&gt;
|Q6600 Quad, 2.8Ghz, 2Gb RAM, 0-2% Avg Load&lt;br /&gt;
|9 regions (3x3 mega-region)&lt;br /&gt;
|&amp;lt;6 users&lt;br /&gt;
|vehicle scripted objects (&amp;lt;5)&lt;br /&gt;
|[http://metaversesailing.com:9000/wifi Metaverse Sailing]&lt;br /&gt;
|&amp;lt;1000 prims&lt;br /&gt;
|-&lt;br /&gt;
|VPS&lt;br /&gt;
|Debian Lenny 5 (mono 2.4.2.3)&lt;br /&gt;
|OSgrid 0.7.1 (Dev) cd4d7a7: 2010-10-15&lt;br /&gt;
|655MB averabe out of 1722MB RAM, incl. MySQL&lt;br /&gt;
|Intel Quadcore 2.5 Ghz (1 core assigned to vps) average use: 40-45% &lt;br /&gt;
|20 regions (4x5 mega-region)&lt;br /&gt;
|&amp;lt;4 users&lt;br /&gt;
|about 20 different light scripts, but we're also experimenting with heavier HUD scripts (timers, lots of ll(Get/Set)PrimitiveParams and large lists) and custom IRC relay&lt;br /&gt;
|Phoenix Rising Isles on OsGrid&lt;br /&gt;
|3727 prims&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Performance studies and blog posts==&lt;br /&gt;
&lt;br /&gt;
These provide some interesting data on the performance limitations of OpenSim at various points in time.&lt;br /&gt;
&lt;br /&gt;
* [https://lists.berlios.de/pipermail/opensim-users/2010-August/005189.html https://lists.berlios.de/pipermail/opensim-users/2010-August/005189.html] - Some interesting information from Mr Blue.  Physical objects and max avatars are limited by single thread performance in OpenSim.&lt;br /&gt;
* [http://www.sciencesim.com/wiki/doku.php/vwperf/start http://www.sciencesim.com/wiki/doku.php/vwperf/start] - Links to ScienceSim performance studies, including some very recent ones.&lt;br /&gt;
* [[Improving Performance]] - An old page from July 2009 detailing some performance issues on OpenSim.  Some of these issues are still valid (e.g. ODE issues).&lt;br /&gt;
* [[NHibernate Performance Testing]] &amp;amp;mdash; SQLite and MySQL performance tests with NHibernate.&lt;br /&gt;
* [[LibSecondLife performance problems]] - Another old page from November 2007 detailing issues with libsecondlife (now called libopenmetaverse).&lt;br /&gt;
* [http://opensim.cybertechnews.org/?p=71 Experiences from Operating a 3D Region Server in OSGrid - Part 1]&lt;br /&gt;
* [http://opensim.cybertechnews.org/?p=104 Experiences from Operating a 3D Region Server in OSGrid - Part 2]&lt;br /&gt;
&lt;br /&gt;
==Performance hints==&lt;br /&gt;
&lt;br /&gt;
Here are some specific things you might be able to do to improve performance&lt;br /&gt;
&lt;br /&gt;
===Home Based systems===&lt;br /&gt;
&lt;br /&gt;
The most obvious performance difference between a home based cable/dsl system and a &amp;quot;commercial&amp;quot; server is the upload bandwidth. A typical home system allows 100Kb/s upload with 12Mb/s download, a &amp;quot;commercial&amp;quot; system typically has a &amp;quot;symmetrical&amp;quot; bandwidth of say 12Mb/s UP AND DOWN! &amp;quot;Commercial&amp;quot; systems can essentially buy unlimited bandwidth as needed, but it does get expensive to buy bandwidth that you don't need!&lt;br /&gt;
&lt;br /&gt;
In practice this limits the number of &amp;quot;external&amp;quot; users on a &amp;quot;home system&amp;quot; to 4 or 5, but LAN users (NPCs/bots etc.) are essentially unlimited.&lt;br /&gt;
&lt;br /&gt;
A reasonable strategy (i.e. MY strategy) is to use the home system for experimentation and then move the entire sim to a &amp;quot;commercial&amp;quot; VPS service if the sim gets popular (and produces enough $$$ to pay the freight!) &lt;br /&gt;
&lt;br /&gt;
===Running Squid on your region server as a reverse proxy to the asset server===&lt;br /&gt;
1. Download and install the Squid Proxy from: http://www.squid-cache.org/Download/&amp;lt;br&amp;gt;&lt;br /&gt;
2. Create your [[squid.conf]] configuration file.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Change your asset_server configuration in your OpenSim.ini to point to http://localhost:3128/&amp;lt;br&amp;gt;&lt;br /&gt;
4. Start everything up!&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now assets will be cached in the squid cache on the region server, and will be served up much faster, especially on region restart.&lt;br /&gt;
&lt;br /&gt;
=== GC_NO_EXPLICIT ===&lt;br /&gt;
&lt;br /&gt;
Sometimes this patch applied to mono-svn has helped my sim run a lot faster and not slowly get bogged down.&lt;br /&gt;
&lt;br /&gt;
$mono-svn-root$/mono&lt;br /&gt;
  mono/metadata/boehm-gc.c&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Index: boehm-gc.c&lt;br /&gt;
===================================================================&lt;br /&gt;
--- boehm-gc.c	(revision 105684)&lt;br /&gt;
+++ boehm-gc.c	(working copy)&lt;br /&gt;
@@ -107,6 +107,10 @@&lt;br /&gt;
 void&lt;br /&gt;
 mono_gc_collect (int generation)&lt;br /&gt;
 {&lt;br /&gt;
+	static int no_explicite_gc = 0; if (no_explicite_gc==0) {if (getenv(&amp;quot;GC_NO_EXPLICIT&amp;quot;)) {no_explicite_gc = 1;return;} else {no_explicite_gc = 2;}} else if (no_explicite_gc==1) {&lt;br /&gt;
+		g_print(&amp;quot;\n --------GC_NO_EXPLICIT \n&amp;quot;);&lt;br /&gt;
+		return;&lt;br /&gt;
+		}&lt;br /&gt;
 	MONO_PROBE_GC_BEGIN (generation);&lt;br /&gt;
 	&lt;br /&gt;
 	GC_gcollect ();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Not only this, but I recompile the mono runtime:&lt;br /&gt;
&amp;lt;pre&amp;gt;--with-large-heap=yes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Otherwise, the Sim is limited to 3GB RAM.  Probably, this second peice is more important.  But still, afterwards it's worth a shot to test with both to see if there is a difference in performance:&lt;br /&gt;
&lt;br /&gt;
 export GC_NO_EXPLICIT=1&lt;br /&gt;
and&lt;br /&gt;
 unset GC_NO_EXPLICIT&lt;br /&gt;
&lt;br /&gt;
What I think, (only a guess) is that Mono starts internally GC thrashing in fishing expeditions to gaining maybe 1k of RAM at time. And by having a large heap (&amp;gt;3GB), it is possible might keep mono less apt to do stop world complete collections as often.&lt;/div&gt;</summary>
		<author><name>Nihlaeth</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/wiki/Performance</id>
		<title>Performance</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/Performance"/>
				<updated>2010-10-26T22:42:37Z</updated>
		
		<summary type="html">&lt;p&gt;Nihlaeth: /* Hardware Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Quicklinks}}&lt;br /&gt;
&lt;br /&gt;
=Introduction=&lt;br /&gt;
&lt;br /&gt;
OpenSim performance is a very complex issue.  Performance can be affected by any number of things, including the number of prims on a region, number of regions, number of avatars, network quality between server and viewer, network quality between simulator and grid services, etc.&lt;br /&gt;
&lt;br /&gt;
==Hardware Requirements==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, this is a very difficult question in light of all the factors mentioned above.  Below are some examples of hardware people use/have used.  Please feel free to add to the list, or to add any reports to the performance studies and blog posts section.  '''These are examples to help you in your selection, not necessarily recommendations.'''&lt;br /&gt;
&lt;br /&gt;
Object Parts ~= # prim&lt;br /&gt;
&lt;br /&gt;
Sensors and Timers are generally more intensive then regular scripts, so please specify quantity of each.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot;&lt;br /&gt;
!Description&lt;br /&gt;
!Operating System (please add Mono version if appropriate)&lt;br /&gt;
!OpenSim version&lt;br /&gt;
!RAM/AVG_USE_%&lt;br /&gt;
!CPU&lt;br /&gt;
!#/type of regions&lt;br /&gt;
!# simultaneous avs&lt;br /&gt;
!#scripts/timers/Sensors&lt;br /&gt;
!Location&lt;br /&gt;
!#objectparts&lt;br /&gt;
|-&lt;br /&gt;
|hosted Xen VPS&lt;br /&gt;
|Ubuntu Intrepid (8.10)&lt;br /&gt;
|Unknown&lt;br /&gt;
|540MB/?&lt;br /&gt;
|1x quad-core 2.5GHz Xeon (L5420)&lt;br /&gt;
|1 region + 9 voids&lt;br /&gt;
|generally 1-2&lt;br /&gt;
|few&lt;br /&gt;
|Knifejaw Atoll &amp;amp; surrounding on OSGrid&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|hosted Xen VPS&lt;br /&gt;
|Ubuntu Jaunty (9.04)&lt;br /&gt;
|Unknown&lt;br /&gt;
|360MB/?&lt;br /&gt;
|2x dual-core 2.0GHz Xeon (5130)&lt;br /&gt;
|1 void&lt;br /&gt;
|generally 1-2 &lt;br /&gt;
|none&lt;br /&gt;
|Knifejaw Road on OSGrid&lt;br /&gt;
|?&lt;br /&gt;
|-&lt;br /&gt;
|Dedicated Server from A+&lt;br /&gt;
|Windows Server 2003&lt;br /&gt;
|Unknown&lt;br /&gt;
|1 Meg&lt;br /&gt;
|1x single-core 2.8GHz Celeron&lt;br /&gt;
|2regions per server&lt;br /&gt;
|6 at once with no issues&lt;br /&gt;
|Waterfalls, texture anims, window texture switchers, lots of sound loops&lt;br /&gt;
|Pleasure Planet Welcome center &amp;amp; Region Pleasure Planet in OSGrid&lt;br /&gt;
|20000 prims per region&lt;br /&gt;
|-&lt;br /&gt;
|Amazon EC2 &amp;quot;high-CPU medium instance&amp;quot; (Xen VM)&lt;br /&gt;
|Windows Server 2003&lt;br /&gt;
|Unknown&lt;br /&gt;
|1.7GB&lt;br /&gt;
|1x dual-core 2.3GHz (Intel E5345)&lt;br /&gt;
|1 region with sailing race course&lt;br /&gt;
|7 avs, 4 in boats&lt;br /&gt;
|scripted start line&lt;br /&gt;
|Castle Rock, OSGrid&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|Dedicated Server from simhost.com&lt;br /&gt;
|SuSe 11.2 x64&lt;br /&gt;
|Unknown&lt;br /&gt;
|8gb / 50%&lt;br /&gt;
|4x Core2Quad Q9300 2.6ghz&lt;br /&gt;
|1 region (Wright Plaza) uses approx 4gb ram&lt;br /&gt;
|20-25 users&lt;br /&gt;
|Freebie Stores / Meeting Center / Video Theater&lt;br /&gt;
|@osgrid.org Heavy Use Sim&lt;br /&gt;
|17500 prims aprox 1500 scripts&lt;br /&gt;
|-&lt;br /&gt;
|Home machine&lt;br /&gt;
|Windows XP SP3&lt;br /&gt;
|0.7.0.1 (Diva r13558)&lt;br /&gt;
|3GB / 15-40% incl. Opensim and MySQL&lt;br /&gt;
|4x Core2Quad Q6600 2.4 GHz. Use: generally, 0-10%&lt;br /&gt;
|11 regions&lt;br /&gt;
|1-6 users&lt;br /&gt;
|Many scripted objects (1934 scripts)&lt;br /&gt;
|[http://zonjacapalini.wordpress.com/2010/08/25/condensation-land-a-status-report/ Condensation Land]&lt;br /&gt;
|38,065 prims&lt;br /&gt;
|-&lt;br /&gt;
|Home machine&lt;br /&gt;
|Ubuntu Lucid 10.04 (32 bit pae)&lt;br /&gt;
|0.7.0.1 (Diva r13558)&lt;br /&gt;
|160Mb no users, add 5Mb/user incl Opensim and MySQL&lt;br /&gt;
|I7-920 (dual threaded quad core), 3.8Ghz, 6Gb RAM, 0-10% Load&lt;br /&gt;
|4 regions (Diva default config)&lt;br /&gt;
|1-4 users (approx 20Kb/sec bandwidth/user)&lt;br /&gt;
|Few scripted objects (&amp;lt;10)&lt;br /&gt;
|[http://mars-simulator.hobby-site.org:9000/wifi Mars Simulation]- Based on [http://metatek.blogspot.com/2010/06/mars-simulation-for-distribution.html Erik Nauman's Open Blackboard]&lt;br /&gt;
|158 prims&lt;br /&gt;
|-&lt;br /&gt;
|Parallels Virtuozzo Container 4.5&lt;br /&gt;
|Win/Net (32 run)&lt;br /&gt;
|0.7 (D2)&lt;br /&gt;
|320Mb total, incl Opensim and MySQL&lt;br /&gt;
|Q6600 Quad, 2.8Ghz, 2Gb RAM, 0-2% Avg Load&lt;br /&gt;
|9 regions (3x3 mega-region)&lt;br /&gt;
|&amp;lt;6 users&lt;br /&gt;
|vehicle scripted objects (&amp;lt;5)&lt;br /&gt;
|[http://metaversesailing.com:9000/wifi Metaverse Sailing]&lt;br /&gt;
|&amp;lt;1000 prims&lt;br /&gt;
|-&lt;br /&gt;
|VPS on shared server&lt;br /&gt;
|Debian Lenny 5 (mono 2.4.2.3)&lt;br /&gt;
|OSgrid 0.7.1 (Dev) cd4d7a7: 2010-10-15&lt;br /&gt;
|655MB averabe out of 1722MB RAM, incl. MySQL&lt;br /&gt;
|Intel Quadcore 2.5 Ghz (1 core assigned to vps) average use: 40-45% &lt;br /&gt;
|20 regions (4x5 mega-region)&lt;br /&gt;
|&amp;lt;4 users&lt;br /&gt;
|about 20 different light scripts, but we're also experimenting with heavier HUD scripts (timers, lots of ll(Get/Set)PrimitiveParams and large lists) and custom IRC relay&lt;br /&gt;
|Phoenix Rising Isles on OsGrid&lt;br /&gt;
|3727 prims&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Performance studies and blog posts==&lt;br /&gt;
&lt;br /&gt;
These provide some interesting data on the performance limitations of OpenSim at various points in time.&lt;br /&gt;
&lt;br /&gt;
* [https://lists.berlios.de/pipermail/opensim-users/2010-August/005189.html https://lists.berlios.de/pipermail/opensim-users/2010-August/005189.html] - Some interesting information from Mr Blue.  Physical objects and max avatars are limited by single thread performance in OpenSim.&lt;br /&gt;
* [http://www.sciencesim.com/wiki/doku.php/vwperf/start http://www.sciencesim.com/wiki/doku.php/vwperf/start] - Links to ScienceSim performance studies, including some very recent ones.&lt;br /&gt;
* [[Improving Performance]] - An old page from July 2009 detailing some performance issues on OpenSim.  Some of these issues are still valid (e.g. ODE issues).&lt;br /&gt;
* [[NHibernate Performance Testing]] &amp;amp;mdash; SQLite and MySQL performance tests with NHibernate.&lt;br /&gt;
* [[LibSecondLife performance problems]] - Another old page from November 2007 detailing issues with libsecondlife (now called libopenmetaverse).&lt;br /&gt;
* [http://opensim.cybertechnews.org/?p=71 Experiences from Operating a 3D Region Server in OSGrid - Part 1]&lt;br /&gt;
* [http://opensim.cybertechnews.org/?p=104 Experiences from Operating a 3D Region Server in OSGrid - Part 2]&lt;br /&gt;
&lt;br /&gt;
==Performance hints==&lt;br /&gt;
&lt;br /&gt;
Here are some specific things you might be able to do to improve performance&lt;br /&gt;
&lt;br /&gt;
===Home Based systems===&lt;br /&gt;
&lt;br /&gt;
The most obvious performance difference between a home based cable/dsl system and a &amp;quot;commercial&amp;quot; server is the upload bandwidth. A typical home system allows 100Kb/s upload with 12Mb/s download, a &amp;quot;commercial&amp;quot; system typically has a &amp;quot;symmetrical&amp;quot; bandwidth of say 12Mb/s UP AND DOWN! &amp;quot;Commercial&amp;quot; systems can essentially buy unlimited bandwidth as needed, but it does get expensive to buy bandwidth that you don't need!&lt;br /&gt;
&lt;br /&gt;
In practice this limits the number of &amp;quot;external&amp;quot; users on a &amp;quot;home system&amp;quot; to 4 or 5, but LAN users (NPCs/bots etc.) are essentially unlimited.&lt;br /&gt;
&lt;br /&gt;
A reasonable strategy (i.e. MY strategy) is to use the home system for experimentation and then move the entire sim to a &amp;quot;commercial&amp;quot; VPS service if the sim gets popular (and produces enough $$$ to pay the freight!) &lt;br /&gt;
&lt;br /&gt;
===Running Squid on your region server as a reverse proxy to the asset server===&lt;br /&gt;
1. Download and install the Squid Proxy from: http://www.squid-cache.org/Download/&amp;lt;br&amp;gt;&lt;br /&gt;
2. Create your [[squid.conf]] configuration file.&amp;lt;br&amp;gt;&lt;br /&gt;
3. Change your asset_server configuration in your OpenSim.ini to point to http://localhost:3128/&amp;lt;br&amp;gt;&lt;br /&gt;
4. Start everything up!&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now assets will be cached in the squid cache on the region server, and will be served up much faster, especially on region restart.&lt;br /&gt;
&lt;br /&gt;
=== GC_NO_EXPLICIT ===&lt;br /&gt;
&lt;br /&gt;
Sometimes this patch applied to mono-svn has helped my sim run a lot faster and not slowly get bogged down.&lt;br /&gt;
&lt;br /&gt;
$mono-svn-root$/mono&lt;br /&gt;
  mono/metadata/boehm-gc.c&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Index: boehm-gc.c&lt;br /&gt;
===================================================================&lt;br /&gt;
--- boehm-gc.c	(revision 105684)&lt;br /&gt;
+++ boehm-gc.c	(working copy)&lt;br /&gt;
@@ -107,6 +107,10 @@&lt;br /&gt;
 void&lt;br /&gt;
 mono_gc_collect (int generation)&lt;br /&gt;
 {&lt;br /&gt;
+	static int no_explicite_gc = 0; if (no_explicite_gc==0) {if (getenv(&amp;quot;GC_NO_EXPLICIT&amp;quot;)) {no_explicite_gc = 1;return;} else {no_explicite_gc = 2;}} else if (no_explicite_gc==1) {&lt;br /&gt;
+		g_print(&amp;quot;\n --------GC_NO_EXPLICIT \n&amp;quot;);&lt;br /&gt;
+		return;&lt;br /&gt;
+		}&lt;br /&gt;
 	MONO_PROBE_GC_BEGIN (generation);&lt;br /&gt;
 	&lt;br /&gt;
 	GC_gcollect ();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Not only this, but I recompile the mono runtime:&lt;br /&gt;
&amp;lt;pre&amp;gt;--with-large-heap=yes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Otherwise, the Sim is limited to 3GB RAM.  Probably, this second peice is more important.  But still, afterwards it's worth a shot to test with both to see if there is a difference in performance:&lt;br /&gt;
&lt;br /&gt;
 export GC_NO_EXPLICIT=1&lt;br /&gt;
and&lt;br /&gt;
 unset GC_NO_EXPLICIT&lt;br /&gt;
&lt;br /&gt;
What I think, (only a guess) is that Mono starts internally GC thrashing in fishing expeditions to gaining maybe 1k of RAM at time. And by having a large heap (&amp;gt;3GB), it is possible might keep mono less apt to do stop world complete collections as often.&lt;/div&gt;</summary>
		<author><name>Nihlaeth</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/wiki/Talk:OsGetPrimitiveParams</id>
		<title>Talk:OsGetPrimitiveParams</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/Talk:OsGetPrimitiveParams"/>
				<updated>2010-10-26T20:44:59Z</updated>
		
		<summary type="html">&lt;p&gt;Nihlaeth: New page: Nihlaeth: As far as I can see this function is in fact not implemented. Use results in a syntax error. Is there anyone who has different experiences with this one?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Nihlaeth: As far as I can see this function is in fact not implemented. Use results in a syntax error. Is there anyone who has different experiences with this one?&lt;/div&gt;</summary>
		<author><name>Nihlaeth</name></author>	</entry>

	<entry>
		<id>http://opensimulator.org/wiki/OSSL_Proposals</id>
		<title>OSSL Proposals</title>
		<link rel="alternate" type="text/html" href="http://opensimulator.org/wiki/OSSL_Proposals"/>
				<updated>2010-10-26T20:34:30Z</updated>
		
		<summary type="html">&lt;p&gt;Nihlaeth: /* OSSL Proposal Table */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__NOTOC__&lt;br /&gt;
{{Template:Quicklinks}}&lt;br /&gt;
&lt;br /&gt;
[[Technical Reference | Technical Reference]] -&amp;gt; [[Technical Reference/terms | Terms]] -&amp;gt; [[OSSL Status | OSSL Status]] -&amp;gt; [[OSSL_Proposals | OSSL Proposal List]] &lt;br /&gt;
&lt;br /&gt;
{{proposal}}&lt;br /&gt;
{{content}}&lt;br /&gt;
&lt;br /&gt;
=What is OSSL?=&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
This is a page dedicated to OpenSim's very own home brew custom scripting language Known as &amp;quot;'''O'''pen '''S'''im '''S'''cripting '''L'''anguage&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Please see [[OSSL_Standards|OSSL Standards]] for proposed naming schema'''&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Please post your osFunction along with a brief description of what it would be for, or do and an example of it. &lt;br /&gt;
* Make sure it begins with os NOT ll.&lt;br /&gt;
* And remember, almost anything within reason can be posted here as an idea, who knows, maybe a variation of your request can be possible.&lt;br /&gt;
* If a function could implemented in standard LSL, there is no reason to make an OS function. LSL code and function code executes at the same speed in OpenSim.&lt;br /&gt;
== OSSL Proposal Table ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;sortable&amp;quot; cellpadding=&amp;quot;5&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;width:100%;border:1px solid #000000;border-collapse: collapse; white-space:normal;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF;font-size:6pt;font-weight:bold;border-bottom:1px solid;&amp;quot; align=&amp;quot;center&amp;quot; valign=&amp;quot;bottom&amp;quot;&lt;br /&gt;
| osFunction &lt;br /&gt;
| Description &lt;br /&gt;
| Example Usage &lt;br /&gt;
| Signed&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| list osGetRegionAgentKeys(); &lt;br /&gt;
| C# Code: &lt;br /&gt;
        public LSL_List osGetRegionAgentKeys()&lt;br /&gt;
       {&lt;br /&gt;
           CheckThreatLevel(ThreatLevel.None, &amp;quot;osGetRegionAgentKeys&amp;quot;);&lt;br /&gt;
           LSL_List result = new LSL_List();&lt;br /&gt;
           foreach (ScenePresence avatar in World.GetAvatars())&lt;br /&gt;
           {&lt;br /&gt;
               result.Add(avatar.UUID);&lt;br /&gt;
           }&lt;br /&gt;
           return result;&lt;br /&gt;
       }&lt;br /&gt;
&lt;br /&gt;
Returns a list of keys for every agent in the region &lt;br /&gt;
&lt;br /&gt;
| list keys=osGetRegionAgentKeys(); &lt;br /&gt;
integer i; integer l=llGetListLength(keys); string names; for(i=0;i&amp;amp;lt;l;i++) { key id=llList2Key(keys,i); string add=llKey2Name(id); integer dist=llVecDist(llGetPos(),llList2Vector(llGetObjectDetails(id,[OBJECT_POS]),0))); add+=&amp;quot;[&amp;quot;+(string)dist+&amp;quot;]\n&amp;quot;; names+=add; } llSetText(names,&amp;amp;lt;1,1,1&amp;amp;gt;,1.0); &lt;br /&gt;
&lt;br /&gt;
| Joshua Driver&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| [NEW] various os functions including osDerezObject(), osMessageAgentAttachment(), ... &lt;br /&gt;
| see http://opensimulator.org/wiki/User:Athlon_Maurer for full source code &lt;br /&gt;
| tested on local opensimulator 0.6.9 (some of them doesnt seem to work on 0.7.x) &lt;br /&gt;
| Athlon Maurer&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| string osBin(string char); &lt;br /&gt;
| To convert a char into its binary value. Will only convert 1 char at a time. &lt;br /&gt;
| string bin_a = osBin(&amp;quot;A&amp;quot;); // bin_a = &amp;quot;01000001&amp;quot;; &lt;br /&gt;
| Athlon Maurer (please send me a notecard into secondlife, if that are too much ideas xD, this hint can be deleted by an opensimulator admin, if neccesary xD)&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| string osHex(integer number); &lt;br /&gt;
| To convert a number into its hexadecimal value. &lt;br /&gt;
| string str_ff = osHex(255); // str_ff = &amp;quot;FF&amp;quot;; &lt;br /&gt;
| Athlon Maurer&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osAsc(string char); &lt;br /&gt;
| To convert a char into its ascii index. Will only convert 1 char at a time. &lt;br /&gt;
| integer asc_a = osAsc(&amp;quot;A&amp;quot;); // asc_a = 65; &lt;br /&gt;
| Athlon Maurer&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osScanRegionRemove(); &lt;br /&gt;
| Remove an osScanRegionRepeat(). [ nearly the same as llSensorRemove() ] &lt;br /&gt;
| osScanRegionRemove(); &lt;br /&gt;
| Athlon Maurer&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osScanRegion(string name, key id, integer type); &lt;br /&gt;
| Scan the whole region where the script task object is in regardless where it is positioned. Triggers sensor() or no_sensor(). &lt;br /&gt;
| osScanRegion(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, AGENT); &lt;br /&gt;
| Athlon Maurer&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osScanRegionRepeat(string name, key id, integer type, float rate); &lt;br /&gt;
| Scan the whole region where the script task object is in regardless where it is positioned with rate. Triggers sensor() or no_sensor(). &lt;br /&gt;
| osScanRegionRepeat(&amp;quot;&amp;quot;, &amp;quot;&amp;quot;, AGENT, 15.0); &lt;br /&gt;
| Athlon Maurer&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| key osGetRegionMapTexture(string RegionName) &lt;br /&gt;
| return the map texture uuid for the region named by RegionName. &lt;br /&gt;
| llSetTexture(osGetRegionMapTexture(&amp;quot;OpenSim Test&amp;quot;), ALL_SIDES); &lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
create a php file which is public&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;	// mapquery.php by Athlon Maurer (SL, OL, OS)&lt;br /&gt;
	//&lt;br /&gt;
	// hello, ive just started to learn php/mysql and this is one of my first&lt;br /&gt;
	// scripts for opensim. this script returns the texture uuid for a given&lt;br /&gt;
	// region by calling: mapquery.php?region=REGIONNAME&lt;br /&gt;
	// if a region has been found, it returns that regions map texture uuid, &lt;br /&gt;
	// otherwise it returns a null key uuid&lt;br /&gt;
	// mysql connection info is here, please make this more safe&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;	// region name (do not change this)&lt;br /&gt;
	$region = htmlspecialchars($_GET['region']);&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;	// default uuid (do not change this)&lt;br /&gt;
	$uuid = '00000000-0000-0000-0000-000000000000';&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;	// your mysql host name (change this)&lt;br /&gt;
	$dbhost = 'localhost';&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;	// your mysql user name (change this)&lt;br /&gt;
	$dbuser = 'root';&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;	// your mysql user password (change this)&lt;br /&gt;
	$dbpass = '';&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;	// your mysql opensim database (change this)&lt;br /&gt;
	$dbname = 'opensim';&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;	// try to connect&lt;br /&gt;
	if ($conn = mysql_connect($dbhost, $dbuser, $dbpass))&lt;br /&gt;
	{&lt;br /&gt;
		// try to select&lt;br /&gt;
		if ($select = mysql_select_db($dbname, $conn))&lt;br /&gt;
		{&lt;br /&gt;
			$sql = 'SELECT regionName, regionMapTexture FROM regions';&lt;br /&gt;
			$result = mysql_query($sql);&lt;br /&gt;
			while ($row = mysql_fetch_array($result, MYSQL_ASSOC))&lt;br /&gt;
			{&lt;br /&gt;
				if ($row['regionName'] == $region)&lt;br /&gt;
				{&lt;br /&gt;
					$uuid = $row['regionMapTexture'];&lt;br /&gt;
				}&lt;br /&gt;
			}&lt;br /&gt;
			// free result&lt;br /&gt;
			mysql_free_result($result);&lt;br /&gt;
		}&lt;br /&gt;
		// close connection&lt;br /&gt;
		mysql_close($conn);&lt;br /&gt;
	}&lt;br /&gt;
	// output&lt;br /&gt;
	echo $uuid;&lt;br /&gt;
&amp;lt;/p&amp;gt;&amp;lt;p&amp;gt;?&amp;gt;&lt;br /&gt;
then llHTTPRequest(&amp;lt;/math&amp;gt; &lt;br /&gt;
&lt;br /&gt;
| Athlon Maurer (This function is available as of November 12, 2009)&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| list osGetLinkPrimitiveParams(integer link, list params); &lt;br /&gt;
| Function llSetLinkPrimitiveParams() does exist, but no chance to get params from a prim in a linkset, like llGetPrimitiveParams() and llSetPrimitiveParams(). &lt;br /&gt;
| list linkparams = osGetLinkPrimitiveParams([PRIM_TYPE, PRIM_TEXTURE, ...]); &lt;br /&gt;
| Athlon Maurer (This function is available as of August 09, 2009)&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osDerezObject(key object) &lt;br /&gt;
| Deletes an InWorld-Object specified by object as uuid. Only successful if the object the script is attached to and the object which should be derezzed is owned by the same owner&amp;amp;nbsp;:). Useful if the object to be deleted should be unscripted. &lt;br /&gt;
| osDerezObject(&amp;quot;key_of_object&amp;quot;); &lt;br /&gt;
| Athlon Maurer&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| int osRestartRegion() &lt;br /&gt;
| Restarts the region the script is currently in. The script this is run in has to be owned by the master avatar for that region. Returns 1 if the region is restarting, 0 on failure. &lt;br /&gt;
| osRestartRegion(); &lt;br /&gt;
| gryc (Implemented by AFrisby)&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| int osWebTexture() &lt;br /&gt;
| Sets the texture from a web-url &lt;br /&gt;
| osWebTexture(string url,integer maptype); &lt;br /&gt;
| AFrisby?&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osGroupAdd(key, string Role) &lt;br /&gt;
| Adds user to a group with given role, default role Everyone. Returns 1 if successful 0 if fail. &lt;br /&gt;
| osGroupAdd(87f6e6a0-d884-11dc-95ff-0800200c9a66, &amp;quot;Officer&amp;quot;) &lt;br /&gt;
| Nitrus Nori&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| int osShutdownRegion() &lt;br /&gt;
| Shuts down the region the script is currently in. The script this is run in has to be owned by the master avatar for that region. Returns 1 if the region is going down, 0 on failure. &lt;br /&gt;
| osShutdownRegion(); &lt;br /&gt;
| gryc&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osAttachmentSay(integer channel, string msg) &lt;br /&gt;
| Provide a secure, low lag method of communicating between attachments over the chat channels by only sending messages to objects attached to the same avatar. Would fail (or not be heard) if in a non-attached object. &lt;br /&gt;
| osAttachmentSay(-20, &amp;quot;detatch&amp;quot;); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osMessageSecure(string message_key, string str, integer num, key id);&amp;lt;br&amp;gt;secure_message(string message_key, string str, integer num, key id); &lt;br /&gt;
| Provide a method of sending secure, salt encripted messages sim wide. Messages would only be able to be received by scripts with the matching key in the secure_message method. &lt;br /&gt;
| osMessageSecure(&amp;quot;myPassPhrase&amp;quot;, &amp;quot;Hello World&amp;quot;, 0, NULL_KEY); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osSetText( vector color, string text [,vector color, string text]); &lt;br /&gt;
| Allow setting of multiple colors on the prim text &lt;br /&gt;
| osSetText(&amp;amp;lt;1,0,0&amp;amp;gt;,&amp;quot;Red&amp;quot;, &amp;amp;lt;0,1,0&amp;amp;gt;, &amp;quot;\nGreen&amp;quot;, &amp;amp;lt;0,0,1&amp;amp;gt;, &amp;quot;\nBlue&amp;quot;); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osSensor &lt;br /&gt;
| Gets ALL the objects in the specified range not just the first 16 &lt;br /&gt;
| (same as standard) &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| list lst=osDetectObjectsInSim(key id) &lt;br /&gt;
| given an Agent Key, provide a list of ALL object owned by that agent &lt;br /&gt;
| osDetectObjectsInSim(key id) returning a strided list of [ name, &amp;amp;lt;pos&amp;amp;gt; ] &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer=osDialog([ title, label1, type1, len1, label2, type2, len2].... &lt;br /&gt;
| given title and a listing of fields, builds up a real form where to put structured checked data &lt;br /&gt;
| will return a [ value1, value2, valuen ] corresponding to fields read. Type might be something like (string, text (multiline), integer, float, currency(decimals), options(combobox) &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| key id=osMakeTextureText(string name,integer width, integer height,[posx1,posy1,font1,color1,size1,text1,posx2,posy2,font2,color2,size2,text2....]) &lt;br /&gt;
| allow for producing a texture on the fly with desired Font content from a selected font selection. Width, Height in pixels 1024x512 to control how big will be the texture &lt;br /&gt;
| will generate a texture with defined text. (Allow some support for at least ISO-8859-1) texture will be created in the object inventory. posx, posy in the range 0-1 to be pixel independent &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osMakeNotecard(string name, [ line1, line2, line3, ...]) &lt;br /&gt;
| allow creation of new notecards in current object repository &lt;br /&gt;
| generate a new asset id useful for storing modified configuration &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer handler=osReadNotecardKey(string notecard, string key) &lt;br /&gt;
| allows reading notecards (through dataserver) in format key=value in convenient and efficient way &lt;br /&gt;
| ... &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osWriteNotecardKey(string notecard, string key,string value) &lt;br /&gt;
| allows WRITING notecards in format key=value in convenient and efficient way. Might be optimized having a fixed record length &amp;quot;file&amp;quot; so to avoid rewriting of the entire notecard &lt;br /&gt;
| ... &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer handle=osXMLParser(string xml) &lt;br /&gt;
| will activate a listener xmlparser(integer handler,string parent, string field, string value) &lt;br /&gt;
| to easily parse xml without writing php external code &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osReturnObjects(key owner, integer type); &lt;br /&gt;
| Provide a scriptable method of returning objects from a sim. type would be OBJECT_SCRIPTED, OBJECT_PASSIVE or OBJECT_ALL. Would return a binary Success/Fail, and work inline with land permissions for the script owner. &lt;br /&gt;
| osReturnObjects( target, OBJECT_ALL); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osReturnItem(key item); &lt;br /&gt;
| Provide a scriptable method of returning individual objects from a sim. Would return a binary Success/Fail, and work inline with land permissions for the script owner. &lt;br /&gt;
| osReturnItem(uuid); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osSetTimerEvent(integer timer, float rate); &amp;lt;br&amp;gt; (event) timer(integer timer_num) &lt;br /&gt;
| Support for multiple timers in a script. &lt;br /&gt;
| osSetTimerEvent(2, 0.5); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osTimerOnce(integer timer, float rate); &lt;br /&gt;
| Allow for a one shot timer event, rather than the normal repeating heartbeat type &lt;br /&gt;
| osTimerOnce(2, 10); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osVerifyScripts(); &lt;br /&gt;
| Check to see if all scripts in an object are created by the owner of the script calling the function. Return TRUE if they are, FALSE otherwise, to prevent insertion of alien scripts into an object &lt;br /&gt;
| if (!osVerifyScripts()) { llDie(); } &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osStopOtherAnimations(list animation_exceptions); &lt;br /&gt;
| Provide a method of stopping all animations on an avatar, except those defined in the list &lt;br /&gt;
| osStopOtherAnimations([&amp;quot;my_sitting_anim&amp;quot;]); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osPutScriptInLinkedSet(string name,integer linknum, integer starting_parm, integer running) &lt;br /&gt;
| Use this to propagate one script to ALL or part of linked set. &lt;br /&gt;
| Useful to have all objects in a linked set sharing a common behaviour &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osRezObject(string name, string description, integer permissionmask, list setPrimitiveObjectLikeList) will trigger the object_rez object as usual &lt;br /&gt;
| similar to llRezObject, but without the need of having a prim inside the inventory (which produced a lot of problems in deploying and in sl). Newly created object will have the same owner of current object where script is running. &lt;br /&gt;
| In case list is empty or position not specified, suitable defaults should apply like pos being 1 m higher in the z axis &lt;br /&gt;
| Sal&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| string osGetOwnerName(); &lt;br /&gt;
| Provide a method of getting the owner name without having to use llKey2Name &lt;br /&gt;
| myName = osGetOwnerName(); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osXMPPOpen(string server, string username, string password, string resource); &lt;br /&gt;
| Open an XMPP session to a jabber or other XMPP server, returning a handle to be able to manipulate the connection. Incoming messages to be parsed through a xmpp_message(integer handle, string sender, string service, string message) event. Accounts would have to be set up manually by the scripter, or by some other method, to prevent scripted spamming of a server, and to allow users to set up gateways and other services if needed. &lt;br /&gt;
| handle = osXMPPOpen(&amp;quot;jabber.org&amp;quot;, &amp;quot;MyObject&amp;quot;, &amp;quot;MyPassword&amp;quot;, &amp;quot;OpenSim&amp;quot;); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| list osXMPPGetRosta(integer handle); &lt;br /&gt;
| Get the rosta from the XMPP server, list in the strided form of [username, presence, resource]; &lt;br /&gt;
| list presence = osXMPPGetRosta(handle); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| list osXMPPGetServices(integer handle); &lt;br /&gt;
| Get a list of available services from the XMPP Server. &lt;br /&gt;
| list services = osXMPPGetServices(handle); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osXMPPAdd(string username, string service) &lt;br /&gt;
| Add a username to the account rosta. Return boolean success or fail &lt;br /&gt;
| if (osXMPPAdd(&amp;quot;Test User&amp;quot;, &amp;quot;Yahoo&amp;quot;)) { ... } &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer oxXMPPDelete(string username) &lt;br /&gt;
| Remove a username from the account rosta. Return boolean success or fail &lt;br /&gt;
| if (osXMPPDelete(&amp;quot;Test User&amp;quot;)) { ... } &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osXMPPGetStatus(string username); &lt;br /&gt;
| Poll the server for the status of a specific username on the rosta - returns would be OFFLINE, BUSY, AWAY and ONLINE &lt;br /&gt;
| if (osXMPPGetStatus(&amp;quot;Test User&amp;quot;) &amp;amp;amp; ONLINE) { ... } &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osXMPPSendMessage(integer handle, string message, string target); &lt;br /&gt;
| Send a message via the open XMPP channel, to the specified target. Return boolean success values &lt;br /&gt;
| if (osXMPPSendMessage(handle, &amp;quot;Hello World&amp;quot;, osGetOwnerName()) { llOwnerSay(&amp;quot;Successfully sent message&amp;quot;); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osXMPPClose(integer handle); &lt;br /&gt;
| Close the XMPP session &lt;br /&gt;
| osXMPPClose(); &lt;br /&gt;
| Del M&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osRezObjectKey(key object,vector pos,vector vel,rotation rot, int param); &lt;br /&gt;
| Basically llGodLikeRezObject[http://lslwiki.net/lslwiki/wakka.php?wakka=llGodLikeRezObject] with the features of llRezObject[http://lslwiki.net/lslwiki/wakka.php?wakka=llRezObject] but for everyone to use. Calls object_rez. &lt;br /&gt;
| osRezObjectKey(object_key,llGetPos(),ZERO_VECTOR,llGetRot(),0); &lt;br /&gt;
| Tdub&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osRezFromURL(string url, vector pos, vector vel, rotation rot, integer param) - calls on_rez &lt;br /&gt;
| Fetch a fragment of xml from a web server and rez its contents in-world as in 'load-xml'. Off or intergrid object repositories, such as objects stored in SVN via websvn, CMS, etc. &lt;br /&gt;
| osRezFromURL(&amp;quot;http://my.objectstore.com/myawesomeprims.xml&amp;quot;, &amp;amp;lt;1, 1, 1&amp;amp;gt;, &amp;amp;lt;0, 0, 0&amp;amp;gt;, &amp;amp;lt;0, 0, 0&amp;amp;gt;, 0) &lt;br /&gt;
| Jimbo2120&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| list osRunCustom(string function, list params) &lt;br /&gt;
| Allow scripts to call external custom routines that are grid-specific without modifying the set of LSL and OSL functions. &lt;br /&gt;
| list results = osRunCustom(&amp;quot;function1&amp;quot;, [...]) &lt;br /&gt;
| Ezekiel&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osSetScriptServer() &lt;br /&gt;
| Create a 'Server' prim that allows for extended scripting capabilities: more memory, higher bandwidth when communicating with external servers, probably some database connectivity, no artificial delays, can receive IMs, etc. Could be limited to one server per prim / parcel or per avatar, could be forced to remain in a fixed position. A server is important for residents that want to set up a virtual business. &lt;br /&gt;
| osSetScriptServer() &lt;br /&gt;
| Ezekiel&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osRemoteLoadScript(string url, string target) &lt;br /&gt;
| Load a source file in txt format from &amp;quot;URL&amp;quot; and compile it into script &amp;quot;target&amp;quot; in the inventory of the same prim. Requires permission of the object owner (RequestPermission). Returns boolean success value. Replaces an existing script with same name. This function would allow updates to scripted solutions that operate in any grid and sim worldwide, allowing the creator of the solution to distribute code fixes and implement new functions. Since the source code is distributed openly, it can be copied and modified by anyone. A function that would allow for secure code distribution, protecting copyrights and certificates, would also be very interesting but should be far more difficult to implement. &lt;br /&gt;
| integer updatestatus = osRemoteLoadScript(&amp;quot;http://www.xyz.com/updates/script1013.txt&amp;quot;, &amp;quot;betterscript&amp;quot; ) &lt;br /&gt;
| Ezekiel&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osSetCustomPrimitiveAttributes(list params) &lt;br /&gt;
| Set some custom persistent primitive attributes, the same way as llSetPrimitiveParams do. The attribute name has to be specified as a string, then the attribute type using a lSL constant. In the example, we set a &amp;quot;magnet&amp;quot; custom attribute as -0.5, supposing a customized physic engine handles this attribute to provide prim attraction. &lt;br /&gt;
| integer osSetCustomPrimitiveAttributes([&amp;quot;magnet&amp;quot;, TYPE_FLOAT, -0.5]) &lt;br /&gt;
| Grumly&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| list osGetCustomPrimitiveAttributes(list paramNames) &lt;br /&gt;
| Return a list values of the specified attributes names, the same way as llGetPrimitiveParams do. &lt;br /&gt;
| list osGetCustomPrimitiveAttributes([&amp;quot;Magnetic&amp;quot;]) &lt;br /&gt;
| Grumly &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osSyncUUID(key oldUUID, key newUUID); &lt;br /&gt;
| Allows to change the UUID of an avatar or item(requires permission from owner). &lt;br /&gt;
| Suppose a terminal in the LL-grid wants to communicate with an OS-Grid terminal. It can only send messages, if the UUID's of avatars match. An OS-Grid script can get the avatar's LL-UUID by calling the dataserver script. Then it calls osSyncUUID(llDetectedKey(0), keyFromHTTPRequest); . Now the two keys are equal, and avatar-avatar communication between grids can take place! &lt;br /&gt;
| Phrearch &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osTeleport(string RegionName, int x, int y, int z); &lt;br /&gt;
| Teleports an avatar to a custom region &lt;br /&gt;
as&amp;amp;nbsp;: osTeleportAgent(key agentId, string regionName, vector position, vector lookAt); &lt;br /&gt;
&lt;br /&gt;
| (this is implemented now - edited April 2009 by Wordfromthe Wise) &lt;br /&gt;
| Phrearch&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osSetStatus(integer status, integer value); &lt;br /&gt;
| Improved verion of the LSL function llSetStatus. &lt;br /&gt;
| The function works basically the same way as llSetStatus, except that an extra flag is added named STATUS_PHYSICS_ROOT. When this flag is TRUE, physics would be enabled Only for the root prim in a linked set, while the other prims in the set would behave as phantom. This would be useful for bypassing the 32-prim physics limit for vehicles by using only the root prim as a collision mesh. &lt;br /&gt;
| Pesho&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| vector osGetBonePos(); &lt;br /&gt;
| When called from an Attachment, retrieves the position of the bone it is attached to, in Region Coordinates. &lt;br /&gt;
| When llGetPos() is called from an attachment, the vector returned is the one of the avatar center, whereas llGetLocalPos() returns the local offset from the bone it is attached to. It would be useful to know where the attachment's location really is in world space. &lt;br /&gt;
| Pesho&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| string osGetOSLLRelease(); &lt;br /&gt;
| When called return the actual release of OSSL running on the sim. &lt;br /&gt;
| if osGetOSSLRelease() &amp;amp;gt; 1.1 {llSay(0,&amp;quot;good&amp;quot;);} &lt;br /&gt;
| Sacha Magne&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| List osGetServerLib(); &lt;br /&gt;
| When called return a list of all the additional libraries loaded on the server. it will avoid any scripts using a specific library to crash in case of missing libs. &lt;br /&gt;
| List lib=osGetServerLib(); &lt;br /&gt;
| Sacha Magne&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osSetAttachmentPoint(integer attachment); &lt;br /&gt;
| When called from an Attachment sets the default attachment point to attachment value. &lt;br /&gt;
| osSetAttachmentPoint(ATTACH_HUD_BOTTOM_RIGHT); &lt;br /&gt;
| Peter&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| string osMySQLQuery(string query); &lt;br /&gt;
| Used to get informations out of a sql database. Works together with osMySQLConnect(), osMySQLSelectDatabase() and osMySQLClose(). &lt;br /&gt;
| osMySQLQuery(&amp;quot;Select name FROM user LIMIT 0,1;&amp;quot;); &lt;br /&gt;
| Peter&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| string osGetGridName(); &lt;br /&gt;
| When called it return the hostname of the grid server. Useful to find out what grid you are on. &lt;br /&gt;
| string gridHostname = osGetGridHostname(); &lt;br /&gt;
| Patnad&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| key osName2Key(string avatarname); &lt;br /&gt;
| When called it return the key associated with a Avatar Name. &lt;br /&gt;
| key avKey = osName2Key(&amp;quot;avatar name&amp;quot;); &lt;br /&gt;
| Patnad&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| vector osParcelCenterpoint(vector pos); &lt;br /&gt;
| When called it return the vector that represent the center point of the current parcel. Same height as the object running the script but centerpoint for x,y. &lt;br /&gt;
| vector parcel_center = osParcelCenterpoint(llGetPos()); &lt;br /&gt;
| Patnad&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osSetMapDestination(integer mode, string simname, vector position, vector lookat); &lt;br /&gt;
| Sets a new &amp;quot;beacon&amp;quot; (red pole) without opening the worldmap: mode is for 1 (simname is a standard region name) or 0 (simname is a SLURL). If the code can handle standard sim names and SLURL(s) at the same time, the &amp;quot;mode&amp;quot; flag can be left behind. &lt;br /&gt;
| integer error = osSetMapDestination(TRUE, &amp;quot;cyberlandia&amp;quot;, &amp;amp;lt;128.0, 128.0, 0.0&amp;amp;gt;, ZERO_VECTOR); &lt;br /&gt;
&amp;amp;nbsp;If error is FALSE then no errors have occurred setting up the new beacon. &amp;amp;nbsp;Errors can arise using unknown simnames/SLURL(s), out of ranges vector coords and so on (nearly the same as llSetMapDestination). &lt;br /&gt;
&lt;br /&gt;
| Elwe Ewing&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osTeleportAgentPerm(key agentId, string regionName, vector position, vector lookAt); &lt;br /&gt;
osTeleportAgentPerm(key agentId, vector position, vector lookAt); &lt;br /&gt;
&lt;br /&gt;
| Works similarly as the two implemented osTeleportAgent but requires (at least the first time) the PERMISSION_TELEPORT flag set (via llRequestPermissions(key id, PERMISSION_TELEPORT); which should be implemented) and can be used by everyone (or restricted to a member of the group wich the region is deed, maybe with a new &amp;quot;Restrict teleports&amp;quot; Estate flag). &lt;br /&gt;
| &lt;br /&gt;
 // requests permission to Teleport then do it&lt;br /&gt;
 &lt;br /&gt;
 key  avie = NULL_KEY;&lt;br /&gt;
 &lt;br /&gt;
 default&lt;br /&gt;
 {&lt;br /&gt;
   state_entry()&lt;br /&gt;
   {&lt;br /&gt;
       llSay(0, &amp;quot;Touch to be teleported&amp;quot;);&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   run_time_permissions(integer vBitPermissions)&lt;br /&gt;
   {&lt;br /&gt;
       if(PERMISSION_TELEPORT &amp;amp;amp; vBitPermissions){&lt;br /&gt;
           osTeleportAgentPerm(avie, &amp;amp;lt;128.0,128.0,0.0&amp;amp;gt;,&lt;br /&gt;
 ZERO_VECTOR);&lt;br /&gt;
       } else {&lt;br /&gt;
           llSay(0, &amp;quot;You deny teleport permission&amp;quot;);&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
 &lt;br /&gt;
   touch_start(integer num_detected)&lt;br /&gt;
   {&lt;br /&gt;
       avie = llDetectedKey(0);&lt;br /&gt;
 &lt;br /&gt;
       llRequestPermissions(avie,&lt;br /&gt;
           PERMISSION_TELEPORT &amp;amp;#124;&lt;br /&gt;
           PERMISSION_TRIGGER_ANIMATION &amp;amp;#124;&lt;br /&gt;
           0);&lt;br /&gt;
       integer perm = llGetPermissions();&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
| Elwe Ewing&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osGetSimulatorStatus(string Simulator) &lt;br /&gt;
| Extended / Enhanced version of llGetSimulatorData. &lt;br /&gt;
Purpose: When an avatar is Teleported with osTeleportAgent, there is no check to see if a given simulator is available. If it's down, Agent is Teleported to NULL resulting in Agent being fragged and viewer broken, requiring a relog. This would be especially useful for HyperGrid Teleporting. Returns: integer &amp;quot;0 = DOWN&amp;quot;, &amp;quot;1 = UP&amp;quot;, &amp;quot;2 = UNKNOWN&amp;quot; Security: Would require some form of Throttle to prevent recurring requests of destination Simulator. Command: osGetSimulatorStatus(string Simulator) Where Simulator = &amp;quot;RegionName&amp;quot;, &amp;quot;IPAddress:PortNum&amp;quot;, &amp;quot;HostName:PortNum&amp;quot; &lt;br /&gt;
&lt;br /&gt;
| &lt;br /&gt;
 // CHecks if simulator is online before teleporting agent -kizmut&lt;br /&gt;
 &lt;br /&gt;
 string destination = &amp;quot;Wright Plaza&amp;quot;;&lt;br /&gt;
 &lt;br /&gt;
 default&lt;br /&gt;
 {&lt;br /&gt;
   state_entry()&lt;br /&gt;
   {&lt;br /&gt;
       llSay(0, &amp;quot;Touch to be teleported to: &amp;quot;+destination);&lt;br /&gt;
   }&lt;br /&gt;
   touch_start(integer num_detected)&lt;br /&gt;
   {&lt;br /&gt;
       llSay(0,llDetectedName(0)+&amp;quot; requesting teleport to: &amp;quot;+destination);&lt;br /&gt;
       integer sim_stat = osGetSimulatorStatus(destination);&lt;br /&gt;
       if (sim_stat == 2) {&lt;br /&gt;
           llSay(0, &amp;quot;Could not teleport to &amp;quot;+destination+&amp;quot;: Region status unknown.&amp;quot;);&lt;br /&gt;
       } &lt;br /&gt;
       else if (sim_stat) {&lt;br /&gt;
           osTeleportAgent(llDetectedKey(0),destination,ZERO_VECTOR);&lt;br /&gt;
       }&lt;br /&gt;
       else {&lt;br /&gt;
           llSay(0, &amp;quot;Could not teleport to &amp;quot;+destination+&amp;quot;: Region is down&amp;quot;);&lt;br /&gt;
       }&lt;br /&gt;
   }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
| WhiteStar Magic&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osTeleportOwner(string regionName, vector position, vector lookAt); &lt;br /&gt;
| Works similarly as osTeleportAgent but could only teleport the owner of the script itself. Would be very useful for HUD and would not require any authorization. &lt;br /&gt;
| integer error=osTeleportOwner(&amp;quot;Snoopies&amp;quot;,&amp;amp;lt;100,25,25&amp;amp;gt;,ZERO_VECTOR); &lt;br /&gt;
| Agnes Chalet &lt;br /&gt;
&amp;lt;br&amp;gt; &lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| string osName2Key(string name); &lt;br /&gt;
| A command which gives the UUID of an agent. Would work in the same way as llKey2Name, but in reverse. (Linden Lab may implement this first) &lt;br /&gt;
| osName2Key(&amp;quot;Bob Smith&amp;quot;); &lt;br /&gt;
| Drava&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| integer osHyperGrid(); &lt;br /&gt;
| Detects whether or not the region the person is in is Hypergrid enabled. Could be expanded to any region in the current grid. &lt;br /&gt;
| osHyperGrid() == TRUE &lt;br /&gt;
| Drava&lt;br /&gt;
|- style=&amp;quot;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| void osTurnAvatar(rotation rot); &lt;br /&gt;
| Turns an avatar about the vertical axis to rotation rot relative to the grid rotation. &lt;br /&gt;
| osTurnAvatar(newrot); // turns the avatar to the new rotation specified by newrot. &lt;br /&gt;
| Valradica&lt;br /&gt;
&lt;br /&gt;
|- style=&amp;quot;background-color:#CCFFCC;font-size:8pt;border-bottom:1px solid;&amp;quot; valign=&amp;quot;top&amp;quot;&lt;br /&gt;
| osRezLink(string inventory, vector position, vector velocity, rotation rot, integer param) ;&lt;br /&gt;
| osRezLink would work just like llRezObject but instead of a separate object it would be directly part of the original object's link system. This would be very useful in HUDs and attachments.&lt;br /&gt;
| osRezLink(&amp;quot;myobject&amp;quot;,llGetPos()+&amp;lt;0.0,0.0,0.5&amp;gt;,ZERO_VECTOR,ZERO_ROTATION,10);&lt;br /&gt;
| Nihlaeth&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
* [[LSL Status|LSL/OSSL Status Page]]&lt;br /&gt;
* LSL&lt;br /&gt;
** [[LSL Status/Types|LSL Types Status Page]]&lt;br /&gt;
** [[LSL Status/Events|LSL Events Status Page]]&lt;br /&gt;
** [[LSL Status/Functions|LSL Functions Status Page]]&lt;br /&gt;
** [[LSL_Status/functions/summary | LSL Functions Status Summary]]&lt;br /&gt;
** [[LSL_Known_Issues| LSL Known Issues]]&lt;br /&gt;
** [[Kan-Ed_Tests| Kan-Ed Tests]]&lt;br /&gt;
* OSSL&lt;br /&gt;
** [[OSSL Status/Types |OSSL Types Status Page]]&lt;br /&gt;
** [[OSSL Status/Events |OSSL Events Status Page]]&lt;br /&gt;
** [[OSSL_Proposals | OSSL Proposed Functions]]&lt;br /&gt;
** [[OSSL_Implemented | OSSL Implemented Functions]]&lt;br /&gt;
** [[OSSL_Standards | OSSL Standards]]&lt;br /&gt;
* [[Technical_Reference|Technical Reference Page]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Main]]&lt;br /&gt;
[[Category:Users]]&lt;br /&gt;
[[Category:Support]]&lt;br /&gt;
[[Category:Tech Reference]] &lt;br /&gt;
[[Category:Help]]&lt;br /&gt;
[[Category:Configuration]]&lt;br /&gt;
[[Category:Getting_Started]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Todo]]&lt;/div&gt;</summary>
		<author><name>Nihlaeth</name></author>	</entry>

	</feed>