Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

PvP Logger

Yiffy Yaffle
Purple SpiritWolf Mystic
Join date: 22 Oct 2004
Posts: 2,802
07-01-2006 14:42
I hope this will help people untill LL decides to fix the problem... It's a PVP logger script i been using for about 6 months. My buddy Frost White and I worked together to make this. It is designed to be used in a HUD, not a listener (The original wasn't though)...

CODE

// THIS BUTTON TELLS YOU WHO HIT YOU.
default
{
touch_start(integer number)
{
llMessageLinked(LINK_SET,0,"listpvp",NULL_KEY);
}
}


CODE

// THIS BUTTON CLEARS THE LIST (CAN GET LONG, EVEN HALT THE SCRIPT AFTER A LENGTH).
default
{
touch_start(integer number)
{
llOwnerSay("Your PvP Abuse List has been cleared.");
llMessageLinked(LINK_SET,0,"clearpvp",NULL_KEY);
}
}


CODE

// THIS BUTTON TURNS THE SCRIPT ON/OFF.
default
{
touch_start(integer total_number)
{
llOwnerSay("Your PvP Abuse List has been turned on.");
llMessageLinked(LINK_SET,0,"PVPOn",NULL_KEY);
state otherway;
}
}
state otherway
{
touch_start(integer total_number)
{
llOwnerSay("Your PvP Abuse List has been turned off.");
llMessageLinked(LINK_SET,0,"PVPOff",NULL_KEY);
state default;
}
}


CODE

// THIS IS THE MAIN SCRIPT
list agent_avatar_list;
list agent_object_list;
integer toggle;
integer isNameOnAvatarList( string avatarname )
{
integer len = llGetListLength( agent_avatar_list );
integer i;
for( i = 0; i < len; i++ )
{
if( llList2String(agent_avatar_list, i) == avatarname )
{
return TRUE;
}
}
return FALSE;
}
integer isNameOnObjectList( string objectname )
{
integer len = llGetListLength( agent_object_list );
integer i;
for( i = 0; i < len; i++ )
{
if( llList2String(agent_object_list, i) == objectname )
{
return TRUE;
}
}
return FALSE;
}
default
{
state_entry()
{
toggle = TRUE;
}
collision_start(integer total_number)
{
if(toggle == TRUE)
{
if (llDetectedName(0) != llGetOwner())
{
integer type = llDetectedType(0);
if (type & AGENT)
{
string avatar_name = llDetectedName(0);
if( isNameOnAvatarList( avatar_name + " has bumped you with their avatar." ) == FALSE )
{
agent_avatar_list += avatar_name + " has bumped you with their avatar.";
llOwnerSay(avatar_name + " has bumped you with their avatar.");
}
}
else
{
if (type & ACTIVE)
{
string detected_owner = llKey2Name( llDetectedOwner(0) );
string detected_name = llDetectedName(0);
if( isNameOnObjectList( detected_owner + " has hit you with a Physical/Active Object named " + detected_name + "." ) == FALSE )
{
agent_object_list += detected_owner + " has hit you with a Physical/Active Object named " + detected_name + ".";
llMessageLinked(LINK_SET,0,"abusepvp " + (string)llDetectedOwner(0),NULL_KEY);
llOwnerSay(detected_owner + " has hit you with a Physical/Active Object named " + detected_name + ".");
}
}
}
}
}
}
link_message(integer sender_num, integer num, string message, key id)
{
if( message == "listpvp" )
{
integer i;
string origName = llGetObjectName();
llOwnerSay("These are the people who have bumped you with their avatar.");
llSetObjectName(">>");
integer len_two = llGetListLength( agent_avatar_list );
for( i = 0; i < len_two; i++ )
{
llOwnerSay( llList2String(agent_avatar_list, i) );
}
llOwnerSay("Total = " + (string)len_two );
llSetObjectName( origName );
llOwnerSay("These are the people who have hit you with a Physical/Scripted/Active Object.");
llSetObjectName(">>");
integer len_one = llGetListLength( agent_object_list );
for( i = 0; i < len_one; i++ )
{
llOwnerSay( llList2String(agent_object_list, i) );
}
llOwnerSay("Total = " + (string)len_one );
llSetObjectName( origName );
}
else if( message == "clearpvp" )
{
agent_object_list = llDeleteSubList(agent_object_list, 0, llGetListLength(agent_object_list));
agent_avatar_list = llDeleteSubList(agent_avatar_list, 0, llGetListLength(agent_avatar_list));
}
else if( message == "PVPOn" )
{
toggle = TRUE;
}
else if( message == "PVPOff" )
{
toggle = FALSE;
}
}
}
_____________________
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
07-03-2006 07:47
/54/ac/118136/1.html
_____________________
i've got nothing. ;)
Drizzt Naumova
Teh Foxeh DJ
Join date: 9 Oct 2005
Posts: 116
07-08-2006 09:31
Greetings :) I have used the above script to make a custom hud for myself and in the spirit of helping, I will give this out freely. Yiffy, I will send one out to you as well :) send one to frost for me as well. Any one needing a premade hud, just hit me up with an im in game and I'll be glad to send it out :) I kept the scripts open source as well and added a note card giving Yiffy and Frost the scripting credits :) Great Job you guys :D