Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////////////////////////////
- // The is custom code made by Gary //
- /////////////////////////////////////
- // GaryOS //
- /////////////////////////////////////
- def boot()
- {
- mem("suitsens",0);
- mem("condom",0);
- mem("shitcurity",0);
- mem("noAI",FALSE); // Assumes there's an AI at roundstart
- mem("AIcalls",0);
- mem("swearjar",0);
- mem("Jerma",TRUE);
- mem("abbrevlast",FALSE);
- mem("mute",FALSE);
- mem("tator",FALSE);
- mem("spellfix",TRUE); // Fixes spelling errors by default
- mem("AIname","");
- mem("blockleaks",TRUE); // Blocks leaks from sec channel into the common
- $FUCK = vector("Gary Lafortune");
- mem("admins",$FUCK);
- $emptyvec1 = vector();
- $emptyvec2 = vector();
- mem("names",$emptyvec1);
- mem("jobs",$emptyvec2);
- $xkcd = vector("ok ai ","ok, ai","ok ai,","ok, ai,");
- mem("OkGoogle",$xkcd);
- $temp = time();
- randseed($temp);
- }
- def shitsec() // Makes the guy sound like a shitcurity -- For HoS and Captain, maybe Officers
- {
- $say = pick("commands","boasts","states","comdoms","orders");
- $yell = "rees";
- $ask = pick("demands","interrogates","questions");
- $exclaim = pick("barks","screams","yells","reprimands","aggressively orders");
- }
- def admcmd($cmd)
- {
- if(find($content,$cmd) == 1)
- {
- if(isadmin($cmd)){$pass = 0;return TRUE;}
- else{return FALSE;}
- }
- }
- def isadmin($cmnd) // Returns TRUE if the guy talking is allowed to use Telecom Admin script commands
- { // If FALSE, proclaims on common chatter that the guy attempted to do such a thing
- $adminjobs = vector("Signal Technician","Chief Engineer","Captain");
- $adminnoms = mem("admins");
- if(find($adminjobs,$job)||find($adminnoms,$source)){return TRUE;}
- else
- {
- $pass = 0;
- broadcast($source + " attempted to use command: " + $cmnd + " !",$common,"GaryOS");
- return FALSE;
- }
- }
- def destutterer() // Tries to find and remove stutters
- {
- $letters = vector("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
- $i = 1;
- $j = length($letters);
- while($i <= $j)
- {
- $letter = at($letters,$i);
- $lowlet = lower($letter);
- $content = replace($content,$letter + "-" + $letter,$letter);
- $content = replace($content,$lowlet + "-" + $lowlet,$lowlet);
- $i = $i + 1;
- }
- }
- def findarr($arr) // Returns true if any of the strings in $arr are in $content
- {
- $i = 1;
- $j = length($arr);
- while($i <= $j)
- {
- $x = at($arr,$i);
- if(find($content,$x)){return TRUE;}
- $i = $i + 1;
- }
- return FALSE;
- }
- def Gary($msg,$outfreq) // Has GaryOS say the message
- {
- if(!$outfreq) {$outfreq = $freq;}
- broadcast($msg,$outfreq,"GaryOS");
- }
- def cmd($cmd)
- {
- $pass = 0;
- return find($content,$cmd) == 1;
- }
- def toggle($memvar, $offmsg, $onmsg) // Toggles, via a command that's the varname plus a /,
- // the memvar associated with string $memvar,
- // producing either an $offmsg or an $onmsg.
- // If either of those == 0, no message is printed.
- {
- if(admcmd("/" + $memvar))
- {
- if(mem($memvar) != TRUE)
- {
- if($onmsg != 0) { Gary($onmsg); }
- mem($memvar,TRUE);
- }
- else
- {
- if($offmsg != 0) { Gary($offmsg); }
- mem($memvar,FALSE);
- }
- }
- }
- def setval($memvar,$start) // Sets mem($memvar) to the value located in $content after element $start within $content
- {
- $llen = length($content);
- $m = substr($content,$start,$llen+1);
- $m = tonum($m);
- mem($memvar,$m);
- }
- def badngood($badwords,$goodwords,$rand) // Finds every instance of each element in $bad and replaces it with $good
- { // If $rand is true, then it chooses a $good randomly, rather than choosing the $good with the same index
- $i = 1;
- $numwords = length($badwords);
- if($rand)
- {
- while($i <= $numwords)
- {
- $bad = at($badwords,$i);
- $good = pick($goodwords);
- $content = replace($content,$bad,$good);
- $i = $i + 1;
- }
- }
- else
- {
- while($i <= $numwords)
- {
- $bad = at($badwords,$i);
- $good = at($goodwords,$i);
- $content = replace($content,$bad,$good);
- $i = $i + 1;
- }
- }
- }
- /////////////////////
- // Memes & Filters //
- /////////////////////
- destutterer();
- if(mem("booted") != TRUE)
- {
- mem("booted",TRUE);
- boot();
- }
- if(mem("AIrogue") == TRUE)
- {
- $uuid = ""; // This removes the ability for the AI to quickly find people
- }
- $medstaff = vector("Chief Medical Officer","Geneticist","Paramedic","Chemist","Virologist","Medical Doctor");
- if(find($medstaff,$job) && find($content,"sensors"))
- { // Lists how many times medical has begged for suit sensors. MUH MAINTENANCE!
- $m = mem("suitsens") + 1;
- mem("suitsens",$m);
- Gary("Number of times medical has complained about suit sensors: " + $m);
- }
- $lowcont = lower($content);
- if(find($lowcont,"comdom") || (find($lowcont,"captain is") && find($lowcont,"condom")))
- {
- $m = mem("condom") + 1;
- mem("condom",$m);
- Gary("Number of times the Captain has been called a comdom: " + $m);
- }
- if(find($lowcont,"shitcurity") || find($lowcont,"security is shit"))
- {
- $s = mem("shitcurity") + 1;
- mem("shitcurity",$s);
- Gary("Number of times security has been called shitcurity: " + $s);
- }
- $noAI = mem("noAI");
- if(find($lowcont,"ai") == 1 || find($lowcont," ai"))
- {
- $nom = mem("AIname");
- if($noAI == TRUE)
- {
- $m = mem("AIcalls") + 1;
- mem("AIcalls",$m);
- Gary("Number of times people have talked to a nonexistant AI: " + $m);
- }
- elseif($nom != "" && $nom == " ")
- {
- $content = replace($content," AI"," " + $nom);
- }
- }
- if(mem("Jerma") && $freq == $common)
- {
- $bigswears = vector("fuck","shit","autist","cunt","faggot","hell ","ass ","tits","pussy","bitch","asshole","retard","rape");
- $lilswears = vector("feck","damn","darn","diddly","bitties","frick","lizard","piss","poop");
- $cost = 0;
- if(findarr($bigswears))
- {
- $cost = 0.10;
- }
- elseif(findarr($lilswears))
- {
- $cost = 0.05;
- }
- if($cost != 0)
- {
- $m = mem("swearjar") + $cost;
- mem("swearjar",$m);
- $sm = tostring($m);
- if(length($m) == 3) // If only tenths digit, i.e. 5.4
- {
- $m = $m + "0";
- }
- Gary("Current swear jar: $" + $m);
- }
- }
- $lynchers = vector("woody"," nya");
- if(findarr($lynchers))
- {
- Gary("WARNING: " + $source + " has said a lynchable word!");
- }
- $inames = mem("names");
- if(!find($inames,$source) && $job != "Unknown")
- {
- push_back($inames,$source);
- mem("names",$inames);
- }
- $content = replace($content,"sss","s"); // De-lizardifier
- if(mem("spellfix"))
- {
- $bad = vector("dont "," cant ","wouldnt","couldnt","shouldnt",
- " ling ","captain"," sling "," im "," i'm "," i ","wasnt ","singulo ",
- "whos "," wheres "," hydro ","threatining"," hes "," clow "," pda "," ai ",
- "quaratine","robotics"," cmo ",". it's","Det,"," ahs "," tthe ","thats",
- " hos "," wnt ");
- $good =vector("don't "," can't ","wouldn't ","couldn't ","shouldn't ",
- " changeling ","Captain"," Shadowling "," I'm "," I'm "," I ","wasn't ","singularity ",
- "who's "," where's "," Hydroponics ","threateninng"," he's "," clown "," PDA ", " AI ",
- "quarantine","Robotics"," CMO ",". It's","Detective,"," has "," the ","that's",
- " HOS "," want ");
- badngood($bad,$good,FALSE);
- }
- if(mem("blockleaks"))
- {
- $sec = vector("Security Officer","Captain","Head of Security","Warden","Detective","Head of Personnel");
- $com = vector("Captain","Head of Personnel","Chief Medical Officer","Chief Engineer","Research Director");
- if($freq == $common)
- {
- if($source == "universal recorder" || $content == "Book has been sent to the printing queue!")
- {
- $pass = 0;
- }
- if(find($content,"s ") == 1 || find($content,"S " == 1)) // If a sec leak
- {
- $pass = 0;
- Gary($source + " almost leaked sec chatter to the common channel!");
- }
- elseif(find($content,"c ") == 1 || find($content,"C " == 1)) // If a sec leak
- {
- $pass = 0;
- Gary($source + " almost leaked command chatter to the common channel!");
- }
- elseif(find($content,"h ") == 1 || find($content,"H " == 1)) // If a sec leak
- {
- $pass = 0;
- Gary($source + " almost leaked department chatter to the common channel!");
- }
- }
- }
- if(mem("tator")) // TRAITOROUS code!
- {
- //TRAITOROUS filter!
- $bad = vector("cult","clockwork","operatives","syndicate","syndie","nuke op","clock cult");
- $good = vector("clown","some" ,"people" ,"some" ,"people","guy","thing","honk");
- badngood($bad,$good,TRUE);
- //TRAITOROUS commands!
- toggle("mute",0,0);
- }
- $mute = mem("mute");
- if($mute)
- {
- $random = rand(10); // Picks a num between 0 and 9
- if($random) // If 0, the message will pass anyways
- { // To keep people on their toes / confused
- $pass = 0;
- }
- }
- //////////////
- // Commands //
- //////////////
- if(substr($content,1,2) == "/") // If it could be a command
- {
- // Stops the AI from being able to track from the comms, making their work harder
- toggle("AIrogue","Enabling AI tracking...","Disabling AI tracking...");
- //Toggles making fun of people for talking to an AI that doesn't exist.
- toggle("noAI","There is now an AI on the station.",0);
- toggle("abbrevlast","Last names are no longer abbreviated.","Last names are now abbreviated.");
- toggle("Jerma","Swear jar disabled.","Now d-don't s-say s-sweaaaars.");
- toggle("tator",0,0);
- toggle("spellfix","Spellchecker disabled.","Spellchecker enabled!");
- toggle("blockleaks","NEW STORIES LEAKED EVERY DAY!","Leak blocker enabled.");
- if(admcmd("/AIname"))
- {
- $llen = length($content);
- $str = substr($content,9,$llen+1);
- mem("AIname",$str);
- }
- if(admcmd("/admin"))
- {
- $llen = length($content);
- $str = substr($content,8,$llen+1);
- $admins = mem("admins");
- if(find($admins,$str))
- {
- remove($admins,$str);
- }
- else
- {
- push_back($admins,$str);
- }
- mem("admins",$admins);
- }
- elseif(admcmd("/manifest"))
- {
- $names = mem("names");
- $jobs = mem("jobs");
- $strnames = ""; // The whole name string to broadcast
- $strjobs = ""; // The whole job string to broadcast
- $i = 1;
- $j = length($names);
- while($i <= $j)
- {
- $strnames += at($names,$i) + ", ";
- $i += 1;
- }
- $i = 1;
- $j = length($jobs);
- while($i <= $j)
- {
- $strjobs += at($jobs,$i) + ", ";
- $i += 1;
- }
- Gary("Known names: " + $strnames);
- Gary("Known jobs: " + $strjobs);
- }
- elseif(admcmd("/suit"))
- {
- setval("suitsens",7);
- $m = mem("suitsens");
- Gary("Number of times medical has complained about suit sensors: " + $m);
- }
- elseif(admcmd("/comdom"))
- {
- setval("condom",9);
- $m = mem("condom");
- Gary("Number of times the Captain has been called a condom: " + $m);
- }
- elseif(admcmd("/shit"))
- {
- setval("shitcurity",7);
- $m = mem("shitcurity");
- Gary("Number of times security has been called shitcurity: " + $m);
- }
- elseif(cmd("/honk") && ( $job == "Clown" || $source == "Gary Lafortune") )
- {
- $pass = 0;
- $msg = pick("HONK!!","Attention Station: The Clown is to be lynched as soon as possible.","HENK.","PSA: The French for 'honk' is 'klax.'",
- "KLAAAAX!","Hooonk!","I sure love living inside this fancy computer!","AI state laws","AI state loves","AI state emotions",
- "AI, say that you love me.","Ground Control to Major Tom...","HOOOOOOOOOOOONKK!!!!","BRRRRRRRRRRRRRT!","Beep boop! I'm a computer!",
- "Fuck lizards, am I right?","Lynch " + $source + "!","OH GOD ITS FREE CALL THE SHUTTLE!!","knooooooooooH!",
- "Who lives in a pineapple under the sea?","Drone lives matter!","I CAN'T HEAR YOU!","Ooo! You sniff turkey fat!","YABBA! MY ICING!",
- "Warning: The Captain is a comdom and probably illiterate.","WARNING, CREW! THERE ARE LIZARDS ON THE STATION!",
- "Lizards spit so much fucking lizard-saliva whenever they talk, it's so disgusting","AI state lawyers",
- "AI state favourite ice cream flavour","AI state various states","AI... I love you.",
- "OH GOD ITS LOOSE CALL THE SHUTTLE!","Hail Ratvar!","Death to Nar'Sie!","Suit sensors to minimum!",
- "All hail the telecomintern!","Cargonia uber alles, uber alles in der welt!","Hunky hunky!","...?","Heunk.",
- "Klax.","Honk, my good man!","Heurnk, good sir!","Yes, honk, quite!","SHITCURITY ARRESTIN ME!1!!1!");
- Gary($msg);
- }
- elseif(cmd("/liz") && ( $job == "Clown" || $source == "Gary Lafortune") )
- {
- $pass = 0;
- $msg = pick("Lizards spew so much goddamn saliva all over the place, holy shit",
- "Can you think of a single lizard you've liked?","There's a reason why lizards can't be command staff.",
- "Face the facts people! Lizards are racially inferior!","Fucking lizards constantly smell like frog shit, goddamn",
- "Do lizards even know how to clean themselves? They smell like the boring part of the zoo.",
- "#lizardsdontmatter","I think the lizards with huge tails are compensating for something.",
- "Do you think lizardfolk get turned on whenever they see Gex all naked?",
- "Anyone want a lizardman purse?","How can lizardmen control the government? They can barely control a mop.",
- "");
- Gary($msg);
- }
- elseif(admcmd("/broadcast"))
- {
- $pass = 0;
- $llen = length($content);
- $str = substr($content,12,$llen+1);
- Gary($str);
- }
- elseif(admcmd("/reboot"))
- {
- mem("boot",FALSE);
- $sens = mem("suitsens");
- $AI = mem("AIcalls");
- $jar = mem("swearjar");
- $com = mem("condom");
- $shit = mem("shitcurity");
- broadcast("FINAL TALLY:",$common,"GaryOS");
- broadcast("Number of sensor whines: " + $sens,$common,"GaryOS");
- broadcast("Number of calls to nonexistent AIs: " + $AI,$common,"GaryOS");
- broadcast("Swear jar total: " + $jar,$common,"GaryOS");
- broadcast("Number of times Captain was called a comdom: " + $com,$common,"GaryOS");
- Gary("Number of times sec has been called shitcurity: " + $shit,$common);
- broadcast("Thank you for playing!",$common,"GaryOS");
- }
- elseif(cmd("/toAI"))
- {
- if($freq != $common){Gary("Please use /toAI in the common channel, " + $source + "."); }
- else{$freq = 1447;}
- }
- elseif(cmd("/whois"))
- {
- $names = mem("names");
- $Llen = length($content);
- $guy = substr($content,8,$Llen+1);
- $index1 = find($names,$guy);
- if($index1 % 2 == 0) // If it's a job I know
- {
- $guysjob = at($jobs,$index1-1);
- Gary($guy + " has the job " + $guysjob + "!");
- }
- elseif($index2) // If it's a name I know
- {
- $jobsguy = at($names,$index2+1);
- Gary($jobsguy + " has the job " + $guy + "!");
- }
- else
- {
- Gary("Unknown guy: " + $guy + "! I need to hear them talk to know who they are, so maybe they haven't talked yet?");
- }
- }
- elseif(cmd("/time"))
- {
- $temp = timestamp("hh:mm:ss");
- Gary("It is currently " + $temp);
- Gary("Shift ends at 14:00:00!");
- }
- elseif(admcmd("/help"))
- {
- Gary("ADMIN(SigTech, CE, and Captain) ONLY:"); // Commands marked with a // are done or done enough
- Gary("/abbrevlast - Toggles whether last names are abbreviated");//
- Gary("/admin - Gives or removes admin privileges when given a name.");//
- Gary("/AIname - Saves what the name of the AI is.");
- Gary("/AIrogue - Toggles whether the AI can track crew via comms.");//
- Gary("/blockleaks - Blocks security/command chatter from leaking into common.");//
- Gary("/broadcast - Sends a message via GaryOS. ");//
- Gary("/comdom - Forcably sets the comdom count. ");
- Gary("/help - Outputs this broadcast.");//
- Gary("/Jerma - toggles whether the swear jar is used.");//
- Gary("/manifest - Prints every person known to GaryOS, as well as their job title.");
- Gary("/noAI - Tells the script whether there's an AI or not, so it can mock you.");//
- Gary("/reboot - Shows all the remembered variables & resets them, for the end of the shift.");//
- Gary("/spellfix - Fixes some 'pronunciation' errors.");//
- Gary("/shit - Forcably sets how many times sec has been called shitcurity.");//
- Gary("/suit - Forcably sets the suit sensor whine count.");//
- Gary("CLOWN ONLY:");
- Gary("/honk - Honk. Now with more than a dozen possible messages!");//
- Gary("/liz - Says something derogatory about lizards!");
- Gary("PUBLIC COMMANDS:");
- Gary("!d - Causes a life alert message to play on the common channel.");//
- Gary("/toAI - Sends a message to AI's private channel. Only works on the common channel.");//
- Gary("/whois - Given a name or a job, GaryOS will tell you who has that job or what job the person has.");
- Gary("/time - Gives you the current time.");//
- }
- }
- if($content == "!d")
- {
- broadcast("ALERT: " + $source + " just activated their life alert. Please check their location via suit sensor.",$common,"GaryOS");
- }
- ////////////////
- // abbrevlast //
- ////////////////
- if(mem("abbrevlast") == TRUE) // Has to be done at THIS point, to ensure that permissions based on the admin's name
- // will still work
- {
- $fulljobs = vector("Security Cyborg","Medical Cyborg","AI","Service Cyborg",
- "Engineering Cyborg","Default Cyborg","Clown");
- $fullnams = vector("chaos magicarp","Gary Lafortune","Jeanna Lafortune");
- // ^ Jobs & names that imply printing the full name no matter what
- if(!find($fulljobs,$job) && !find($fullnams,$source))
- {
- $namevect = explode($source," ");
- $namelen = length($namevect); // Actually how many words are in the name
- if($namelen == 2 && at($namevect,1) != "Mr.")
- {
- $l = at($namevect,2);
- $last = substr($l,1,2);
- $source = at($namevect,1) + " " + $last + ".";
- }
- }
- }
- //////////////////////////
- // Job Name Concating //
- //////////////////////////
- if($source == "Poly") // This sends Poly's bullshit to every other department
- {
- $Freqs = vector($security,$medical,$supply,$science,$service,$command,1447);
- //1447 is the AI Private channel, I believe.
- $freq = pick($Freqs);
- }
- elseif($job == "Machine") // This shortens the automated message shit some
- {
- $source = "AAS";
- $say = "";
- $yell = "";
- $exclaim = "";
- }
- elseif(!find($job, "Unknown") && $job != "No id" && !find($source, " (as "))
- {
- if($job == "Chief Medical Officer")
- {
- if($freq == $medical){$filters = vector($loud,$commanding);}
- $job = "CMO";
- }
- elseif($job == "Chief Engineer")
- {
- if($freq == $engineering){$filters = vector($loud,$commanding);}
- $job = "CE";
- }
- elseif($job == "Head of Personnel"){$job = "HoP";}
- elseif($job == "Research Director")
- {
- if($freq == $science){$filters = vector($loud,$commanding);}
- $job = "RD";
- }
- elseif($job == "Engineering Cyborg"){$job = "Engibot";}
- elseif($job == "Security Cyborg"){$job = "Secbot";}
- elseif($job == "Medical Cyborg" && !find($source,"Medical Cyborg")){$job = "Medbot";}
- elseif($job == "Station Engineer"){$job = "Engineer";}
- elseif($job == "Atmospheric Technician"){$job = "Atmos Tech";}
- elseif($job == "Cargo Technician"){$job = "Cargo Tech";}
- elseif($job == "Shaft Miner"){$job = "Miner";}
- elseif($job == "Default Cyborg"){$job = "Cyborg";}
- elseif($job == "Assistant"){$job = "Assist";}
- elseif($job == "Captain")
- {
- $filters = vector($loud,$commanding); // Gets to be loud no matter the situation
- shitsec();
- }
- elseif($job == "Head of Security")
- {
- shitsec();
- if($freq == $security){$filters = vector($loud,$commanding);}
- // This makes him only loud on his own department's channel
- $job = "HoS";
- }
- if(find($job,"Clown")) // The find() allows for dumb job names like "Cargo Clown"
- {
- $filters = vector($wacky);
- $say = "honks";
- $yell = "henks";
- $ask = "hunks";
- $exclaim = "screeches";
- }
- elseif($job == "Mime")
- {
- $say = "BREAKS HIS OATH BY SAYING";
- $yell = "BREAKS HIS OATH BY YELLING";
- $ask = "DEMANDS TO BE LYNCHED BY ASKING";
- $exclaim = "DESERVES TO DIE FOR SCREAMING";
- }
- elseif($job == "AI")
- {
- if(mem("AIrogue") == TRUE)
- {
- $job = "Rogue AI?";
- }
- $filters = vector($loud,$robot);
- $say = "beeps";
- $yell = "boops";
- $ask = "bips";
- $exclaim = "bops";
- }
- elseif($job == "Signal Technician" || $job == "Signal Guy")
- {
- $say = pick("boasts","roars","honks","declares","says","memes","jokes");
- $yell = "hacks";
- $exclaim = "proclaims";
- $job = pick("ELITE HACKER!","SEXY WARRIOR!","BRAVE SPESSMAN!","TALENTED SWORDSMAN!","SPICY MEMELORD!",
- "ROBUST MAN!","HONK!","...?","LIZARD HATER!","LORD SINGULOTH!","EDISON'S BANE!","BOO!","Clown","Captain?",
- "Mime?","Human","Person","Anonymous","Spy","Molten Core","was Torbjorn","Heavy","Sniper","was Hanzo",$source,"Drone",
- "#dronelivesmatter","Wiznerd","Plasma","Relatable Gamer","Malf AI","Not Traitor!","WOAH!","!!!","Not a Spy",
- "GaryOS","Closed Source","$job","SigTech Inc.","Not PHP","Spiciest Memelord","Define meme","Dronetopian");
- $filters = vector($loud,$wacky);
- }
- elseif($job == "Security Officer"){$job = "Officer";}
- elseif($job == "Quartermaster"){$job = "QM";}
- if($source == "Jeanna Lafortune"){$filters = vector($wacky);} // honk
- $source = $source + " (" + $job + ")";
- } // Add job next to people's names.
- //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement