Visualize JohnsonBot AI Neural Activity
Just a bit of code to put in a script, drop into the AI prim of a bot or wearable, will show you activity as floating text (above AI prim) with the function code changing the color of the text. I'm sure you all can come up with something even better! I stuck this into the ai prim of the demo Uma-E animesh over in West Mill if you want to check her out at http://maps.secondlife.com/secondlife/West%20Mill/112/53/4000
Click here to see my line of robotic hardware at the SL Marketplace
integer i0; integer i1; integer i2; integer i3; integer i4; integer i5;
string s; vector c; float a;
float d = 0.5;
default
{
state_entry()
{
}
link_message(integer l, integer n, string t, key id)
{ if(n == -2000)
{ if(a > 0.1) return; // very frequent so only show when nothing else up
}
llSetTimerEvent(1.);
i0 = llAbs(n);
i1 = llAbs(l+ (integer)llFrand(256))%256;
i2 = llAbs(n+ (integer)llFrand(256))%256;
i3 = llAbs(llStringLength(t)+(integer)llFrand(256))%256;
i4 = llAbs((((integer)llGetSubString("0x"+(string)id,0,3))+(integer)llFrand(256))%256);
i5 = llAbs((((integer)llGetSubString("0x"+(string)id,-8,-1))+(integer)llFrand(256))%256);
s = llGetSubString((string)i0+"x"+(string)i1+""+(string)i2+""+(string)i3+""+(string)i4+""+(string)i5,0,17);
c = <(float)(i0%5)+0.5,(float)(i0%7)+0.5,(float)(i0%3)>;
c = llVecNorm(c);
a = 1.;
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_TEXT,s,c,a]);
}
timer()
{ a = 0.9*a;
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_TEXT,s,c,a]);
llSetTimerEvent(d);
}
}
string s; vector c; float a;
float d = 0.5;
default
{
state_entry()
{
}
link_message(integer l, integer n, string t, key id)
{ if(n == -2000)
{ if(a > 0.1) return; // very frequent so only show when nothing else up
}
llSetTimerEvent(1.);
i0 = llAbs(n);
i1 = llAbs(l+ (integer)llFrand(256))%256;
i2 = llAbs(n+ (integer)llFrand(256))%256;
i3 = llAbs(llStringLength(t)+(integer)llFrand(256))%256;
i4 = llAbs((((integer)llGetSubString("0x"+(string)id,0,3))+(integer)llFrand(256))%256);
i5 = llAbs((((integer)llGetSubString("0x"+(string)id,-8,-1))+(integer)llFrand(256))%256);
s = llGetSubString((string)i0+"x"+(string)i1+""+(string)i2+""+(string)i3+""+(string)i4+""+(string)i5,0,17);
c = <(float)(i0%5)+0.5,(float)(i0%7)+0.5,(float)(i0%3)>;
c = llVecNorm(c);
a = 1.;
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_TEXT,s,c,a]);
}
timer()
{ a = 0.9*a;
llSetLinkPrimitiveParamsFast(LINK_THIS,[PRIM_TEXT,s,c,a]);
llSetTimerEvent(d);
}
}

Comments
Post a Comment