OpenSimMirror/bin/script1.txt

34 lines
723 B
Plaintext

<Script><ScriptEngine:OpenSimJVM,Test1>public class Test1 {
public static void OnFrame()
{
int own = 0;
own = OpenSimAPI.GetEntityID();
int avid = OpenSimAPI.GetRandomAvatarID();
float x = OpenSimAPI.GetEntityPositionX(own);
float avx = OpenSimAPI.GetEntityPositionX(avid);
float y = OpenSimAPI.GetEntityPositionY(own);
float avy = OpenSimAPI.GetEntityPositionY(avid);
if(x> avx)
{
x = x -1f;
}
else
{
x = x+ 1f;
}
if(y > avy)
{
y= y -1f;
}
else
{
y = y +1f;
}
OpenSimAPI.SetEntityPosition(own, x, y, 0);
}
}</Script>