/////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2011 - License: CC BY 2.0 // // Please see: https://creativecommons.org/licenses/by/2.0 for legal details, // // rights of fair usage, the disclaimer and warranty conditions. // /////////////////////////////////////////////////////////////////////////// vector _iPos = ZERO_VECTOR; integer _targetID = 0; vector wasCirclePoint(float radius) { float x = llPow(-1, 1 + (integer) llFrand(2)) * llFrand(radius*2); float y = llPow(-1, 1 + (integer) llFrand(2)) * llFrand(radius*2); if(llPow(x,2) + llPow(y,2) <= llPow(radius,2)) return _iPos + ; return wasCirclePoint(radius); } moveTo(vector position) { llTargetRemove(_targetID); _targetID = llTarget(position, .8); llLookAt(position, .6, .6); llMoveToTarget(position, 3); } // Begin script. default { state_entry() { _iPos = llGetPos(); llSetStatus(STATUS_PHYSICS|STATUS_BLOCK_GRAB, TRUE); llVolumeDetect(TRUE); llSetForce(<0,0,9.81> * llGetMass(), 0); moveTo(wasCirclePoint(20)); } at_target(integer tnum, vector targetpos, vector ourpos) { if(tnum != _targetID) return; moveTo(wasCirclePoint(20)); } } // End script.