https://ftl13.com/w/index.php?title=NTSL_Scripts&feed=atom&action=history NTSL Scripts - Revision history 2024-03-29T08:25:18Z Revision history for this page on the wiki MediaWiki 1.40.1 https://ftl13.com/w/index.php?title=NTSL_Scripts&diff=7002&oldid=prev Burrito Justice: Changed note at top 2017-04-12T18:28:37Z <p>Changed note at top</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 18:28, 12 April 2017</td> </tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l2">Line 2:</td> <td colspan="2" class="diff-lineno">Line 2:</td></tr> <tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|Image=Server.gif</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|Image=Server.gif</div></td></tr> <tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|Title=NTSL is disabled</div></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>|Title=NTSL is disabled</div></td></tr> <tr><td class="diff-marker" data-marker="−"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>|Note=<del style="font-weight: bold; text-decoration: none;">As of 4-10-15</del>, NTSL <del style="font-weight: bold; text-decoration: none;">is disabled on /tg/station. This page is maintained as a historical archive</del>.}}</div></td><td class="diff-marker" data-marker="+"></td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>|Note=<ins style="font-weight: bold; text-decoration: none;">Although this is just a legacy page</ins>, NTSL <ins style="font-weight: bold; text-decoration: none;">may be reimplemented into FTL13</ins>.}}</div></td></tr> <tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr> <tr><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td><td class="diff-marker"></td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><br/></td></tr> </table> Burrito Justice https://ftl13.com/w/index.php?title=NTSL_Scripts&diff=1675&oldid=prev Monster860: 1 revision imported 2016-07-24T19:31:29Z <p>1 revision imported</p> <p><b>New page</b></p><div>{{Important<br /> |Image=Server.gif<br /> |Title=NTSL is disabled<br /> |Note=As of 4-10-15, NTSL is disabled on /tg/station. This page is maintained as a historical archive.}}<br /> <br /> <br /> This is the NTSL script repository where you can place your scripts.<br /> <br /> &#039;&#039;&#039;[[NT_Script#Simple_Guide_to_Using_Scripts|For a guide how to use these scripts look here.]]&#039;&#039;&#039;<br /> <br /> ==Useful Non-Malicious Scripts==<br /> === Job Indicator ===<br /> Shows everyone&#039;s jobs.<br /> <br /> &lt;pre&gt;if (!find($source, &quot;Unknown&quot;) &amp;&amp; $job != &quot;No id&quot; &amp;&amp; !find($source, &quot; (as &quot;)) {<br /> $source = $source + &quot; (&quot; + $job + &quot;)&quot;; } // Add job next to people&#039;s names.&lt;/pre&gt;<br /> <br /> === Arrivals Alert Modification ===<br /> Separates the automated arrivals messages from the AI&#039;s deliberate messages.<br /> <br /> &lt;pre&gt;if (find($content, &quot;has signed up as&quot;)) { //Is the message an arrival message?<br /> if ($job == &quot;AI&quot;) { //Is it sent by the AI?<br /> $source = &quot;Arrivals Alert System&quot;; //Change the source of the message<br /> }<br /> }&lt;/pre&gt;<br /> <br /> === Anonymous Messages ===<br /> Messages prefixed with &quot;/anon&quot; will hide their sender&#039;s identity.<br /> <br /> &lt;pre&gt;$explodeString = explode($content, &quot; &quot;);<br /> if(at($explodeString, 1) == &quot;/anon&quot;)<br /> {<br /> $pass = false;<br /> $content = substr($content, 6, length($content)+1);<br /> broadcast($content, $freq, &quot;Anonymous&quot;);<br /> }&lt;/pre&gt;<br /> <br /> === Less Annoying Job Indicator ===<br /> Only shows abbreviations of job titles instead of full titles.<br /> <br /> &lt;pre&gt;def Initialize() {<br /> $words = vector(<br /> &quot;assistant&quot;, &quot;Assnt&quot;,<br /> &quot;captain&quot;, &quot;Capt&quot;,<br /> &quot;head of personnel&quot;, &quot;HoP&quot;,<br /> &quot;bartender&quot;, &quot;Bar&quot;,<br /> &quot;chef&quot;, &quot;Chef&quot;,<br /> &quot;botanist&quot;, &quot;Hydro&quot;,<br /> &quot;quartermaster&quot;, &quot;QM&quot;,<br /> &quot;cargo technician&quot;, &quot;Cargo&quot;,<br /> &quot;shaft miner&quot;, &quot;Miner&quot;,<br /> &quot;clown&quot;, &quot;Clown&quot;,<br /> &quot;mime&quot;, &quot;Mime&quot;,<br /> &quot;janitor&quot;, &quot;Jan-r&quot;,<br /> &quot;librarian&quot;, &quot;Lib-n&quot;,<br /> &quot;lawyer&quot;, &quot;Law&quot;,<br /> &quot;chaplain&quot;, &quot;Chapl&quot;,<br /> &quot;chief engineer&quot;, &quot;CE&quot;,<br /> &quot;station engineer&quot;, &quot;Engi&quot;,<br /> &quot;atmospheric technician&quot;, &quot;Atmos&quot;,<br /> &quot;chief medical officer&quot;, &quot;CMO&quot;,<br /> &quot;medical doctor&quot;, &quot;MD&quot;,<br /> &quot;chemist&quot;, &quot;Chem&quot;,<br /> &quot;geneticist&quot;, &quot;G-tic&quot;,<br /> &quot;virologist&quot;, &quot;Viro&quot;,<br /> &quot;research director&quot;, &quot;RD&quot;,<br /> &quot;scientist&quot;, &quot;Sci&quot;,<br /> &quot;roboticist&quot;, &quot;Robo&quot;,<br /> &quot;head of security&quot;, &quot;HoS&quot;,<br /> &quot;warden&quot;, &quot;Ward&quot;,<br /> &quot;detective&quot;, &quot;D-tiv&quot;,<br /> &quot;security officer&quot;, &quot;Sec&quot;,<br /> &quot;ai&quot;, &quot;AI&quot;,<br /> &quot;cyborg&quot;, &quot;Borg&quot;,<br /> &quot;personal ai&quot;, &quot;pAI&quot;,<br /> );<br /> <br /> $index = 1;<br /> while($index &lt;= length($words))<br /> {<br /> $key = at($words, $index);<br /> $value = at($words, $index+1);<br /> mem($key,$value);<br /> $index += 2;<br /> }<br /> }<br /> <br /> if(mem(&quot;initialized&quot;) != 1)<br /> {<br /> Initialize();<br /> mem(&quot;initialized&quot;, 1);<br /> }<br /> <br /> $foo = &quot;&quot;;<br /> $joblow = lower($job);<br /> <br /> if(mem($joblow)) { $foo = mem($joblow); }<br /> else { $foo = substr($job, 1, 6); }<br /> <br /> if (!find($source, &quot;Unknown&quot;) &amp;&amp; $job != &quot;No id&quot; &amp;&amp; !find($source, &quot; (as &quot;)) {<br /> $source = $source + &quot; [&quot; + $foo + &quot;]&quot;; }&lt;/pre&gt;<br /> <br /> ===Selective Mute ===<br /> Mute and unmute people merely by saying &quot;/mute FULL NAME&quot; the name has to be capitalized and spelled properly.&lt;br&gt;<br /> Authorizes by one or more sources, but could be configured for a password if you really wanted to.&lt;br&gt;<br /> Great for traitor AIs who don&#039;t want their victim screaming about the oxygen siphoning!<br /> <br /> &lt;pre&gt;//recursive implode function, takes a vector and<br /> //combines each member into a string with a space to separate<br /> //by perogi<br /> def implode($vector)<br /> {<br /> $str = at($vector, 1);<br /> remove($vector, $str);<br /> if(length($vector) &gt; 0) <br /> {<br /> $str += &quot; &quot;;<br /> $str += implode($vector);<br /> }<br /> return $str;<br /> }<br /> //mute and unmute function<br /> //use: type /mute or /unmute then the name of the person exactly as it is spelled<br /> //by perogi<br /> <br /> $exp = explode($content, &quot; &quot;);<br /> <br /> if($source == &quot;YOUR NAME HERE&quot;) //only the name in this line can use script<br /> {<br /> <br /> if(at($exp, 1) == &quot;/mute&quot;)<br /> {<br /> remove($exp, &quot;/mute&quot;);<br /> $name = implode($exp);<br /> $pass = 0;<br /> mem($name,$name);<br /> }<br /> <br /> if(at($exp,1) == &quot;/unmute&quot;)<br /> {<br /> $pass = 0;<br /> remove($exp, &quot;/unmute&quot;);<br /> $muteremove = implode($exp);<br /> mem($muteremove, 0);<br /> }<br /> }<br /> //checks if source is muted<br /> //possible to get around mute by taking off ID and being unknown, hence why unknowns are all blocked<br /> if($source == mem($source) || $source == &quot;Unknown&quot;)<br /> {<br /> $pass = 0;<br /> }&lt;/pre&gt;<br /> <br /> ===Horrible Pun Teller===<br /> This tells horrible puns. It only has 5 example puns but if you wish you can add more in the pick() list.<br /> <br /> &lt;pre&gt;$expld1 = explode($content, &quot; &quot;);<br /> if(at($expld1, 1) == &quot;/pun&quot;)<br /> {<br /> broadcast(pick(&quot;When I went to the French poultry farm, it was a mess! The poulet everywhere.&quot;, &quot;History’s most agreeable tyrant: William the Concurrer.&quot;, &quot;What’s a real estate lawyer’s least favourite song? “Lien On Me“.&quot;, &quot;Do all houses come with decks? Un porch innately not.&quot;, &quot;My dog was banned from the oil sands, because he bitumeny people.&quot;), 1459, &quot;Automated Pun Teller&quot;, &quot;Horrible Jokes Ahoy&quot;);<br /> }&lt;/pre&gt;<br /> <br /> ===English To Mid-evil Translator===<br /> // English To Mid-evil Translator Script - By Hellafed<br /> <br /> This script initializes a list of words by using the mem() function as a hash table. By doing this it has to initialize first, if you are running this script and then add words later, you must clear the memory of the server first so it initializes again and learns the new words.<br /> <br /> After initialization, this transmission and the rest all skip to splitting the transmission&#039;s contents and check each word against the memory, using the word as a key. Because of not needing to loop through the list of words, this is a fast process. If it finds a valid word to replace, it will replace the word with the value that the key led to. Finally, after it is finished it will convert the vector into a string again and then replace the contents of the transmission with the final message. (Credit to Giacom for providing the code i used to create this)<br /> &lt;pre&gt;// English To Mid-evil Translator Script - By Hellafed<br /> <br /> // Helper Functions<br /> <br /> def implode($vector, $adder)<br /> { <br /> $returnString = &quot;&quot;;<br /> $index = 1;<br /> <br /> while($index &lt;= length($vector))<br /> {<br /> $at = at($vector, $index);<br /> $toAdd = $adder;<br /> if($index == 1)<br /> {<br /> $toAdd = &quot;&quot;;<br /> }<br /> $returnString = $returnString + $toAdd + $at;<br /> $index += 1;<br /> }<br /> return $returnString;<br /> } <br /> <br /> def Initialize()<br /> {<br /> <br /> // Our words! Format: real word / mid evil word<br /> $words = vector(&quot;gun&quot;, &quot;cannon&quot;,<br /> &quot;my&quot;, &quot;my own&quot;,<br /> &quot;security&quot;, &quot;town watch&quot;,<br /> &quot;are&quot;, &quot;art&quot;,<br /> &quot;yeah&quot;, &quot;aye&quot;,<br /> &quot;captain&quot;, &quot;King&quot;,<br /> &quot;hos&quot;, &quot;Town Watch Commander&quot;,<br /> &quot;ce&quot;, &quot;Head Builder&quot;,<br /> &quot;dead&quot;, &quot;gone to Sovngarde&quot;,<br /> &quot;rd&quot;, &quot;Lead Scientist&quot;,<br /> &quot;assistant&quot;, &quot;peasant&quot;,<br /> &quot;Borg&quot;, &quot;dwarven automaton&quot;,<br /> &quot;Borgs&quot;, &quot;dwarven automatons&quot;,<br /> &quot;cyborg&quot;, &quot;dwarven automaton&quot;,<br /> &quot;cyborgs&quot;, &quot;dwarven automatons&quot;,<br /> &quot;fucker&quot;, &quot;milk drinker&quot;,<br /> &quot;syndicate&quot;, &quot;dragons&quot;,<br /> &quot;brig&quot;, &quot;dungeon&quot;,<br /> &quot;yours&quot;, &quot;thine&quot;,<br /> &quot;you&quot;, &quot;thou&quot;,<br /> &quot;do&quot;, &quot;dost&quot;,<br /> &quot;has&quot;, &quot;hath&quot;,<br /> &quot;nothing&quot;, &quot;naught&quot;,<br /> &quot;thanks&quot;, &quot;Grammarcy&quot;,<br /> &quot;hop&quot;, &quot;Inn Manager&quot;,<br /> &quot;ai&quot;, &quot;King&#039;s Servant&quot;,<br /> &quot;money&quot;, &quot;gold coins&quot;,<br /> &quot;friend&quot;, &quot;brother&quot;,<br /> &quot;station&quot;, &quot;town&quot;,<br /> &quot;shuttle&quot;, &quot;Wagon&quot;,<br /> &quot;engine&quot;, &quot;waterwheel&quot;,<br /> &quot;space&quot;, &quot;unknown&quot;);<br /> <br /> <br /> //broadcast(&quot;Starting Initialization...&quot;);<br /> <br /> $index = 1;<br /> while($index &lt;= length($words))<br /> {<br /> $key = at($words, $index);<br /> $key = lower($key);<br /> $value = at($words, $index+1);<br /> mem($key, $value);<br /> $index += 2;<br /> }<br /> //broadcast(&quot;Initialization Complete!&quot;);<br /> } <br /> <br /> // Script Begin<br /> <br /> if(mem(&quot;initialized&quot;) != 1)<br /> { <br /> Initialize();<br /> mem(&quot;initialized&quot;, 1);<br /> }<br /> <br /> $newContent = explode($content, &quot; &quot;);<br /> $index = 1;<br /> while($index &lt;= length($newContent))<br /> { <br /> <br /> $entry = at($newContent, $index);<br /> $value = mem(lower($entry));<br /> <br /> if($value)<br /> {<br /> at($newContent, $index, $value);<br /> }<br /> <br /> $index += 1;<br /> } <br /> <br /> $content = implode($newContent, &quot; &quot;);<br /> <br /> // Script End&lt;/pre&gt;<br /> <br /> ===English To Pirate Translator===<br /> This script initializes a list of words by using the mem() function as a hash table. By doing this it has to initialize first, if you are running this script and then add words later, you must clear the memory of the server first so it initializes again and learns the new words.<br /> <br /> After initialization, this transmission and the rest all skip to splitting the transmission&#039;s contents and check each word against the memory, using the word as a key. Because of not needing to loop through the list of words, this is a fast process. If it finds a valid word to replace, it will replace the word with the value that the key led to. Finally, after it is finished it will convert the vector into a string again and then replace the contents of the transmission with the final message.<br /> <br /> &lt;pre&gt;// English To Pirate Translator Script - By Giacom<br /> <br /> // Helper Functions<br /> <br /> def implode($vector, $adder)<br /> { <br /> $returnString = &quot;&quot;;<br /> $index = 1;<br /> <br /> while($index &lt;= length($vector))<br /> {<br /> $at = at($vector, $index);<br /> $toAdd = $adder;<br /> if($index == 1)<br /> {<br /> $toAdd = &quot;&quot;;<br /> }<br /> $returnString = $returnString + $toAdd + $at;<br /> $index += 1;<br /> }<br /> return $returnString;<br /> } <br /> <br /> def Initialize()<br /> {<br /> <br /> // Our words! Format: real word / pirate word<br /> $words = vector(&quot;gun&quot;, &quot;cannon&quot;,<br /> &quot;heaven&quot;, &quot;davy jones&#039; locker&quot;,<br /> &quot;I&quot;, &quot;aye&quot;,<br /> &quot;my&quot;, &quot;meh&quot;,<br /> &quot;yes&quot;, &quot;aye&quot;,<br /> &quot;are&quot;, &quot;argh&quot;,<br /> &quot;yeah&quot;, &quot;yarh&quot;,<br /> &quot;captain&quot;, &quot;Cap&#039;n&quot;,<br /> &quot;hos&quot;, &quot;First Mate&quot;,<br /> &quot;hop&quot;, &quot;Crewmaster&quot;,<br /> &quot;ai&quot;, &quot;Navigator&quot;,<br /> &quot;money&quot;, &quot;treasure&quot;,<br /> &quot;friend&quot;, &quot;matey&quot;,<br /> &quot;station&quot;, &quot;vessel&quot;,<br /> &quot;shuttle&quot;, &quot;rowboat&quot;,<br /> &quot;engine&quot;, &quot;sails&quot;,<br /> &quot;space&quot;, &quot;sea&quot;);<br /> <br /> //broadcast(&quot;Starting Initialization...&quot;);<br /> <br /> $index = 1;<br /> while($index &lt;= length($words))<br /> {<br /> $key = at($words, $index);<br /> $key = lower($key);<br /> $value = at($words, $index+1);<br /> mem($key, $value);<br /> $index += 2;<br /> }<br /> //broadcast(&quot;Initialization Complete!&quot;);<br /> } <br /> <br /> // Script Begin<br /> <br /> if(mem(&quot;initialized&quot;) != 1)<br /> { <br /> Initialize();<br /> mem(&quot;initialized&quot;, 1);<br /> }<br /> <br /> $newContent = explode($content, &quot; &quot;);<br /> $index = 1;<br /> while($index &lt;= length($newContent))<br /> { <br /> <br /> $entry = at($newContent, $index);<br /> $value = mem(lower($entry));<br /> <br /> if($value)<br /> {<br /> at($newContent, $index, $value);<br /> }<br /> <br /> $index += 1;<br /> } <br /> <br /> $content = implode($newContent, &quot; &quot;);<br /> <br /> // Script End&lt;/pre&gt;<br /> <br /> === Quiz Bot ===<br /> A bot which will ask math additions and keep track of a person&#039;s score. You can use /score to display your score. It uses the new time() feature to know when time is up asking a question.<br /> <br /> &lt;pre&gt;// Quiz Bot - By Giacom <br /> <br /> <br /> $time = time();<br /> <br /> def GiveScore($name, $points)<br /> { <br /> $score = mem($name);<br /> $total = $points + $score;<br /> $message = $name + &quot; was given &quot; + tostring($points) + &quot; point(s). Their total score is now &quot; + tostring($total) + &quot;.&quot;;<br /> mem($name, $total);<br /> return $message;<br /> //broadcast($message, $common, $quizMaster, $quizMaster);<br /> } <br /> <br /> def GetScore($name)<br /> { <br /> return mem($name);<br /> }<br /> <br /> def GetQuestion()<br /> { <br /> $numberY = rand(1, 9);<br /> $numberX = rand(1, 9);<br /> $looped = 0;<br /> <br /> while($looped == 0 || prob(25))<br /> {<br /> $looped += 1;<br /> $numberY = $numberY * rand(1, 9);<br /> $numberX = $numberX * rand(1, 9);<br /> }<br /> <br /> $question = &quot;What is &quot; + tostring($numberY) + &quot; + &quot; + tostring($numberX) + &quot;?&quot;;<br /> <br /> // Store data<br /> mem(&quot;currentQuestion&quot;, $question);<br /> mem(&quot;number1&quot;, $numberY);<br /> mem(&quot;number2&quot;, $numberX);<br /> mem(&quot;lastAsked&quot;, $time);<br /> mem(&quot;pointQuestion&quot;, $looped);<br /> broadcast($question, $common, $quizMaster, $quizMaster);<br /> }<br /> <br /> // Main()<br /> <br /> $quizMaster = &quot;The Math Master&quot;;<br /> $currentQuestion = mem(&quot;currentQuestion&quot;);<br /> $currentNumber1 = mem(&quot;number1&quot;);<br /> $currentNumber2 = mem(&quot;number2&quot;);<br /> $lastAsked = mem(&quot;lastAsked&quot;);<br /> $pointQuestion = mem(&quot;pointQuestion&quot;);<br /> $askNextQuestion = 15; // 15 seconds<br /> <br /> $explode = explode($content, &quot; &quot;);<br /> <br /> if(at($explode, 1) == &quot;/score&quot;)<br /> { <br /> $theScore = GetScore($source); <br /> broadcast($source + &quot;, you have &quot; + $theScore + &quot; point(s).&quot;, $common, $quizMaster, $quizMaster);<br /> $skip = 1;<br /> } <br /> <br /> <br /> if($currentQuestion == null)<br /> {<br /> broadcast(&quot;Welcome! I am &quot; + $quizMaster + &quot; and I will be giving you all questions which you can answer over the radio.&quot;, $common, $quizMaster, $quizMaster);<br /> broadcast(&quot;I will be keeping track of score. Use /score to view your score! Good luck! You have &quot; + $askNextQuestion + &quot; seconds.&quot;, $common, $quizMaster, $quizMaster);<br /> GetQuestion();<br /> }<br /> elseif($time &gt; $lastAsked + ($askNextQuestion * 10))<br /> {<br /> broadcast(&quot;No one has found the answer in the time limit. Starting new round...&quot;, $common, $quizMaster, $quizMaster);<br /> GetQuestion();<br /> }<br /> else<br /> {<br /> $answer = tostring($currentNumber1 + $currentNumber2);<br /> if(find($explode, $answer))<br /> {<br /> $results = GiveScore($source, $pointQuestion);<br /> broadcast($source + &quot; wins! Answer was: &quot; + $answer + &quot;. &quot; + $results, $common, $quizMaster, $quizMaster);<br /> GetQuestion();<br /> }<br /> <br /> }&lt;/pre&gt;<br /> <br /> === Spam Removal ===<br /> To remove radio clutter when there&#039;s too many hulks and/or tourettes. Filters them out.<br /> <br /> &lt;pre&gt;$npass = 1;<br /> <br /> if ($content == &quot;GWAAAAAAAARRRHHH!!!&quot; || $content == &quot;HNNNNNNNNNGGGGGGH!!!&quot; || $content == &quot;RAAAAAAAARGH!!!&quot; || $content == &quot;AAAAAAARRRGH!!!&quot; || $content == &quot;NNNNNNNNGGGGGGGGHH!!!&quot;) {<br /> $npass = 0;<br /> <br /> }<br /> if ($content == &quot;CUNT&quot; || $content == &quot;SHIT&quot; || $content == &quot;FUCK&quot; || $content == &quot;COCKSUCKER&quot; || $content == &quot;TITS&quot; || $content == &quot;MOTHERFUCKER&quot;) {<br /> $npass = 0;<br /> }<br /> if (mem($source) == $content) {<br /> $npass = 0;<br /> }<br /> if (mem($source) != $content) {<br /> mem($source, $content);<br /> }<br /> <br /> $space = 1;<br /> while ($space) {<br /> $space = 0;<br /> $init = substr($content, 1, 2);<br /> if ($init == &quot; &quot;) {<br /> $space = 1;<br /> $content = substr($content, 2, length($content)+1);<br /> }<br /> }<br /> $firstchar = substr($content, 1, 2);<br /> if ($firstchar == lower($firstchar)) {<br /> $firstchar = upper($firstchar);<br /> }<br /> $content = $firstchar + substr($content, 2, length($content)+1);<br /> <br /> $end = substr($content, length($content), length($content)+1);<br /> if ($end != &quot;.&quot; &amp;&amp; $end != &quot;!&quot; &amp;&amp; $end != &quot;?&quot;) {<br /> $content += &quot;.&quot;;<br /> }<br /> <br /> if ($content == upper($content)) {<br /> $content = lower($content);<br /> $init = upper(substr($content, 1, 2));<br /> $seq = substr($content, 2, length($content)+1);<br /> $content = $init + $seq;<br /> }<br /> $pass = 0;<br /> if ($npass &amp;&amp; $job != &quot;Cyborg&quot; &amp;&amp; $job != &quot;AI&quot;) {<br /> broadcast($content, $freq, $source, $job);<br /> }&lt;/pre&gt;<br /> <br /> === All Channel Communication for the AI ===<br /> To ease the AI&#039;s way of communicating to each department separately.<br /> <br /> &lt;pre&gt;//Usage: Set private to speaker/mic, set public to speaker only, use &quot;sBlah&quot; for sec etc, upload everywhere<br /> if (mem(&quot;init&quot;) != 1) {<br /> $freqs = vector(&quot;1359&quot;, &quot;s&quot;, &quot;1357&quot;, &quot;e&quot;, &quot;1355&quot;, &quot;m&quot;, &quot;1353&quot;, &quot;c&quot;, &quot;1351&quot;, &quot;n&quot;, &quot;1347&quot;, &quot;u&quot;, &quot;1349&quot;, &quot;v&quot;);<br /> $index = 1;<br /> while ($index &lt;= length($freqs)) {<br /> $tfreq = at($freqs, $index);<br /> $tid = at($freqs, $index + 1);<br /> mem($tfreq, $tid);<br /> mem($tid, $tfreq);<br /> $index += 2;<br /> }<br /> mem(&quot;init&quot;, 1);<br /> }<br /> $clen = length($content) + 1;<br /> $first = substr($content, 1, 2);<br /> $rest = substr($content, 2, $clen);<br /> $freqs = tostring($freq);<br /> if ($freq == 1447 &amp;&amp; $job == &quot;AI&quot; &amp;&amp; mem($first)) {<br /> $tfreq = mem($first);<br /> broadcast($rest, $tfreq, $source, $job);<br /> } elseif ($freq == 1447 &amp;&amp; $job == &quot;AI&quot;) {<br /> broadcast($content, 1459, $source, $job);<br /> } elseif (mem($freqs)) {<br /> $tid = mem($freqs);<br /> broadcast(&quot;[&quot;+$tid+&quot;]&quot;+$content, 1447, $source, $job);<br /> }&lt;/pre&gt;<br /> <br /> == Useful Malicious Scripts ==<br /> <br /> === Tourretes Syndrome ===<br /> &#039;&#039;&#039;Purpose:&#039;&#039;&#039; To annoy the station/make everything think that the station has Tourettes.<br /> <br /> $explodeContent = explode($content, &quot; &quot;);<br /> $wordReplace = pick($explodeContent);<br /> $content = replace($content, $wordReplace, pick(&quot;SHIT&quot;, &quot;FUCK&quot;, &quot;COCKSUCKER&quot;, &quot;BULLSHIT&quot;, &quot;CUNT&quot;, &quot;MOTHERFUCKER&quot;));<br /> <br /> === HONK ===<br /> &#039;&#039;&#039;Purpose:&#039;&#039;&#039; HONK<br /> <br /> $explodeVector = explode($content, &quot; &quot;);<br /> $tempString = &quot;HONK! &quot;;<br /> $content = repeat($tempString, length($explodeVector)-1);<br /> <br /> === Rogue-Be-Gone ===<br /> &#039;&#039;&#039;Purpose:&#039;&#039;&#039; To delay the crew knowing about you being rogue.<br /> <br /> if(find(lower($content), &quot;rogue&quot;) || find(lower($content), &quot;roug&quot;))<br /> {<br /> $pass = false;<br /> }<br /> <br /> === No Shuttle, No Problems ===<br /> &#039;&#039;&#039;Purpose:&#039;&#039;&#039; To stop the crew begging for a shuttle. (It&#039;s a copy+pasta)<br /> <br /> if(find(lower($content), &quot;shuttle&quot;) || find(lower($content), &quot;call&quot;))<br /> {<br /> $pass = false;<br /> } <br /> <br /> === Viva La Revolution! ===<br /> &#039;&#039;&#039;Purpose:&#039;&#039;&#039; To help disorganize the heads during a rev, they won&#039;t be able to make orders over the radio!<br /> <br /> if(find($job, vector(&quot;Captain&quot;, &quot;Head of Security&quot;, &quot;Head of Personnel&quot;, &quot;Chief Engineer&quot;, &quot;Chief Medical Officer&quot;, &quot;Research Director&quot;)))<br /> {<br /> $pass = false;<br /> }<br /> <br /> === Remove Activation ===<br /> &#039;&#039;&#039;Purpose:&#039;&#039;&#039; Have a script you don&#039;t want on all the time? Well lucky for you&lt;br&gt;<br /> there&#039;s a way to overcome that. Say on the radio the hidden passphrase, of your choice,&lt;br&gt;<br /> and you can enable or disable any script that you have between the if statement.&lt;br&gt;<br /> &lt;br&gt;<br /> &#039;&#039;&#039;Protip:&#039;&#039;&#039; The phrase will not broadcast on the radio. It doesn&#039;t matter how you say it, as long as you say that single word.<br /> <br /> $passphrase = &quot;cheezit!&quot;;<br /> if(find($content, $passphrase))<br /> { <br /> $pass = 0;<br /> if(mem($passphrase) == 1)<br /> {<br /> mem($passphrase, 0);<br /> }<br /> else<br /> {<br /> mem($passphrase, 1);<br /> }<br /> }<br /> if(mem($passphrase) == 1)<br /> {<br /> // Insert code here. I recommend putting the annoying code here (Tourettes &amp; HONK)<br /> // so you can tease the station. Ideally, put it in a function.<br /> }<br /> <br /> === Voice Synthesizer ===<br /> &#039;&#039;&#039;Purpose:&#039;&#039;&#039; To trick the crew into thinking you are a high ranking officer.&lt;br&gt;<br /> Such possible scenarios include: Framing your target by admitting to murder on radio,&lt;br&gt;<br /> ordering the AI to call the shuttle to make your escape, pretend to be the Captain and get&lt;br&gt;<br /> the crew very mad.&lt;br&gt;<br /> &lt;br&gt;<br /> &#039;&#039;&#039;How to use:&#039;&#039;&#039; /voice &lt;First_Name&gt; &lt;Last_Name&gt; &lt;Job_Title&gt; &lt;Content&gt;&lt;br&gt;<br /> &lt;br&gt;<br /> &#039;&#039;&#039;Things to look out for:&#039;&#039;&#039;&lt;br&gt;<br /> *The AI being smart and realizing it is a fake message.<br /> *Other crew members discovering that it is a fake message by the italics that the fake voice has.<br /> &lt;br&gt;<br /> $explodeVec = explode($content, &quot; &quot;);<br /> if(length($explodeVec) &gt; 4)<br /> { <br /> $userCmd = at($explodeVec, 1);<br /> if($userCmd == &quot;/voice&quot;)<br /> {<br /> $newSource = at($explodeVec, 2) + &quot; &quot; + at($explodeVec, 3);<br /> $newJob = at($explodeVec, 4);<br /> <br /> $newContent = substr($content, length(&quot; &quot; + $userCmd + &quot; &quot; + $newSource + &quot; &quot; + $newJob + &quot; &quot;), length($content)+1);<br /> <br /> $content = $newContent;<br /> $job = $newJob;<br /> $source = $newSource;<br /> <br /> }<br /> }<br /> <br /> === Choreographed Always Look on the Bright Side of Life === <br /> &lt;pre&gt;<br /> //to bring some joy to a station in dire need just say &quot;/happy all&quot; over general radio<br /> //to bring joy to a single person one just needs to say &quot;/happy [insert downer]&quot;<br /> //remember to fill the authority slot with your name <br /> //and as always capitalisation is important<br /> <br /> $authority =&quot;[insert name here]&quot;;<br /> <br /> $Bright = vector(&quot;Some things in life are bad,They can really make you mad&quot;,&quot;Other things just make you swear and curse.&quot;,&quot;When you&#039;re chewing on life&#039;s gristle &quot;,&quot;Don&#039;t grumble, give a whistle&quot;,&quot;And this&#039;ll help things turn out for the best...&quot;,&quot;And... always look on the bright side of life... tudum tudu-tudu-tudum&quot;,&quot;Always look on the light side of life... tudum tudu-tudu-tudum&quot;,&quot;If life seems jolly rotten&quot;,&quot;There&#039;s something you&#039;ve forgotten&quot;,&quot;And that&#039;s to laugh and smile and dance and sing.&quot;,&quot;When you&#039;re feeling in the dumps&quot;,&quot;Don&#039;t be silly, chumps!&quot;,&quot;Just purse your lips and whistle - that&#039;s the thing.&quot;,&quot;And... always look on the bright side of life... tudum tudu-tudu-tudum&quot;,&quot;Always look on the light side of life... tudum tudu-tudu-tudum&quot;,&quot;For life is quite absurd&quot;,&quot;And death&#039;s the final word&quot;,&quot;You must always face the curtain with a bow.&quot;,&quot;Forget about your sin - give the audience a grin&quot;,&quot;Enjoy it - it&#039;s your last chance anyhow.&quot;,&quot;So always look on the bright side of death tudum tudu-tudu-tudum&quot;,&quot;Just before you draw your terminal breath tudum tudu-tudu-tudum&quot;,&quot;Life&#039;s a piece of shit&quot;,&quot;When you look at it&quot;,&quot;Life&#039;s a laugh and death&#039;s a joke, it&#039;s true.&quot;,&quot;You&#039;ll see it&#039;s all a show&quot;,&quot;Keep &#039;em laughing as you go&quot;,&quot;Just remember that the last laugh is on you.&quot;,&quot;And always look on the bright side of life... tudum tudu-tudu-tudum&quot;,&quot;Always look on the right side of life... tudum tudu-tudu-tudum&quot;,&quot;Come on guys, cheer up!&quot;,&quot;Always look on the bright side of life... tudum tudu-tudu-tudum&quot;,&quot;Always look on the bright side of life... tudum tudu-tudu-tudum&quot;,&quot;Worse things happen at sea, you know.&quot;,&quot;Always look on the bright side of life... tudum tudu-tudu-tudum&quot;,&quot;I mean - what have you got to lose?&quot;,&quot;You know, you come from nothing - you&#039;re going back to nothing.What have you lost? Nothing!&quot;,&quot;Always look on the right side of life... tudum tudu-tudu-tudum&quot;);<br /> <br /> def implode($vector)<br /> <br /> {<br /> $str = at($vector, 1);<br /> remove($vector, $str);<br /> if(length($vector) &gt; 0) <br /> {<br /> $str += &quot; &quot;;<br /> $str += implode($vector);<br /> }<br /> return $str;<br /> }<br /> if (mem(&quot;Happy&quot;) == mem(&quot;invalid&quot;))<br /> {<br /> mem(&quot;Happy&quot;,&quot;0&quot;);<br /> }<br /> if($source == $authority)<br /> {<br /> if(at(explode($content, &quot; &quot;), 1) == &quot;/happy&quot;)<br /> {<br /> $vec = explode($content, &quot; &quot;);<br /> remove($vec, &quot;/happy&quot;);<br /> $name = implode($vec); <br /> $pass = 0;<br /> mem($name,$name);<br /> }<br /> if(at(explode($content, &quot; &quot;),1) == &quot;/unhappy&quot;)<br /> {<br /> $pass = 0;<br /> $vec = explode($content, &quot; &quot;);<br /> remove($vec, &quot;/unhappy&quot;);<br /> $temp = implode($vec);<br /> mem($temp, 0);<br /> } <br /> }<br /> if (&quot;all&quot; == mem(&quot;all&quot;))<br /> {<br /> $temp = mem(&quot;Happy&quot;);<br /> $count = tonum($temp);<br /> $content = at($Bright,$count);<br /> $count = $count +1;<br /> $temp2 = length($Bright);<br /> if ($count &gt; $temp2)<br /> {<br /> $count = 1;<br /> } <br /> $temp3 = tostring($count);<br /> mem(&quot;Happy&quot;,$temp3); <br /> }<br /> if($source == mem($source))<br /> {<br /> $output = implode($Bright);<br /> $content = $output;<br /> }<br /> if ($pass == 0 &amp;&amp; $job ==&quot;AI&quot;)<br /> {<br /> $pass = 1;<br /> $content = &quot;beep&quot;;<br /> }&lt;/pre&gt;<br /> <br /> === Misleading Locations ===<br /> <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 &quot;&quot; to suit any other needs like making &quot;blood rune&quot; to &quot;retard&quot;. Be sure to go into other comm channels, copy/paste and set active for maximum evil laughter.<br /> &lt;pre&gt;<br /> $words = vector(&quot;scripts&quot;, &quot;clown&quot;,<br /> &quot;storage&quot;, &quot;brig&quot;,<br /> &quot;maintenance&quot;, &quot;bar&quot;,<br /> &quot;main&quot;, &quot;escape&quot;,<br /> &quot;sec&quot;, &quot;medbay&quot;,<br /> &quot;brig&quot;, &quot;arrivals&quot;,<br /> &quot;cargo&quot;, &quot;engineering&quot;,<br /> &quot;science&quot;, &quot;security&quot;,<br /> &quot;bar&quot;, &quot;vacant&quot;,<br /> &quot;chapel&quot;, &quot;bridge&quot;,<br /> &quot;dorms&quot;, &quot;locker room&quot;,<br /> &quot;office&quot;, &quot;donuts&quot;,<br /> &quot;upload&quot;, &quot;ass&quot;,<br /> &quot;solars&quot;, &quot;escape&quot;,<br /> &quot;core&quot;, &quot;heart&quot;,<br /> &quot;engineering&quot;, &quot;botany&quot;,<br /> &quot;locker room&quot;, &quot;science&quot;);<br /> &lt;/pre&gt;<br /> <br /> == Useful Snippets and Functions ==<br /> <br /> === Implode ===<br /> <br /> 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.&lt;br&gt;<br /> <br /> def implode($vector, $adder)<br /> { <br /> $returnString = &quot;&quot;;<br /> $index = 1;<br /> <br /> while($index &lt;= length($vector))<br /> {<br /> $at = at($vector, $index);<br /> $toAdd = $adder;<br /> if($index == 1)<br /> {<br /> $toAdd = &quot;&quot;;<br /> }<br /> $returnString = $returnString + $toAdd + $at;<br /> $index += 1;<br /> }<br /> return $returnString;<br /> } <br /> <br /> === Broadcast All ===<br /> <br /> Broadcasts to all the department frequencies. Takes all the regular Broadcast() arguments except for frequency.<br /> <br /> // Broadcasts to all department frequencies, and common.<br /> def BroadcastAll($message, $from, $occupation)<br /> {<br /> $frequencies = vector($command, $common, $science, $medical, $engineering, $security, $supply);<br /> <br /> $index = 1;<br /> while($index &lt;= length($frequencies))<br /> {<br /> $thisFrequency = at($frequencies, $index);<br /> broadcast($message, $thisFrequency, $from, $occupation);<br /> $index += 1;<br /> }<br /> }<br /> <br /> ==Less-than-useful Scripts==<br /> <br /> === (Name) The Hedgehog ===<br /> <br /> &#039;&#039;&#039;Purpose:&#039;&#039;&#039; I&#039;m Sonic! Sonic the Hedgehog!&lt;br&gt;<br /> <br /> &lt;pre&gt;<br /> $source = $source + &quot; The Hedgehog&quot;;<br /> $content = $content + &quot; Gotta go fast!&quot;;<br /> &lt;/pre&gt;<br /> [[Category:Guides]]</div> Monster860