ページ

2009/08/09

SIM負荷チェッカー

float checkRate=5.0;
string title="SIM PERF CHACKER";
vector lime=<0.00,1.00,0.00>;
vector yellow=<1.00,1.00,0.00>;
vector red=<1.00,0.00,0.00>;
vector white=<1.00,1.00,1.00>;

ShowPerformance() {

string simname=llGetRegionName();
float fps=llGetRegionFPS();
float timdilation=llGetRegionTimeDilation();
integer avatorcount=llGetRegionAgentCount();

vector color;
if (fps>35) color=lime;
else if (fps<20) color=red; else color=yellow; string str=title+"\n"; str+="Sim Name:"+simname+"\n"; str+="Avator Count:"+(string)avatorcount+"\n"; str+="Sim FPS:"+(string)fps+"\n"; str+="Time Dilation:"+(string)timdilation+"\n"; llSetText(str,white,1.0); llSetColor(color,ALL_SIDES); } default { state_entry() { llSetText(title,white,1.0); llSetColor(white,ALL_SIDES); llSetTimerEvent(checkRate); llSetPrimitiveParams([PRIM_BUMP_SHINY,ALL_SIDES,PRIM_SHINY_HIGH,PRIM_BUMP_NONE]); } on_rez(integer param){ llResetScript(); } touch_start(integer total_number) { state off; } timer() { ShowPerformance(); } } state off { state_entry() { llSetText(title+"\nOFF",white,1.0); llSetColor(white,ALL_SIDES); } on_rez(integer param){ llResetScript(); } touch_start(integer total_number) { state default; } }



スクリプト参照:http://zero2000.slmame.com/e703295.html

FPS値の値によって、下記の基準でオブジェクトの色を変化させます。
FPS 35以上    -> 緑
FPS 20以上 35未満-> 黄
FPS 20未満    -> 赤

だってさ~
置いてみたらSHOP Kもホームも緑だった