02-18-2013, 02:13 AM
1. Rez a prim, copy/paste this script inside:named: chanscanshape
2) Copy/paste this script inside the prim: channelscanner
3. Copy/paste this script inside the prim and duplicate it much once than necessary -each copy adds 64 channels-named: buga.. (Bugas,Bugas1,Bugas2,Bugas3,Bugas4,etc..
PHP Code:
default
{
state_entry()
{
llSetPrimitiveParams([
PRIM_NAME, "Channel Scanner HUD",
PRIM_DESC, "(No Description)",
PRIM_COLOR, ALL_SIDES, <1.0,1.0,1.0>, 0.5,
PRIM_FULLBRIGHT, ALL_SIDES, TRUE,
PRIM_GLOW, ALL_SIDES, 0.03,
PRIM_TYPE, PRIM_TYPE_BOX, PRIM_HOLE_DEFAULT, <0.0,1.0,0.0>, 0.0, <0.0,0.0,0.0>, <0.35,1.0,0.0>, <0.0,0.0,0.0>,
PRIM_SIZE, <0.12,0.035,0.01>,
PRIM_PHANTOM, TRUE,
PRIM_ROTATION, llEuler2Rot(< 0.0, 270, 270> * DEG_TO_RAD),
PRIM_TEXTURE, 1, "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903",<1.0,1.0,0.0>, <0.0,0.0,0.0>, 0.0,
PRIM_TEXTURE, 3, "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903",<1.0,1.0,0.0>, <0.0,0.0,0.0>, 0.0,
PRIM_TEXTURE, 5, "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903",<1.0,1.0,0.0>, <0.0,0.0,0.0>, 0.0,
PRIM_TEXTURE, 0, "cf1786d2-2468-5283-bac7-4fdac718054d",<0.33,1.0,0.0>, <0.0,0.0,0.0>, 0.0,
PRIM_TEXTURE, 2, "cf1786d2-2468-5283-bac7-4fdac718054d",<0.33,1.0,0.0>, <0.33,0.0,0.0>, 4.71,
PRIM_TEXTURE, 4, "cf1786d2-2468-5283-bac7-4fdac718054d",<0.33,1.0,0.0>, <-0.33,0.0,0.0>, 1.57]);
llRemoveInventory(llGetScriptName());
}
}
2) Copy/paste this script inside the prim: channelscanner
PHP Code:
integer Switch = FALSE;
integer touchedFace;
integer gStride = 9;
integer startChan;
integer myChannel;
integer switch=0;
integer gPos = 0;
integer oListen;
integer Handle;
integer num;
integer x;
list MainButtons = ["Obj>Scanner", "•","Obj>Listen","•","HELP","•"];
list ListenButtons = ["<<Back","•","•","-ON-","<<•>>","-OFF-"];
list fullname;
list names;
list mass;
list dkey;
list pos;
key ObjectOwner;
key OwnerKey;
key owner;
key Check;
key Spam;
key name;
string scanState = "OFF";
string ObjectName;
string Message;
float Range = 96.0;
Off()
{
scanState = "OFF";
for (x = 1; x <= num; x ++)
llMessageLinked(LINK_THIS, x, "stop", "");
llSetColor(llGetColor(1),touchedFace);
llOwnerSay("/me >> Channels no longer being scanned.");
}
On()
{
scanState = "ON";
for (x = 1; x <= num; x ++)
llMessageLinked(LINK_THIS, x, "start", (string)startChan);
num = llGetInventoryNumber(INVENTORY_SCRIPT) - 1;
integer endChan;
if (startChan > 0)
endChan = startChan + (num*64);
else
endChan = startChan - (num*64);
llSetColor(<0,1,0>,touchedFace);
llOwnerSay("/me • Scanning Channels from " + (string)startChan + " to " + (string)endChan + " •
(64 channels per slave script; "+(string)num + " Slaves detected.(you can add more slaves!))");
}
Listen()
{
llListenRemove(Handle);
llSetTimerEvent(60.0);
Handle = llListen(myChannel, "", owner, "");
}
MainMenu()
{
llDialog(owner, "
*Obj-Listen = Listen to objects speaking, lets you know who is using objects, like this hud's \"Mimic\" option for example ;)
*Obj-Scanner = Scan for nearby objects, chat spies etc.
(Tip; Small (by mass) invisible objects following you are probly spies ;)", MainButtons, myChannel);
}
ObjListenMenu()
{
llDialog(owner, "\nObject listen will let you know the name of the object talking & the name of the person using an object to talk.\n (like this HuDs mimic option for eg;)", ListenButtons, myChannel);
}
SensorMenu()
{
integer nTop = gPos + gStride - 1;
list buttons = llList2List(names, gPos, nTop);
string msg = llDumpList2String(buttons, "\n");
while(llGetListLength(buttons) % 3 != 0)
{
buttons = llListInsertList(buttons, [" "], gStride);
}
if (gPos >= gStride)
{
buttons += ["<<•"];
}
if (nTop - 1 < llGetListLength(names))
{
buttons += ["•>>"];
}
llDialog(owner, "
Objects Detected; Closest shown first, "+(string)((integer)Range)+"m range.", buttons, myChannel);
}
Help()
{
llTriggerSound("96aeb4f2-3d59-dd37-cfa9-763614695b61",1.0);
llOwnerSay("/me ^^ Object & Channel Scanner/Listen Help/Info ^^
*Object-Listen = Listen to objects speaking, this is great for finding out who is using an object to speak.
Options like this HuD's \"Mimic\" will use an object to speak, trying to make it harder to see who said what.
*Object-Scanner = Scan for nearby objects, it has a max range of 96 meters.
Great for finding out who owns an object following you or lost prims etc.
*Channel Scanner = Listen to chatter on different channels.
Simply add more of the multiple scripts in the hud to scan more channels, making sure only the numbers look right =)
So this prims inventory should look something like Slave 1, Slave 2, Slave 3, etc etc
(Trick is to take one of the slave scripts, remove its number, then drop it into the prim again.. It will number itself ;)");
}
default
{
state_entry()
{
owner = llGetOwner();
myChannel = (integer)llFrand(DEBUG_CHANNEL) * -1;
}
changed(integer change)
{
if(change & CHANGED_OWNER)
{
llResetScript();
}
}
timer()
{
llSetTimerEvent(0.0);
llListenRemove(Handle);
}
link_message(integer sender_num, integer num, string str, key id)
{
if (str == "CHANNELSCANNER"&&id =="MENU")
{
Listen();
llSensor("", NULL_KEY, SCRIPTED|ACTIVE|PASSIVE, 96.0, PI);
}
}
sensor(integer num_detected)
{
names = [];
fullname = [];
dkey = [];
gPos = 0;
integer i;
for (i = 0; i < num_detected; i++)
{
names = names + llGetSubString(llDetectedName(i),0,23);
fullname = fullname + llDetectedName(i);
dkey = dkey + llDetectedKey(i);
pos = pos + llDetectedPos(i);
mass = mass + llGetObjectMass(llDetectedKey(i));
}
SensorMenu();
}
no_sensor()
{
llOwnerSay("/me >> Nothing detected within "+(string)((integer)Range)+"m ~");
llSetTimerEvent(1.0);
}
listen(integer channel, string name, key id, string message)
{
if (llListFindList(MainButtons + ListenButtons, [message]) != -1)
{
if (message == "<<Back")
{
MainMenu();
}
else if (message == "Obj>Scanner")
{
llSensor("", NULL_KEY, SCRIPTED|ACTIVE|PASSIVE, Range, PI);
}
else if (message == "Obj>Listen")
{
ObjListenMenu();
}
else if (message == "-ON-")
{
switch=1;
llSetTimerEvent(0.0);
llListenRemove(Handle);
oListen = llListen(0,"",NULL_KEY,"");
OwnerKey = llGetOwner();
llListenControl( oListen,TRUE);
llTriggerSound("2a8c8ac7-7b13-c9bf-cd97-c4019df9ad6a",1.0);
llSetColor(<.7,255,.7>,touchedFace);
llOwnerSay("/me : Object Listen : ON :");
}
else if (message == "-OFF-")
{
switch=0;
llListenControl( oListen,FALSE);//~
llListenRemove( oListen);
llTriggerSound("4590600b-b53d-df89-d2b2-33d9e509a795",0.2);
llSetColor(llGetColor(1),touchedFace);
llOwnerSay("/me : Object Listen : OFF :");
}
else if (message == "HELP")
{
Help();
}
}
if (message == "•>>")
{
gPos = gPos + gStride;
SensorMenu();
}
else if (message == "<<•")
{
gPos = gPos - gStride;
SensorMenu();
}
integer num = llListFindList(names,[message]);
if(num != -1)
{
llOwnerSay("\nName == "+ llList2String(fullname,num)
+"\nKey/UUID == "+ llList2String(dkey,num)
+"\nPosition == "+ llList2String(pos,num)
+"\nObject Mass == "+ llList2String(mass,num));
ObjectOwner = llGetOwnerKey(llList2String(dkey,num));
Check = llRequestAgentData(ObjectOwner,DATA_NAME);
}
else
{
ObjectName = name;
Message = message;
ObjectOwner = llGetOwnerKey(id);
if ( llGetAgentSize(id) != ZERO_VECTOR ) return;
Spam = llRequestAgentData(ObjectOwner,DATA_NAME);
}
}
dataserver(key id, string data)
{
if (id==Spam)
{
llOwnerSay("/me ^^Object Spam Detected^^
•Owner = " +data+ " •Name of Object = " + ObjectName );
llSleep(4.0);
}
else if(id == Check)
{
llOwnerSay("/me >> Owner >> " +data);
}
}
touch_start(integer num_detected)
{
integer i;
for (i = 0; i < num_detected; i++)
{
touchedFace = llDetectedTouchFace(i);
if (touchedFace == -1)
{
llOwnerSay("/me >> Sorry, your viewer doesn't support touched faces;");
}
else if (touchedFace == 0)
{
Listen();
MainMenu();
}
else if (touchedFace == 4)
{
startChan = 1;
llSetColor(llGetColor(0),2);
if (Switch == FALSE)
{
Switch = TRUE;
On();
}
else if(Switch == TRUE)
{
Switch = FALSE;
Off();
}
}
else if (touchedFace == 2)
{
startChan = -1;
llSetColor(llGetColor(0),4);
if (Switch == FALSE)
{
Switch = TRUE;
On();
}
else if (Switch == TRUE)
{
Switch = FALSE;
Off();
}
}
}
}
}
3. Copy/paste this script inside the prim and duplicate it much once than necessary -each copy adds 64 channels-named: buga.. (Bugas,Bugas1,Bugas2,Bugas3,Bugas4,etc..
PHP Code:
integer chanStart;
integer firstChan;
integer positive;
integer chanEnd;
integer channel;
string thread;
default
{
state_entry()
{
thread = llGetScriptName();
integer d = llSubStringIndex(thread, " ");
channel = (integer)llGetSubString(thread, d, -1);
}
changed(integer change)
{
if(change & CHANGED_OWNER)
{
llResetScript();
}
}
link_message(integer sender_num, integer num, string str, key id)
{
if (num == channel)
{
if (str == "start")
{
integer x;
firstChan = (integer)((string)id);
if (firstChan > 0)positive = TRUE;
if (positive)
{
chanStart = firstChan + (channel - 1) * 64;
chanEnd = chanStart + 63;
}
else
{
chanStart = firstChan - (channel - 1) * 64;
chanEnd = chanStart - 63;
}
if (positive)
for (x = (chanStart); x < (chanEnd + 1); x ++)
{
llListen(x, "", NULL_KEY, "");
}
else
for (x = (chanStart); x > (chanEnd - 1); x --)
{
llListen(x, "", NULL_KEY, "");
}
}
else if(str == "stop")
{
llResetScript();
}
}
}
listen(integer channel, string name, key id, string message)
{
llOwnerSay("/me ^^Chatter Detected^^
•Owner = " + llKey2Name(llGetOwnerKey(id)) + " •Channel = " + (string)channel + " •Object Name = " + name + " •Object Key = " + (string)id + "\n •Message = " + message);
}
}