Welcome, Guest |
You have to register before you can post on our site.
|
Forum Statistics |
» Members: 103,110
» Latest member: Divaloulou
» Forum threads: 25,613
» Forum posts: 77,024
Full Statistics
|
|
|
Track Avatar away from SIM |
Posted by: Optimus Prime - 03-04-2013, 03:11 AM - Forum: Avatar Augmentation Scripts
- No Replies
|
|
Code: // Tracks avatars when they teleport away from a sim. A script that will, in an object, follow someone if they teleport -
// and report back to you where they went (in global co-ords it goes and gets them, even on islands).
// Using a hack in llGetObjectDetails
// it should be noted that this example will stop working when SVC-774 is implemented
// more info: http://jira.secondlife.com/browse/SVC-774
//
// Author: unknown
//
//
.
//This script was made by some sandbox goers when llGetObjectDetails first came out.
//This is actually derived from Jana Kamachi's version of the sandbox script
//(although she is not the original script's creator) - messed around with by yours truely ;)
list keys = [];
vector last = <0,0,0>;
default
{
state_entry(){
llListen(3,"",llGetOwner(),"");
llSensorRepeat("",NULL_KEY,AGENT,96,PI*2,1);
llSetTimerEvent(0.00001);
}
timer(){
integer i=0;
list temp;
vector raw;
@home;
for(i=0;i<llGetListLength(keys);i++){
temp = llGetObjectDetails(llList2Key(keys,i),[OBJECT_POS]);
raw = llList2Vector(temp,0);
if((raw.x > 256 || raw.x < 0) || (raw.y > 256 || raw.y <0)){
llOwnerSay(llKey2Name(llList2Key(keys,i)) + " has left the sim to " + (string)raw);
last = raw;
keys = llDeleteSubList(keys,i,0);
jump home;
}
}
}
sensor(integer n_m){
integer i=0;
for(i=0;i<n_m;i++){
if(llListFindList(keys,[llDetectedKey(i)])==-1){
keys+=[llDetectedKey(i)];
llOwnerSay("Indexed: " + llKey2Name(llDetectedKey(i)));
}
}
}
changed(integer c){
if(c == CHANGED_TELEPORT){
keys = [];
}
}
touch_start(integer n_m){
llMapDestination(llGetRegionName(),last,<0,0,0>);
}
listen(integer c, string name, key id, string msg){
llMapDestination(llGetRegionName(),(vector)msg,<0,0,0>);
}
}
|
|
|
ZeroFlight XLR8 |
Posted by: YoungMoney - 03-04-2013, 02:08 AM - Forum: Avatar Augmentation Scripts
- No Replies
|
|
Enhances fly. Makes is faster. Less down drifting.
Drop this script in whatever prim (ring, hair,...) and wear it. Chat controlled.
Code: //ZeroFlight XLR8
//hacked together script by Burke Prefect, peices from other people's code.
//NOT RESPONSIBLE... FOR ANYTHING
float speed = 15; // this is starting speed.
set_hover() // this keeps you from falling at extreme altitudes. just 'fly' normally. works in either mode.
{
vector pos = llGetPos();
float ground = llGround(<0,0,0>);
if(llGetAgentInfo(llGetOwner()) & AGENT_FLYING)
{
if((pos.z > 75) && (pos.z > (ground + 35)))
{
llSetForce(<0,0,9.8> * llGetMass(), FALSE);
}
else
{
llSetForce(<0,0,0>, FALSE);
}
}
else
{
llSetForce(<0,0,0>, FALSE);
}
}
default // this is where the script starts off. it's not active, it's just waiting for a command.
{
state_entry()
{
key id = llGetOwner();
llListen(0,"",id,"");
llSetTimerEvent(.5);
llReleaseControls();
}
timer()
{
set_hover();
}
listen( integer channel, string name, key id, string message ) {
if (message == "fly")
state freakpack;
}
}
//// By making 'freakpack' it's own state, we can control it much easier.
state freakpack
{
state_entry()
{
llSetTimerEvent(.5);
llListen(0,"",llGetOwner(),"");
llRequestPermissions(llGetOwner(),PERMISSION_TAKE_CONTROLS);
}
// on_rez(integer total_number)
//{llResetScript();}
touch_start(integer total_number)
{
if (llDetectedKey(0) == llGetOwner())
{
llReleaseControls();
state default;
}
}
timer()
{
set_hover();
}
run_time_permissions(integer perm)
{
if(perm & PERMISSION_TAKE_CONTROLS)
{
llTakeControls(CONTROL_FWD|CONTROL_BACK|CONTROL_LEFT|CONTROL_RIGHT|CONTROL_UP|CONTROL_DOWN,TRUE,TRUE);
}
}
control(key av, integer level, integer edge)
{
if(level & CONTROL_UP)
{
llApplyImpulse(<0,0,speed*3>,FALSE);
}
if(level & CONTROL_DOWN)
{
llApplyImpulse(<0,0,-speed*3>,FALSE);
}
if(level & CONTROL_LEFT)
{
if(llGetAgentInfo(llGetOwner()) & AGENT_FLYING)
{ llApplyImpulse(<0,speed,0>,TRUE);}
}
if(level & CONTROL_RIGHT)
{
if(llGetAgentInfo(llGetOwner()) & AGENT_FLYING)
{llApplyImpulse(<0,-speed,0>,TRUE);}
}
if(level & CONTROL_FWD)
{
if(llGetAgentInfo(llGetOwner()) & AGENT_FLYING)
{llApplyImpulse(<speed,0,0>,TRUE);}
}
if(level & CONTROL_BACK)
{
if(llGetAgentInfo(llGetOwner()) & AGENT_FLYING)
{llApplyImpulse(<-speed,0,0>,TRUE);}
}
}
timer()
{
if(llGetAgentInfo(llGetOwner()) & AGENT_FLYING)
set_hover();
else {
llReleaseControls();
state default;
}
}
changed(integer change)
{
llReleaseControls();
state default;
}
listen(integer channel, string name, key id, string m)
{
string ml = llToLower(m);
list parsed = llParseString2List(ml,[" "],[]);
if(llList2String(parsed,0) == "speed")
{
speed = (float)llList2String(parsed,1);
}
if (m=="fly")
{
llReleaseControls();
state default;
}
}
}
|
|
|
Avatar Title Changer |
Posted by: YoungMoney - 03-04-2013, 02:04 AM - Forum: Avatar Augmentation Scripts
- No Replies
|
|
// Changes avatar hovering title on command in local chat, starting with /change. Put the script in a small box and texture the box with a 100% transparent texture. Attach the box to your upper body (head or schoulder).
Code: // Avatar Title Changer
// author: unknown
string default_text = "Type /change to change the hovering text!";
string text;
list colors =
[<1.0,1.0,1.0>,<0.5,0.5,0.5>,<1,0,0.0,0.0>,<0.0,1.0,0.0>,<0.0,0.0,1.0>,<1.0,1.0,0.0>,
<1.0,0.0,1.0>,<0.0,1.0,1.0>];
default
{
state_entry()
{
text = default_text;
llListen(0, "", NULL_KEY, "");
llSetText(text, <0,1,0>, 1.5);
llSetTimerEvent(0.5);
}
on_rez(integer start_param)
{
text = default_text;
llSetText(text, <0,1,0>, 1.5);
}
listen(integer channel, string name, key id, string message)
{
if (llToLower(llGetSubString(message, 0, 6)) == "/change" && id == llGetOwner())
{
text = llDeleteSubString(message, 0, 6);
llSetText(text, <0,1,0>, 1.5);
}
}
timer()
{
integer random = llFloor(llFrand(llGetListLength(colors)));
llSetText(text, llList2Vector(colors,random), 1.5);
}
}
|
|
|
Drink Animation Script |
Posted by: YoungMoney - 03-04-2013, 02:02 AM - Forum: Avatar Augmentation Scripts
- Replies (2)
|
|
Code: // Triggers drink animation
// Asks permission of avatar first
// Author: unknow
default
{
run_time_permissions(integer perm)
{
if (perm)
{
llAttachToAvatar(ATTACH_RHAND);
llStartAnimation("drink");
}
}
attach(key on)
{
if (on != NULL_KEY)
{
integer perm = llGetPermissions();
if (perm != (PERMISSION_TRIGGER_ANIMATION | PERMISSION_ATTACH))
{
llRequestPermissions(on, PERMISSION_TRIGGER_ANIMATION | PERMISSION_ATTACH);
}
else
{
llStartAnimation("drink");
}
}
else
{
llStopAnimation("drink");
}
}
}
|
|
|
|