User:Toy Wylie/Misc/Script Memory

From Second Life Wiki
< User:Toy Wylie
Revision as of 07:39, 8 December 2011 by Toy Wylie (talk | contribs) (Started the page, just a small example up yet)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is an example on why Script Memory Reporters are a bad thing and can't provide the information a land owner is looking for. Banning or kicking people because of the reported script memory size is not helping the case. What we really need is an accurate reporting tool that does not rely on scripts playing nice but reports the true facts regardless of how the script was made.

<lsl>// This standard door script takes up 4412 bytes in Mono // and 16384 bytes in LSO. An outside script reporting tool // would report it as 65536 bytes in Mono and 16384 in LSO.

rotation home; integer isOpen=FALSE;

open() {

   if(isOpen)
       llSetLocalRot(home);
   else
   {
       home=llGetLocalRot();
       llSetLocalRot(home*llEuler2Rot(<0.0,0.0,90.0>*DEG_TO_RAD));
   }
   isOpen=!isOpen;

}

default {

   touch_start(integer total_number)
   {
       llOwnerSay((string) llGetUsedMemory());
       open();
   }

} </lsl>