key reportid; string saidname; list oblivion; list onames; integer function; //Function List //------------- //<1> Map //<2> Avatar Query //<3> Hold //<4> Add To Oblivion // //------------- obliviate(key id, string name) { integer foundpos = llListFindList(oblivion,[id]); if(foundpos == -1) { //llOwnerSay("Added "+llKey2Name(id)+" to halo list."); oblivion = llListInsertList(oblivion,[id],0); onames = llListInsertList(onames,[name],0); //These linked messages supply the list of the obliviated to the script that rezzes the killers. llMessageLinked(LINK_SET,909,llList2CSV(oblivion),NULL_KEY); } } string rescue(integer index) { string rname = llList2String(onames,index); key rkey = llList2Key(oblivion,index); //llOwnerSay("Removed "+llKey2Name(id)+" from halo list."); oblivion = llListReplaceList(oblivion,[],index,index); onames = llListReplaceList(onames,[],index,index); llMessageLinked(LINK_SET,909,llList2CSV(oblivion),NULL_KEY); llRegionSay(5713,(string)rkey+"UKi Destroy"); return rname; } integer check_oblivion(string saidname) { integer check; integer total = llGetListLength(oblivion); string checkname = llToLower(llGetSubString(llList2String(oblivion,check),0,llStringLength(saidname)-1)); while(checkname != saidname && check < total - 1) { check += 1; checkname = llToLower(llGetSubString(llList2String(oblivion,check),0,llStringLength(saidname)-1)); } if(checkname == saidname) { return(check); } else { return(-1); } } default { state_entry() { llListen(5380,"Sim Grid",NULL_KEY,""); } sensor(integer num_detected) { if(num_detected > 0) { integer checknum = 0; if(function == 1 || function == 3 || function == 4 || function == 5) //Add "|| function == #" for each command that will search for one specific avatar. { string checkname = llToLower(llGetSubString(llDetectedName(checknum),0,llStringLength(saidname)-1)); while(checkname != saidname && checknum < num_detected - 1) { checknum += 1; checkname = llToLower(llGetSubString(llDetectedName(checknum),0,llStringLength(saidname)-1)); } if(checkname == saidname) { vector otherpos = llDetectedPos(checknum); vector fwd = llRot2Fwd(llDetectedRot(checknum)); if(function == 1) { otherpos -= fwd; llRegionSay(5381,(string)reportid+llDetectedName(checknum)+" is currently at "+(string)otherpos+"."); } else if(function == 3) { otherpos -= fwd*5; llRezObject("Axis Trap",llGetPos(),ZERO_VECTOR,ZERO_ROTATION,2); llSay(5387,(string)llDetectedKey(checknum)); llRegionSay(5381,(string)reportid+llDetectedName(checknum)+" has been located at "+(string)otherpos+", and has been attemptedly trapped."); } else if(function == 4) { otherpos -= fwd; obliviate(llDetectedKey(checknum),llDetectedName(checknum)); llRegionSay(5381,(string)reportid+llDetectedName(checknum)+" was located at "+(string)otherpos+", and has been obliviated."); //When the core gets this, it regionsays "tobliviate:"+"listpos1"+"listpos2" if listpos0 == "OMSG". llRegionSay(5380,llList2CSV(["OMSG",llDetectedKey(checknum),llDetectedName(checknum)])); } } } if(function == 2) { list nearbyavs = [reportid]; while(checknum < num_detected) { nearbyavs = llListInsertList(nearbyavs,[llDetectedName(checknum)],0); checknum += 1; } llRegionSay(5380,llList2CSV(nearbyavs)); } } } listen(integer channel, string name, key id, string msg) { integer comindex = llSubStringIndex(msg,":"); string cmd = llGetSubString(msg,0,comindex); if(cmd == "map:") { function = 1; reportid = (key)llGetSubString(msg,comindex+1,comindex+36); saidname = llGetSubString(msg,comindex+37,llStringLength(msg)-1); llSensor("",NULL_KEY,AGENT,200000,7000*PI); } else if(cmd == "query:") { function = 2; reportid = (key)llGetSubString(msg,comindex+1,comindex+36); llSensor("",NULL_KEY,AGENT,200000,7000*PI); } else if(cmd == "hold:") { function = 3; reportid = (key)llGetSubString(msg,comindex+1,comindex+36); saidname = llGetSubString(msg,comindex+37,llStringLength(msg)-1); llSensor("",NULL_KEY,AGENT,200000,7000*PI); } else if(cmd == "obliviate:") { function = 4; reportid = (key)llGetSubString(msg,comindex+1,comindex+36); saidname = llGetSubString(msg,comindex+37,llStringLength(msg)-1); llSensor("",NULL_KEY,AGENT,200000,7000*PI); } else if(cmd == "rescue:") { reportid = (key)llGetSubString(msg,comindex+1,comindex+36); saidname = llGetSubString(msg,comindex+37,llStringLength(msg)-1); integer index = check_oblivion(saidname); if(index != -1) { string resname = rescue(index); //When the core gets this, it regionsays reportid+msg on channel 5381. Make sure the halos will support this. Also, fix up the transporters and transport function (to be "tran"). llRegionSay(5380,llList2CSV(["RMSG",reportid,resname,"The avatar "+resname+" has been rescued from oblivion."])); } } else if(cmd == "tobliviate:") { //The core returns this after getting the regionsay from a different agent. This is the exact same format as the other commands (which is "key"+"name") except that the name it supplies is the full name and the key is the key of the thing to obliviate. key cid = (key)llGetSubString(msg,comindex+1,comindex+36); string cname = llGetSubString(msg,comindex+37,llStringLength(msg)-1); obliviate(cid,cname); } } }