NTSL Scripts: Difference between revisions

Jump to navigation Jump to search
3,126 bytes removed ,  11:26, 12 May 2014
m
Removed broken Selective Mute, renamed working Cleaner Selective Mute -> Selective Mute. Less Annoying Job Indicator works again. Thanks to Gun Hog for fixing the codes!
imported>Kosmos
m (→‎Useful Malicious Scripts: Added Monty Python singing script.)
imported>Kosmos
m (Removed broken Selective Mute, renamed working Cleaner Selective Mute -> Selective Mute. Less Annoying Job Indicator works again. Thanks to Gun Hog for fixing the codes!)
Line 31: Line 31:
Only shows abbreviations of job titles instead of full titles.
Only shows abbreviations of job titles instead of full titles.


<pre>//code shamelessly copied and pasted from Giacom's pirate script
<pre>def Initialize() {
 
def Initialize() {
$words = vector(
$words = vector(
     "Assistant", "Assnt",
     "Assistant", "Assnt",
Line 73: Line 71:
   while($index <= length($words))
   while($index <= length($words))
  {
  {
  mem(at($words, $index), at($words, $index+1));
  $key = at($words, $index);
  $value = at($words, $index+1);
  mem($key,$value);
   $index += 2;
   $index += 2;
  }
  }
Line 92: Line 92:
$source = $source + " (" + $foo + ")"; }</pre>
$source = $source + " (" + $foo + ")"; }</pre>


=== Selective Mute ===
===Selective Mute ===
By Matilda.<br>
Turn a wall com to 146.1 to listen to the output of the script.<br>
authorize yourself via ;/authme PASSWORD, just say it on the general com.<br>
then use ;/crewlist to find the ID of who you want to mute.<br>
then use ;/mute ID to mute them, and ;/unmute ID to unmute them.
 
<pre>$password = "<insert password here>";
 
$originalsource = $source;
$originaljob = $job;
$me = 4;
 
if(!mem("crewnum")) {
  mem("crewnum",0);
}
 
$found = 0;
$counter = 0;
$me = 0;
while($counter < mem("crewnum")) {
  if (mem("crewlistsource" + $counter) == $originalsource) {
      $me = $counter;
      $found = 1;
  }
  $counter = $counter + 1;
}
 
if ($found == 0) {
  $me = mem("crewnum");
  broadcast("Adding new user " + $originalsource + ", " + $originaljob + " to database at location " + mem("crewnum"),1461);
  mem("crewlistsource" + $me,$originalsource);
  mem("crewlistjob" + $me,$originaljob);
  mem("crewlistauth" + $me, 0);
  mem("crewlistmute" + $me, 0);
  mem("crewnum",mem("crewnum") + 1);
}
 
//HACK ALERT
if ($me < 1) { $me = 0; }
 
 
if(!mem("usermessagecount")) {
  mem("usermessagecount",0);
}
 
$expld1 = explode($content, " ");
if(at($expld1, 1) ==  "/crewlist") {
  $counter = 0;
  while($counter < mem("crewnum")) {
      broadcast($counter + " - " + mem("crewlistsource" + $counter) + " - " + mem("crewlistjob" + $counter) + " - auth " + mem("crewlistauth" +
$counter) + " - mute " + mem("crewlistmute" + $counter),1461," "," ");
      $counter = $counter + 1;
  }
  $pass = 0;
}
 
$expld1 = explode($content, " ");
if(at($expld1, 1) ==  "/who") {
  broadcast(mem("crewlistsource" + at($expld1, 2)),1461);
  $pass = 0;
}
 
$expld1 = explode($content, " ");
if(at($expld1, 1) ==  "/crewnum") {
  broadcast(mem("crewnum"), 1461);
  $pass = 0;
}
 
$expld1 = explode($content, " ");
if(at($expld1, 1) ==  "/myid") {
  broadcast("Your ID is " + $me, 1461);
  $pass = 0;
}
 
$expld1 = explode($content, " ");
if(at($expld1, 1) ==  "/mute" && mem("crewlistauth" + $me) >= 2) {
  mem("crewlistmute" + at($expld1, 2),1);
  broadcast(mem("crewlistsource" + at($expld1, 2)) + " has been muted.");
  $pass = 0;
}
$expld1 = explode($content, " ");
if(at($expld1, 1) ==  "/unmute" && mem("crewlistauth" + $me) >= 2) {
  mem("crewlistmute" + at($expld1, 2),0);
  broadcast(mem("crewlistsource" + at($expld1, 2)) + " has been unmuted.");
  $pass = 0;
}
 
$expld1 = explode($content, " ");
if(at($expld1, 1) ==  "/authme") {
  if(at($expld1, 2) == $password) {
      mem("crewlistauth" + $me, 2);
  }
  $pass = 0;
}
 
$expld1 = explode($content, " ");
if(at($expld1, 1) ==  "/announce" && mem("crewlistauth" + $me) >= 1) {
  broadcast(" ",$common," "," ");
  broadcast("ANNOUNCEMENT",$common," "," ");
  broadcast("  ",$common," "," ");
  broadcast("  ",$common," "," ");
  broadcast(upper(replace($content, "/announce", " ")),$common," "," ");
  broadcast("    ",$common," "," ");
  broadcast("    ",$common," "," ");
  $pass = 0;
}
 
if(mem("crewlistmute" + $me) == 1) {
  //$pass = 0;
  $content = " ";
  $source = $originalsource + " (MUTED)";
}</pre>
 
 
===Cleaner Selective Mute ===
Mute and unmute people merely by saying "/mute FULL NAME" the name has to be capitalized and spelled properly.<br>
Mute and unmute people merely by saying "/mute FULL NAME" the name has to be capitalized and spelled properly.<br>
Authorizes by one or more sources, but could be configured for a password if you really wanted to.<br>
Authorizes by one or more sources, but could be configured for a password if you really wanted to.<br>
Line 217: Line 102:
def implode($vector)
def implode($vector)
{
{
$str = at($vector, 1);
  $str = at($vector, 1);
remove($vector, $str);
  remove($vector, $str);
if(length($vector) > 0)  
  if(length($vector) > 0)  
{
  {
$str += " ";
      $str += " ";
$str += implode($vector);
      $str += implode($vector);
}
  }
return $str;
  return $str;
}
}
//mute and unmute function
//mute and unmute function
//use: type /mute or /unmute then the name of the person exactly as it is spelled
//use: type /mute or /unmute then the name of the person exactly as it is spelled
//by perogi
//by perogi
$exp = explode($content, " ");
if($source == "YOUR NAME HERE") //only the name in this line can use script
if($source == "YOUR NAME HERE") //only the name in this line can use script
{
{
if(at(explode($content, " "), 1) == "/mute")
 
{
  if(at($exp, 1) == "/mute")
$vec = explode($content, " ");
  {
remove($vec, "/mute");
      remove($exp, "/mute");
$name = implode($vec);
      $name = implode($exp);
$pass = 0;
      $pass = 0;
mem($name,$name);
      mem($name,$name);
}
  }
if(at(explode($content, " "),1) == "/unmute")
 
{
  if(at($exp,1) == "/unmute")
$pass = 0;
  {
$vec = explode($content, " ");
      $pass = 0;
remove($vec, "/unmute");
      remove($exp, "/unmute");
mem(implode($vec), 0);
      $muteremove = implode($exp);
}
      mem($muteremove, 0);
  }
}
}
//checks if source is muted
//checks if source is muted
Line 251: Line 140:
if($source == mem($source) || $source == "Unknown")
if($source == mem($source) || $source == "Unknown")
{
{
$pass = 0;
  $pass = 0;
}</pre>
}</pre>


Anonymous user

Navigation menu