NTSL Scripts: Difference between revisions

755 bytes removed ,  02:20, 13 September 2019
no edit summary
No edit summary
No edit summary
Line 6: Line 6:
'''[[NT_Script#Simple_Guide_to_Using_Scripts|For a guide how to use these scripts look here.]]'''
'''[[NT_Script#Simple_Guide_to_Using_Scripts|For a guide how to use these scripts look here.]]'''


==Useful Scripts==
== Useful Scripts ==
=== Job Indicator ===
=== Job Indicator ===
Jobs will appear in brackets after names.
Jobs will appear in brackets after names.
Line 62: Line 62:
</pre>
</pre>


=== Broadcast to All ===
Messages starting with '''/all''' will be broadcasted to all departments, and common. Admins hate this, though. Expect to get bwoinked.


===Selective Mute ===
<pre>
Mute and unmute people merely by saying "/mute FULL NAME" the name has to be capitalized and spelled properly.<br>
// Broadcast to All - by TheDL
Authorizes by one or more sources, but could be configured for a password if you really wanted to.<br>
 
Great for traitor AIs who don't want their victim screaming about the oxygen siphoning!
x=explode(sig.content," ");
freqs=list( 1459, 1447, 1359, 1357, 1355, 1353, 1351, 1349, 1347);
if(x[1]=="/all"){ sig.pass=0; sig.content=implode(x-x[1]," "); n=1;
while(n<=length(freqs)){ sig.freq=freqs[n]; broadcast(sig); n+=1; } }
</pre>
 
=== Broadcast to Any or All ===
Messages starting with a channel code will be broadcast to the corresponding department. The channel codes are '''/c''' for command, '''/e''' for engineering, '''/m''' for medical, '''/n''' for science, '''/o''' for AI private, '''/s''' for security, '''/u''' for supply, and '''/v''' for service. As above, messages starting with '''/all''' will be broadcasted to all departments, and common. Again, admins hate this. Expect to get bwoinked.
 
<pre>
// Broadcast to Any or All - by TheDL
 
x=explode(sig.content," ");
freqs=list( 1459, 1447, 1359, 1357, 1355, 1353, 1351, 1349, 1347);
codes=list( "/all", "/o", "/s", "/e", "/m", "/c", "/n", "/v", "/u");
if(find(codes,x[1])){ n=find(codes,x[1]); sig.content=implode(x-x[1]," ");
if(codes[n]!="/all"){ sig.freq=freqs[n]; } else{ sig.pass=0; n=1;
  while(n<=length(freqs)){ sig.freq=freqs[n]; broadcast(sig); n+=1; } } }
</pre>
 
 
=== Phrase Toggle ===
Enable or disable a script using a phrase. Any phrase can be used. Add the script to be toggled where indicated. User restricted, message blocked. Remove &&sig.source=="Name" to let anyone use it. Remove sig.pass=0; to not block the message.
 
<pre>
// Phrase Toggle - By TheDL


<pre>//recursive implode function, takes a vector and
toggle="Phrase"; if(find(sig.content,toggle)&& sig.source=="Name"){
//combines each member into a string with a space to separate
sig.pass=0; if(mem(toggle)!=1){ mem(toggle,1); } else{ mem(toggle,0); } }
//by perogi
if(mem(toggle)==1){
def implode($vector)
// Insert script here.
{
  $str = at($vector, 1);
  remove($vector, $str);
  if(length($vector) > 0)
  {
      $str += " ";
      $str += implode($vector);
  }
  return $str;
}
}
//mute and unmute function
</pre>
//use: type /mute or /unmute then the name of the person exactly as it is spelled
//by perogi


$exp = explode($content, " ");
=== Pun Pun Teller ===
Say /pun to have the Ghost of Pun Pun tell an awful pun!


if($source == "YOUR NAME HERE") //only the name in this line can use script
<pre>
{
//Pun-Pun Teller - by TheDL


  if(at($exp, 1) == "/mute")
exp=explode(sig.content," ");
  {
if(exp[1]=="/pun"){ sig.pass=0;
      remove($exp, "/mute");
broadcast(signal(pick("Did you hear about the guy that got cut in half? Don't worry, he's all right now.", "I started a business selling landmines disguised as prayer mats. Prophets are going through the roof!", "Why don't thieves get puns? Because they take things literally.", "My dog has no nose. How does he smell? Awful.", "A man entered ten puns in a pun contest, hoping that one would win. Unfortunately, no pun in ten did."),sig.freq,"The Ghost of Pun Pun"));}
      $name = implode($exp);
</pre>
      $pass = 0;
      mem($name,$name);
  }
 
  if(at($exp,1) == "/unmute")
  {
      $pass = 0;
      remove($exp, "/unmute");
      $muteremove = implode($exp);
      mem($muteremove, 0);
  }
}
//checks if source is muted
//possible to get around mute by taking off ID and being unknown, hence why unknowns are all blocked
if($source == mem($source) || $source == "Unknown")
{
  $pass = 0;
}</pre>


===Horrible Pun Teller===
This tells horrible puns. It only has 5 example puns but if you wish you can add more in the pick() list.


<pre>$expld1 = explode($content, " ");
if(at($expld1, 1) ==  "/pun")
{
broadcast(pick("When I went to the French poultry farm, it was a mess! The poulet everywhere.", "History’s most agreeable tyrant: William the Concurrer.", "What’s a real estate lawyer’s least favourite  song? “Lien On Me“.", "Do all houses come with decks? Un porch innately not.", "My dog was banned from the oil sands, because he bitumeny people."), 1459, "Automated Pun Teller", "Horrible Jokes Ahoy");
}</pre>


===English To Mid-evil Translator===
===English To Mid-evil Translator===
Line 612: Line 604:
}</pre>
}</pre>


=== Misleading Locations ===
Copy and paste this into the def Initialize() block in the [[#English_To_Pirate_Translator|English to Pirate -translator]]. You can also change words within the "" to suit any other needs like making "blood rune" to "retard". Be sure to go into other comm channels, copy/paste and set active for maximum evil laughter.
<pre>
$words = vector("scripts", "clown",
"storage", "brig",
"maintenance", "bar",
"main", "escape",
"sec", "medbay",
"brig", "arrivals",
"cargo", "engineering",
"science", "security",
"bar", "vacant",
"chapel", "bridge",
"dorms", "locker room",
"office", "donuts",
"upload", "ass",
"solars", "escape",
"core", "heart",
"engineering", "botany",
"locker room", "science");
</pre>


== Useful Snippets and Functions ==
== Useful Snippets and Functions ==


=== Implode ===


Does the opposite of Explode(). Takes a vector (1st arg) and turns it into a string with a seperator (2nd arg) in between each Vector entry.<br>


def implode($vector, $adder)
== Outdated Scripts ==
{
$returnString = "";
$index = 1;
while($index <= length($vector))
{
$at = at($vector, $index);
$toAdd = $adder;
if($index == 1)
{
$toAdd = "";
}
$returnString = $returnString + $toAdd + $at;
$index += 1;
}
return $returnString;
}


=== Broadcast All ===
=== Misleading Locations ===
 
Broadcasts to all the department frequencies. Takes all the regular Broadcast() arguments except for frequency.
 
// Broadcasts to all department frequencies, and common.
def BroadcastAll($message, $from, $occupation)
{
$frequencies = vector($command, $common, $science, $medical, $engineering, $security, $supply);
$index = 1;
while($index <= length($frequencies))
{
$thisFrequency = at($frequencies, $index);
broadcast($message, $thisFrequency, $from, $occupation);
$index += 1;
}
}
 
==Less-than-useful Scripts==
 
=== (Name) The Hedgehog ===
 
'''Purpose:''' I'm Sonic! Sonic the Hedgehog!<br>


Copy and paste this into the def Initialize() block in the [[#English_To_Pirate_Translator|English to Pirate -translator]]. You can also change words within the "" to suit any other needs like making "blood rune" to "retard". Be sure to go into other comm channels, copy/paste and set active for maximum evil laughter.
<pre>
<pre>
$source = $source + " The Hedgehog";
$words = vector("scripts", "clown", "storage", "brig",
$content = $content + " Gotta go fast!";
"maintenance", "bar", "main", "escape", "sec", "medbay",
"brig", "arrivals", "cargo", "engineering", "science", "security",
"bar", "vacant", "chapel", "bridge", "dorms", "locker room",
"office", "donuts", "upload", "ass", "solars", "escape",
"core", "heart", "engineering", "botany", "locker room", "science");
</pre>
</pre>
[[Category:Guides]]
[[Category:Guides]]
8

edits