Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // __ __ _______ _______
- //.-----.---.-.----.| |.---.-.-----.--| | | | __|
- //| _ | _ | _|| || _ | | _ |=| - |__ |
- //|___ |___._|__| |__||___._|__|__|_____| |_______|_______|
- //|_____| - - - - - - authored by silvaplex512 (Syd Garland)
- //O//P//E//N/////S//O//U//R//C//E/////E//D//I//T//I//O//N//
- // SCRIPT INITIALISATION
- // a lot of these variables are very messy and inconsistent
- // most of them were jury-rigged just to get it to compile
- $explodeVec = explode($content, " ");
- $arg1 = at($explodeVec, 1); // $args 1-5 are the first 5 words of the message
- $arg2 = at($explodeVec, 2);
- $arg3 = at($explodeVec, 3);
- $arg4 = at($explodeVec, 4);
- $arg5 = at($explodeVec, 5);
- $time = timestamp("hh:mm:ss");
- $versionno = "1.0.0"; // version number - usually I set this to date of last edit
- $joblow = lower($job); // old wiki variable that never got removed
- $out = ""; // former wiki variable used for new job names
- $crewlist = vector(); // I stripped most database functionality from OGOS, this is mostly useless
- $clist = 0;
- $flag = 0; // flags whether a command has been properly parsed, private commands have higher value flags
- $inc = 0; // jury-rigged database variable
- $admin = "admin";
- $aname = "aname";
- $locats = pick("sci", "sci maint", "telesci", "engineering", "arrivals", "cargo", "the library", "HoP office", "QM office", "mining"); // could use optimisation
- $n1 = "";
- $mflag = false;
- $meme = 0;
- mem(1337,"CentComm"); mem(1347,"Supply"); mem(1349,"Service"); mem(1351,"Science"); mem(1353,"Command"); mem(1355,"Medical"); mem(1357,"Engineering"); mem(1359,"Security"); mem(1447,"AI Private"); mem(1459,"Common");
- // debug broadcast function. Broadcasts to debug channel.
- def dbroadcast($dcontent)
- {
- broadcast($dcontent, 1457, "OGOS", "Announcer");
- }
- // frequency broadcast function. Broadcasts to current frequency.
- def fbroadcast($fcontent)
- {
- broadcast($fcontent, $freq, "OGOS", "Announcer");
- }
- // meme name changes go here
- if($source == "Ian Hitchkoff")
- {
- $source = "Ian Bitchkoff";
- $mflag = true;
- }
- if($source == "Ana Bow")
- {
- $source = "Bow Ana Arrow";
- $mflag = true;
- }
- if($source == "Ana Bourgone")
- {
- $source = "Ana Borg-Gone";
- $mflag = true;
- }
- if($source == "Lily Shots")
- {
- $source = "Lily Shits";
- $mflag = true;
- }
- if(find($source, "Automated Announcement")) // not really a meme name, but same code
- {
- $source = "AAS";
- $mflag = true;
- }
- // increment message to crew database
- // /stats is the only database function
- // in this version of the script
- if(mem($source))
- {
- $inc = mem($source) + 1;
- }
- else
- {
- $inc = 1;
- dbroadcast($source + " has transmitted for the first time on channel " + $freq + ". Creating new database entry.");
- if(mem("database"))
- {
- $dtb = vector(mem("database"));
- $dtb = $dtb + $source;
- mem("database", $dtb);
- }
- else
- {
- $dtb = vector($source);
- mem("database", $dtb);
- }
- }
- mem($source, $inc);
- // font handling
- if(find($joblow, "clown")) // clowns get a stupid font
- {
- $filters = vector($wacky);
- }
- if(find($joblow, "mime")) // mimes don't speak
- {
- $content = "HEY EVERYBODY I BROKE MY VOW, LYNCH ME";
- $filters = vector($loud, $commanding, $wacky);
- }
- // channel leak detection
- if(lower($arg1) == "h" || lower($arg1) == ".h" || lower($arg1) == "c" || lower($arg1) == ".c" || lower($arg1) == "s" || lower($arg1) == ".s" || lower($arg1) == "u" || lower($arg1) == ".u" || lower($arg1) == "n" || lower($arg1) == ".n")
- {
- if($freq != 1459 && $freq != 1359) // user managed to say something like ":s:hwhat's going on"
- {
- fbroadcast("User used multiple department keywords in the message. Please consult your headset reference label for proper channel keyword usage.");
- }
- else
- {
- dbroadcast("NOTE: " + $source + " nearly leaked: " + $content + " over frequency: " + $freq);
- $content = "[leaked department chatter removed]";
- }
- }
- // check to see if script was initialized already
- // if not, display bootup message and version #
- if(!mem("boot")) // this part was copied word-for-word from the wiki and gradually improved over time
- {
- fbroadcast("Initializing OpenGarlandOS, version " + $versionno + " for channel " + $freq + ".");
- mem("boot",TRUE);
- $words = vector("assistant","Asst.","captain","Capt","head of personnel","HoP","bartender","Bar","botanist","Botany","quartermaster","QM","cargo technician","C-Tech","shaft miner","Miner","chaplain","chief engineer","CE","station engineer","Engineer","atmospheric technician","A-Tech","chief medical officer","CMO","medical doctor","MD","chemist","Chem","geneticist","Genetics","virologist","Viro","research director","RD","scientist","Sci","roboticist","Robo","head of security","HoS","detective","Det","security officer","Officer","security cyborg","Secborg","medical cyborg","Mediborg","engineering cyborg","Engiborg","peacekeeper cyborg","Cookie Dispenser","janitor cyborg","Janiborg","clown cyborg","ClownBorg","personal ai","pAI","signal technician","Admin");
- $index = 1;
- while($index <= length($words))
- {
- $key = at($words, $index);
- $value = at($words, $index+1);
- mem($key,$value);
- $index += 2;
- }
- }
- // hide all messages with a command in them
- if(find($arg1, "/"))
- {
- $pass = false;
- }
- // reset the authentication script
- // this generates a new passphrase and wildcards $aname
- // so that you can get back in if you were locked out
- if($arg1 == "/reset")
- {
- mem($admin, "");
- mem("password", 0);
- dbroadcast("ALERT: " + $source + " has reset the authentication script for frequency " + $freq + ". Anyone may now become administrator.");
- mem($aname, "#");
- $flag = 2;
- }
- // pick a channel passphrase
- $phrasep = "phrasep"; // TODO: needs optimisation
- if(!mem("password"))
- {
- $pphrase = tostring(rand(100));
- dbroadcast("Channel passphrase for " + $freq + ": " + $pphrase);
- mem($phrasep, $pphrase);
- mem("password", 1);
- }
- // this command checks what the channel passphrase is
- // anyone can use it, in case there's an issue
- // with the login script
- if($arg1 == "/pphrase")
- {
- $pphrase = mem($phrasep);
- dbroadcast("Channel passphrase for " + $freq + ": " + $pphrase);
- $flag = 2;
- }
- // login command, establishes who the tcommsadmin is
- // based on who enters in the correct password
- // tcommsadmin is the only person that can use
- // private commands, but anyone can use public ones
- // provided the tcommsadmin is logged in
- if(mem($aname) == "")
- {
- dbroadcast("ALERT: No admin found, wildcarding /login command.");
- mem($aname, "#");
- }
- if($arg1 == "/login")
- {
- $pphrase = mem($phrasep);
- $abool = 0;
- if($source == mem($aname) || mem($aname) == "#")
- {
- $abool = 1;
- }
- if($arg2 == $pphrase && $abool)
- {
- if(mem($admin))
- {
- mem($admin, 0);
- dbroadcast("Administrator: " + $source + " has logged out of frequency: " + $freq + ", timestamp: " + $time);
- }
- else
- {
- mem($admin, 1);
- mem($aname, $source);
- dbroadcast("Administrator: " + $source + " has logged into frequency: " + $freq + ", timestamp: " + $time, 1445, "GarlandOS");
- }
- }
- else
- {
- dbroadcast("ALERT: Unauthorized login attempt by User: " + $source + " for frequency: " + $freq + " detected and logged at timestamp: " + $time);
- dbroadcast("Passphrase mismatch. Correct password was: " + $pphrase + ", $aname was: " + $aname + ", $abool was " + $abool);
- }
- $flag = 1;
- }
- $aflag = 0;
- if(mem($admin)) // TODO: redundant, needs removal
- {
- if($source == mem($aname))
- {
- $out = "Admin";
- $aflag = 1;
- }
- }
- // SPELLCHECK FILTERS BELOW
- if($content == "..." || lower($content) == "uh" || lower($content) == "fuck" || lower($content) == "um" || lower($content) == "lol" || lower($content) == "nvm" || lower($content) == "xd" || lower($content) == "cocksucker" || lower($content) == "tits" || lower($content) == "motherfucker" || lower($content) == "piss" || lower($content) == "cunt")
- {
- dbroadcast("NOTE: " + $source + " said something useless: " + $content);
- $pass = false;
- }
- // PRIVATE COMMANDS BELOW
- if($source == mem($aname) && find($arg1, "/"))
- {
- // Remember to tune in to channel 145.7
- // to check script toggles.
- // Voice command, 4 arguments:
- // first name, last name, job, font
- // $pass = false, so completely stealthy
- // anything after this will be content
- if($arg1 == "/voice") // NOTE NOTE NOTE: THIS IS BROKEN IN OGOS
- { // fix involves using $flag to conditionally turn off the tcommsadmin filters
- $pass = true;
- $n1 = $arg2 + " " + $arg3;
- $n2 = $arg4;
- $n3 = $arg5;
- $n4 = substr($content, length(" " + $arg1 + " " + $n1 + " " + $n2 + " " + $n3 + " "), length($content)+1);
- $content = $n4;
- $job = $n2;
- $source = $n1;
- $filters = vector($n3);
- dbroadcast("EXEC: /voice");
- $flag = 1;
- }
- //voice command, 3 arguments:
- //name, job, font
- if($arg1 == "/vce") // BROKEN, see above for fix
- {
- $pass = true;
- $n1 = $arg2;
- $n2 = $arg3;
- $n3 = $arg4;
- $n4 = substr($content, length(" " + $arg1 + " " + $n1 + " " + $newJob + " " + $newFilter + " "), length($content)+1);
- $content = $n4;
- $job = $n2;
- $source = $n1;
- $filters = vector($n3);
- dbroadcast("EXEC: /vce");
- $flag = 1;
- }
- // TOGGLEABLE SCRIPTS BELOW
- // AI voice masking alert, can be toggled. Defaults on
- if($arg1 == "/mask") // tested, works
- {
- $meme = !mem("mask");
- mem("mask",$meme);
- dbroadcast("TOGGLE: /mask, " + $meme);
- $flag = 1;
- }
- // UUID scrambler. Use this to fuck up AI tracking
- // Remember to do /mask first.
- if($arg1 == "/scblr") // tested, works
- {
- $meme = !mem("scblr");
- mem("scblr",$meme);
- dbroadcast("TOGGLE: /scblr, " + $meme);
- $flag = 1;
- }
- // /aio command. If there is no working
- // AI, type this in to notify crew
- if($arg1 == "/aio") // tested, works
- {
- $meme = !mem("aio");
- mem("aio",$meme);
- dbroadcast("TOGGLE: /aio, " + $meme);
- $flag = 1;
- }
- // panic disable comms. toggleable
- if($arg1 == "/panic") // tested, works
- {
- $meme = !mem("panic");
- mem("panic",$meme);
- dbroadcast("TOGGLE: /panic, " + $meme);
- $flag = 1;
- }
- if($flag == 0)
- {
- dbroadcast("Unrecognized private command: '" + $arg1 + "'"); // TODO: using public commands as admin triggers this
- $flag = 1;
- }
- }
- // PRIVATE COMMAND CHECKS
- if($uuid != $source && $joblow != "signal technician" && $mflag == false)
- {
- if(mem("mask") != 1)
- {
- broadcast("ALERT: Voice-masking properties detected from " + $source + "'s transmission.", 1447, "GarlandOS", "Announcer");
- }
- else
- {
- dbroadcast("ALERT: Redacted message from /mask.");
- }
- }
- if(mem("aio"))
- {
- if(find(lower($content), "ai ") || find(lower($content), " ai"))
- {
- fbroadcast("NOTICE: AI is not operational.");
- }
- }
- if(mem("panic"))
- {
- $pass = false;
- dbroadcast("ALERT: /panic filtered message in channel " + $freq + ": " + $source + ": " + $content);
- }
- if(find($arg1, "/") && mem($admin)) // delete the mem($admin) part if you want public commands enabled 24/7
- {
- // PUBLIC COMMANDS BELOW
- // time command
- if($arg1 == "/time")
- {
- fbroadcast("Current time is: " + $time);
- $flag += 2;
- }
- // likewise with the word 'date'
- if($arg1 == "/date")
- {
- $date = timestamp("DDD MMM DD");
- $year = timestamp(" YYYY");
- $year = tonum($year) + 540;
- fbroadcast("Current date is: " + $date + " " + $year);
- $flag += 2;
- }
- // return number of messages broadcasted
- if($arg1 == "/stats")
- {
- fbroadcast("User: " + $source + " has transmitted a total of " + $inc + " signals.");
- $flag += 2;
- }
- // display all commands
- if($arg1 == "/help")
- {
- fbroadcast("*** Current available public commands ***");
- fbroadcast("/time - - - Displays the time.");
- fbroadcast("/date - - - Displays today's date.");
- fbroadcast("/stats - - Displays the user's number of messages.");
- $flag += 2;
- }
- // if the admin is logged in and nothing caught the user's command, do this
- if($flag == 0 && find($arg1, "/") && $aflag)
- {
- fbroadcast("Unrecognized public command: '" + $arg1 + "'. Type '/help' for a list of commands.");
- }
- }
- else
- {
- if(find($content, "/") && !$aflag && $flag == 1) // delete && !$aflag part for adminless public commands
- {
- fbroadcast("Commands are disabled while the administrator is logged out. We apologize for the inconvenience.");
- }
- }
- // END COMMAND SECTION
- // FINAL PROCESSING STEPS
- // store appropriate jobname to $out
- if(mem($joblow))
- {
- $out = mem($joblow);
- }
- else
- {
- $out = substr($job, 1, 31);
- }
- // if user is on the manifest, add their job to the verb
- if($joblow != "unknown" && $joblow != "no id")
- {
- if($aflag)
- {
- $say = "dictates";
- $ask = "demands";
- $exclaim = "declares";
- $yell = "roars";
- }
- else
- {
- $say = "(" + $out + ") " + pick("remarks", "comments", "says", "says", "notes", "points out", "reports", "alleges", "interjects", "mentions", "speaks up", "retorts", "elucidates", "dictates");
- $ask = "(" + $out + ") " + pick("inquires", "queries", "asks", "asks", "requests", "questions", "investigates", "solicits");
- $exclaim = "(" + $out + ") " + pick("declares", "proclaims", "shouts", "calls out", "ejaculates");
- $yell = "(" + $out + ") " + pick("cries out", "roars", "shouts", "calls out", "yells", "screams");
- }
- }
- // if user is not on the manifest, make it known
- else
- {
- if(rand(10) == 2 && $inc <= 20)
- { // crew manifest can be bypassed in this version of garlandOS
- fbroadcast("ADVISORY: " + $source + " is not on the crew manifest. This means the source is either a machine, a(n un)welcome visitor or an animal.");
- }
- dbroadcast("NOTE: Non-crewmember '" + $source + "' has job: " + $joblow);
- $source = $source + " (Non-Crew)";
- $say = pick("remarks", "comments", "says", "says", "notes", "points out", "reports", "alleges", "interjects", "mentions", "speaks up", "retorts", "elucidates", "dictates");
- $ask = pick("inquires", "queries", "asks", "asks", "requests", "questions", "investigates", "solicits");
- $exclaim = pick("declares", "proclaims", "shouts", "calls out", "ejaculates");
- $yell = pick("cries out", "roars", "shouts", "calls out", "yells", "screams");
- }
- // if source is the administrator, apply appropriate filters
- if($aflag && $flag != 2)
- {
- $source = "TCOMMSADMIN: " + $source;
- $filters = vector($loud);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement