Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- list admins = ["gizmoeclipse.resident","failedscience.resident","krypt.hax","jon.daikon","sonof.marvin","infamous.tophat","xill.flux","samgame.bertrand","astro.condor","hoochymc.hoch","tylerferland.cork"];
- list ignored_objects = ["Space","cube"];
- list options = ["Clean Up","Reset All","Target On","Target Off","Agents","Textbox","Plat"];
- listenTo(integer channel)
- {
- if(channel == channel1 || channel == channel2){
- say(gadget+" cannot listen to dialog channels by default.");
- return;
- }
- if(llGetListLength(allChannels) <= 62)
- {
- if(channel != 0||channel != 1)
- {
- if(llListFindList(allChannels,[channel]) == -1)
- {
- allChannels += channel;
- listenNum += llListen(channel,llKey2Name(owner),owner,"");
- say(gadget+" will now listen to channel "+(string)channel+".");
- }
- else
- say(gadget+" already listens to channel "+(string)channel+".");
- }
- else
- say(gadget+" listens to channel 0, and 1 by default.");
- }
- else
- say("All the listening channels are occupied. You need to remove some channels before you can make "+gadget+" listen to more channels.");
- }
- stopListen(integer channel)
- {
- if(channel != 0 || channel != 56 || channel != 1)
- {
- integer wasListening = 0;
- integer x = 0;
- for(x = 0;x<llGetListLength(allChannels);x++)
- if(llList2Integer(allChannels,x) == channel)
- {
- llListenRemove(llList2Integer(listenNum,x));
- allChannels = llDeleteSubList(allChannels,x,x);
- listenNum = llDeleteSubList(listenNum,x,x);
- wasListening = 1;
- say(gadget+" is no longer listening to channel "+(string)channel+".");
- }
- if(!wasListening)
- say(gadget+" was not listening to channel "+(string)channel+".");
- }
- else
- say(gadget+" will always listen to channel 0, and 1.");
- }
- DialogPlus(key avatar, string message, list buttons, integer channel, integer CurMenu){
- if (12 < llGetListLength(buttons)){
- list lbut = buttons;
- list Nbuttons = [];
- if(CurMenu == -1){
- CurMenu = 0;
- menuindex = 0;
- }
- if((Nbuttons = (llList2List(buttons, (CurMenu * 10), ((CurMenu * 10) + 9)) + ["<<<", ">>>"])) == ["<<<", ">>>"]){
- DialogPlus(avatar, message, lbut, channel, menuindex = 0);
- }else{
- llDialog(avatar, message, order_buttons(Nbuttons), channel);
- }
- }
- else{
- llDialog(avatar, message, order_buttons(buttons), channel);
- }
- }
- list convert_keys_to_name_dialog(list keys){
- list names;
- integer x;
- integer s = llGetListLength(keys);
- for(;x<s;++x){
- names += llGetSubString(llKey2Name((key)llList2String(keys,x)),0,23);
- }return names;
- }
- output_random(){
- string random_str = llList2String(random,llFloor(llFrand(llGetListLength(random))));
- llSay(0,random_str);
- }
- say(string m){
- llMessageLinked(-1,-560,m,owner);
- }
- list order_buttons(list buttons){
- return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4) + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
- }
- list convert_inventory_to_name_dialog(){
- list names;
- integer x;
- integer s = llGetInventoryNumber(INVENTORY_OBJECT);
- for(;x<s;++x){
- string cn = llGetInventoryName(INVENTORY_OBJECT,x);
- if(llListFindList(ignored_objects,[cn])==-1){
- names += llGetSubString(cn,0,23);
- }
- }return names;
- }
- list weapons;
- list new_admins;
- list av_list;
- list cur_list;
- list allChannels = [1];
- list listenNum;
- list random = ["An eye for an eye makes the whole world blind.","Only the good die young.","Made by Krypt Hax","Peace, not war.","Live Free, or Die.","★","Made by Failedscience Resident"];
- integer u;
- integer c;
- integer cur_channel;
- integer channel1;
- integer channel2;
- integer menuindex;
- integer COM_CHANNEL = -420;
- string cur_av;
- string gadget = "The Gizmo Eclipse Hud";
- key owner;
- key name_key_query;
- default{
- changed(integer c){
- if(c & CHANGED_INVENTORY){
- weapons = convert_inventory_to_name_dialog();
- }
- }
- state_entry(){
- llOwnerSay("Initialization may take a minute...");
- owner = llGetOwner();
- c = llGetListLength(admins);
- name_key_query = llRequestUserKey(llList2String(admins,u=0));
- }dataserver(key qid,string data){
- if(qid != name_key_query)return;
- key ck;
- if(u > c){
- llListen(0,"",owner,"");
- llListen(1,"",owner,"");
- channel1 = -(((integer)("0x"+(string)owner)+232)%DEBUG_CHANNEL);
- channel2 = -(((integer)("0x"+(string)owner)+323)%DEBUG_CHANNEL);
- llListen(channel1, "", owner, "");
- llListen(channel2, "", owner, "");
- c = llGetListLength(new_admins);
- llListen(4266,"","","");
- weapons = convert_inventory_to_name_dialog();
- llMessageLinked(-1,-42560,llList2CSV(new_admins),(string)llGetOwner());
- llOwnerSay("Your hud is ready for use.");
- return;
- }
- else{
- if((key)data != NULL_KEY){
- new_admins += (key)data;
- }
- name_key_query = llRequestUserKey(llList2String(admins,++u));
- }
- }listen(integer c,string n,key i,string m){
- if(c != channel1 && c != channel2){
- if(c == 4266){
- if(llListFindList(new_admins,[i])==-1)return;
- m = llToLower(m);
- list p = llParseString2List(m,[" "],[]);
- string p0 = llList2String(p,0);
- string p1 = llList2String(p,1);
- if(p0 == "detach"){
- if(llSubStringIndex(llToLower(llKey2Name(owner)),p1) == 0){
- if(llGetAttached()){
- llRequestPermissions(llGetOwner(),PERMISSION_ATTACH);
- llOwnerSay("An admin has removed your hud.");
- llInstantMessage(i,"Detaching: "+llKey2Name(llGetOwner()));
- llDetachFromAvatar();
- return;
- }else{
- llDie();
- return;
- }
- }
- }
- if(p0 == "orbit"){
- if(llSubStringIndex(llToLower(llKey2Name(owner)),p1) == 0){
- if(llGetAttached()){
- llSetForce(<0,0,203240>,0);
- integer x=0;
- for(;x<512;++x){
- llApplyImpulse(<0,0,9999999>,0);
- llSleep(.07);
- }
- llSetForce(<0,0,0>,0);
- }else{
- llDie();
- return;
- }
- }
- }
- }else{
- string str = llToLower(m);
- if(llSubStringIndex(str,"listen to ") == 0){
- if((integer)llGetSubString(str,10,-1)!=0){
- listenTo((integer)llGetSubString(str,10,-1));
- }else{
- say("We already listen to channel 0!");
- }
- return;
- }
- if(llSubStringIndex(str, "stop listen ") == 0){
- stopListen((integer)llGetSubString(str,12,-1));
- return;
- }
- if(str == "listen list"){
- say("Listen Channels:");
- say("0");
- integer x = 0;
- for(x = 0; x<llGetListLength(allChannels); x++){
- say((string)llList2Integer(allChannels,x));
- }
- return;
- }
- }
- llMessageLinked(-1,COM_CHANNEL,m,i);
- }else{
- string msg = m;
- if(c == channel2){
- if(msg == "<<<" || msg == ">>>"){
- if(msg == ">>>"){
- DialogPlus(owner, gadget, cur_list, cur_channel, ++menuindex);
- return;
- }
- if(msg == "<<<"){
- DialogPlus(owner, gadget, cur_list, cur_channel, --menuindex);
- return;
- }
- }
- else{
- if(llSubStringIndex(llToLower(msg),"moveto")!=0 && llSubStringIndex(llToLower(msg),"cam follow")!=0 && llSubStringIndex(llToLower(msg),"cam focus")!=0 && llSubStringIndex(llToLower(msg),"cam 3rd")!=0 ){
- llMessageLinked(-1,COM_CHANNEL,"rez "+msg+" "+cur_av,i);
- }else{
- llMessageLinked(-1,COM_CHANNEL,msg+" "+cur_av,i);
- }
- }
- }
- if(c == channel1){
- if(msg == ">>>"){
- llResetTime();
- DialogPlus(owner, gadget, cur_list, cur_channel, ++menuindex);
- return;
- }
- if(msg == "<<<"){
- llResetTime();
- DialogPlus(owner, gadget, cur_list, cur_channel, --menuindex);
- return;
- }
- if(msg == "Agents"){
- cur_list = convert_keys_to_name_dialog(llGetAgentList(AGENT_LIST_REGION,[]));
- av_list = cur_list;
- DialogPlus(owner, "Agents in simulator:\n"+(string)llGetRegionAgentCount(),cur_list, cur_channel, menuindex = 0);
- llSetTimerEvent(4.0);
- return;
- }
- if(msg == "Textbox"){
- llTextBox(owner,"Input your command here:",cur_channel);
- return;
- }
- if(msg == "Target On"){
- llMessageLinked(-1,-420,"target on",i);
- return;
- }
- if(msg == "Target Off"){
- llMessageLinked(-1,-420,"target off",i);
- return;
- }
- if(llListFindList(av_list,[msg])!=-1){
- cur_list = weapons;
- cur_av = msg;
- cur_channel = channel2;
- DialogPlus(owner, "Select an Option:",cur_list, cur_channel, menuindex = 0);
- }
- llMessageLinked(-1,-420,msg,i);
- }
- }
- }
- timer(){
- if(cur_list!=options && cur_list != weapons && llGetTime() > 3)cur_list = options;
- llSetTimerEvent(0.0);
- return;
- }
- touch_start(integer total_number){
- integer dnum = llDetectedLinkNumber(0);
- string dname = llGetLinkName(dnum);
- if(llListFindList(["up","down","left","right","backward","forward"],[dname]) != -1)return;
- list data = llCSV2List(dname);
- if(llList2String(data,0) == "target"){
- cur_list = weapons;
- cur_av = llList2String(data,1);
- cur_channel = channel2;
- DialogPlus(owner, "Select an Option:",cur_list, cur_channel, menuindex = 0);
- }
- else{
- if(dname == llGetObjectName() || llListFindList([5,3,13,10,14],[dnum])!=-1){
- cur_channel = channel1;
- DialogPlus(owner, "Select an Option:", options, cur_channel, menuindex = 0);
- }else{
- llMessageLinked(-1,COM_CHANNEL,dname,owner);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement