Super Spengbab

From Pool's Closed Wiki
Jump to: navigation, search

An upgraded spengbab cube designed by Afroduck. Commands are given on a negative channel that isn't as often monitored by HUDs. You can use the Afro Relay script to communicate with it. All these additions had to be worked out from scratch cause nobody will give away interesting information or they demand spacebux for it. Well, now everyone can see them for free. Haha!

Available commands:

  • spengbab target <avatar name> - targets an avatar
  • spengbab pwn <avatar name> - this uses a single command to make the spengbab(s) scream, enable z-axis and sends them after the avatar
  • spengbab autoreturn
  • spengbab enable z-axis - allows movement in 3 dimensions
  • spengbab scream - AAAAAHHAAAAHHHHHAAAAAHAHAHAHAHHHHH
  • spengbab noscream - ......
  • spengbab getaids - deletes the spengbab

When initially rezzed, the spengbab cubes will simply sit and slowly spin until you give them a command.

Super Spengbab v1.3

<lsl> // Super Spengbab v1.3 // Made by Afroduck // Just for educational purposes // Of course

float gAutoreturn = 600; integer gActive_z_axis = FALSE; integer gScream = FALSE; string gTarget = ""; integer gTransIdSend = 0; integer gTransIdReceive = 0; integer gTransferComplete = FALSE; string gChild_key = ""; integer gAntiNoob = FALSE;

default {

   on_rez(integer start_param)
   {
       gAutoreturn = 600;
       gActive_z_axis = FALSE;
       gScream = FALSE;
       gTarget = "";
       gTransIdSend = 0;
       gTransIdReceive = start_param;
       gTransferComplete = FALSE;
       gChild_key = "";
       gAntiNoob = FALSE;
   }
   state_entry()
   {
       llSetTexture("3f0f9fa9-e6ae-7ab4-ec11-02381ab8ef06",ALL_SIDES); //Set object texture
       
       //Killswitch
       llListen(-6666,"",NULL_KEY,"");
       //Killswitch end
       
       llTargetOmega(<0,0,.1>,PI,.2);
       
       if (gTransferComplete)
       {
           llSensorRepeat("", "", AGENT, 96, PI, 0.5);
       }
       
       llSetTimerEvent(gAutoreturn);
       
   }
   
   sensor(integer num_detected)
   {
       vector here = llGetPos();
       vector target;
       if((llRound(llGetTime() / 30) % 2) == 0)
       {
           target = llDetectedPos(num_detected - 1) +
           <llFrand(6) - 3, llFrand(6) - 3, 0>;
       }
       else
       {
           target = llDetectedPos(0) +
           <llFrand(2) - 1, llFrand(2) - 1, 0>;
       }
       //Eyetsalk Sensor
       vector avatarspos = llDetectedPos(0);
       vector inclination = avatarspos - llGetPos();
       llSetPrimitiveParams([PRIM_FLEXIBLE, TRUE, 1, 0, .5, 0, 10, inclination]);
       //Eyestalk Sensor end
       
       vector distance = target - here;
       vector fracdist = distance/2.0;
       
       list div1 = [1.25,1.5,1.75,2.0,2.5,3.0,4.0,5.0,6.0,8.0,12.0,24.0];
       integer i = 0;
       integer vector_safe;
       integer list_length = llGetListLength(div1);
       integer trap_check = llGetParcelFlags(target);
       
       //This whole subroutine is to check along the object's path
       //for any "safe" areas that have scripts turned off
       //otherwise the object will get stuck
       if ((PARCEL_FLAG_ALLOW_SCRIPTS & trap_check))
       {
           for (; i < list_length; ++i) 
           {
               integer frac_trap_check = llGetParcelFlags(here + distance / llList2Float(div1, i) );
               if ( (PARCEL_FLAG_ALLOW_SCRIPTS & frac_trap_check) )
               {
                   vector_safe = TRUE;
               }
               else
               {
                   vector_safe = FALSE;
                   i = list_length;
               }
           }
   
           if (vector_safe)
           {
               if( ((here.x + fracdist.x) > 0 && (here.x + fracdist.x) < 256) &&
                   ((here.y + fracdist.y) > 0 && (here.y + fracdist.y) < 256))
               {
                   if (gActive_z_axis && ((here.z + fracdist.z) > 0) && ((here.z + fracdist.z) < 4000) )
                   {
                       ;
                   }
                   else
                   {
                       fracdist.z = 0;
                   }
                   
                   llSetPos(here + <fracdist.x, fracdist.y, fracdist.z>);
               }
           }
           else
           {
               ;
           }
       }
   }
   
   listen(integer chan, string name, key id, string message)
   {
       string x_check = llGetSubString(message, 5, -1);
       string transfer_check = llGetSubString(message, 0, 3); // gets transfer id
       string command_check = llGetSubString(message, 5, 23); // checks if this is a transfer command or not
       
       // Transfer settings from previous spengbab
       if ((string)gTransIdReceive == transfer_check)
       {
           // Auto-return settings
           if (command_check == "spengbab autoreturn")
           {
               string value_change = llGetSubString(message, 25, -1); // gets value
               list da_list = [value_change];
               float auto_temp = (llList2Integer(da_list,0));
               gAutoreturn = auto_temp;
               llSetTimerEvent(0.0);
               llSetTimerEvent(gAutoreturn);
           }
           
           // Target an avatar
           string target_check = llGetSubString(message, 5, 19); // checks for "target" command
           if (target_check == "spengbab target")
           {
               gTarget = llGetSubString(message, 21, -1); // gets target name
               if (gTarget == "null")
               {
                   llSensorRepeat("", "", AGENT, 96, PI, 0.5);
               }
               else
               {
                   if (gTarget == "me")
                   {
                       gTarget = llKey2Name(llGetOwner());
                   }
                   
                   llSensorRepeat(gTarget, "", AGENT, 96, PI, 0.5);
               }
           }
           
           // Noob pwn command
           string pwn_check = llGetSubString(message, 5, 17); // checks for "pwn" command
           if (pwn_check == "spengbab pwn")
           {
               gAntiNoob = TRUE;
               llSetSoundRadius(5.0);
               gTarget = llGetSubString(message, 19, -1); // gets target name
               llSensorRepeat(gTarget, "", AGENT, 96, PI, 0.5);
               gActive_z_axis = TRUE;
               gScream = TRUE;
               llLoopSound("99c3568e-f82f-d74d-6029-a3366bbb1efe", 1.0);
           }
           
           // Z-Axis controls
           if (x_check == "spengbab enable z-axis")
           {
               gActive_z_axis = TRUE;
           }
           
           // Screaming
           if (x_check == "spengbab scream")
           {
               gScream = TRUE;
               llLoopSound("99c3568e-f82f-d74d-6029-a3366bbb1efe", 1.0);
           }
           
           // Is transfer done?
           if (x_check == "transfer complete")
           {
               gTransferComplete = TRUE;
           }
       }
       
       // Normal commands
       if (llGetOwnerKey(id) == llGetOwner())
       {   
           // Auto-return settings
           string command_check = llGetSubString(message, 0, 18); // checks for "autoreturn" command
           if (command_check == "spengbab autoreturn")
           {
               string value_change = llGetSubString(message, 20, -1); // gets value
               list da_list = [value_change];
               float auto_temp = (llList2Integer(da_list,0));
               gAutoreturn = (auto_temp * 60) - 30;
               if (auto_temp != gAutoreturn)
               {
               llSetTimerEvent(0.0);
               llSetTimerEvent(gAutoreturn);
               }
           }
           
           // Target an avatar
           string target_check = llGetSubString(message, 0, 14); // checks for "spengbab target" command
           if (target_check == "spengbab target")
           {
               gTarget = llGetSubString(message, 16, -1); // gets target name
               if (gTarget == "null")
               {
                   llSensorRepeat("", "", AGENT, 96, PI, 0.5);
               }
               else
               {
                   if (gTarget == "me")
                   {
                       gTarget = llKey2Name(llGetOwner());
                   }
                   
                   llSensorRepeat(gTarget, "", AGENT, 96, PI, 0.5);
               }
           }
           
           // Noob pwn command
           string pwn_check = llGetSubString(message, 0, 11); // checks for "pwn" command
           if (pwn_check == "spengbab pwn")
           {
               gAntiNoob = TRUE;
               llSetSoundRadius(5.0);
               gTarget = llGetSubString(message, 13, -1); // gets target name
               llSensorRepeat(gTarget, "", AGENT, 96, PI, 0.5);
               gActive_z_axis = TRUE;
               gScream = TRUE;
               llLoopSound("99c3568e-f82f-d74d-6029-a3366bbb1efe", 1.0);
           }
       
           // Killswitch
           if (message == "spengbab getaids")
           {
              llDie();
           }
           
           // Z-Axis controls
           if (message == "spengbab enable z-axis")
           {
               gActive_z_axis = TRUE;
           }
           
           if (message == "spengbab disable z-axis")
           {
               gActive_z_axis = FALSE;
           }
           
           // Screaming
           if (message == "spengbab scream")
           {
               gScream = TRUE;
               llLoopSound("99c3568e-f82f-d74d-6029-a3366bbb1efe", 1.0);
           }
           
           if (message == "spengbab noscream")
           {
               gScream = FALSE;
               llStopSound();
           }
       }
       else
       {
           ;
       }
   }
   
   timer()
   {
       vector here_rez = llGetPos();
       integer rez_trap_check = llGetParcelFlags(here_rez);
       if ((PARCEL_FLAG_ALLOW_SCRIPTS & rez_trap_check))
       {
           integer random = (integer)llFrand(9999.0) + 1000;
           string interim = (string)random;
           gTransIdSend = (integer)interim;
           llRezObject("Spengbab", llGetPos(), ZERO_VECTOR, ZERO_ROTATION, gTransIdSend);
       }
   }
   
   object_rez(key child)
   {
       llGiveInventory(child, llKey2Name(child));
       gChild_key = child;
       llSleep(2.0);
       llRegionSay(-6666, (string)gTransIdSend + " spengbab autoreturn " + (string)gAutoreturn);
       llSleep(0.5);
       if (gAntiNoob == TRUE)
       {
           llRegionSay(-6666, (string)gTransIdSend + " pwn " + gTarget);
       }
       else
       {
           llRegionSay(-6666, (string)gTransIdSend + " spengbab target " + gTarget);
           llSleep(0.5);
       
           if (gActive_z_axis)
           {
               llRegionSay(-6666, (string)gTransIdSend + " spengbab enable z-axis");
               llSleep(0.5);
           }
       
           if (gScream)
           {
               llRegionSay(-6666, (string)gTransIdSend + " spengbab scream");
               llSleep(0.5);
           }
       }
       
       llRegionSay(-6666, (string)gTransIdSend + " transfer complete");
       
       llDie();
   } 

} </lsl>