Most of these scripts are compatable, but there are conflicts. The sequence of things is important. Definitely room for improvement. All scripts need the global def process_signal(sig){ as a header and return sig;} as a footer, unless specified otherwise. e.g.:
def process_signal(sig){ // Header. if(sig.source=="Ben Mothman"){ sig.job="Nerd"; } // Some script. sig.source+=" ("+sig.job+")"; // More script. return sig;} // Footer. |
For a guide on how to use these scripts, look here.
Jobs will appear in parenthesis after names. Reccommended to add very last in script.
def process_signal(sig){ sig.source+=" ("+sig.job+")"; return sig;} |
Will broadcast a message from "The D20" to the frequency /roll was spoken to.
def process_signal(sig){ exp=explode(sig.content," "); if(exp[1]=="/roll"){ sig.pass=0; broadcast(signal(pick("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"),sig.freq,"The D20")); } return sig;} |
Will give anyone with the matching job title the high volume radio. Can also substitute sig.job for sig.source and replace the job with the name of the of person.
def process_signal(sig){ if(find(list("Signal Technician"), sig.job)){ sig.filters+="command_headset"; } return sig;} |
Will add in a timestamp before each comms message
//We're goign to reconstruct the time manually totaltime = time(); //First, convert to seconds and round to nearest second totaltime/=10; //Then, get a minutes timer minutes = totaltime/60; minutes = floor(minutes); //Finally, get leftover seconds seconds = totaltime-60*minutes; if(seconds<10){ seconds = tostring(seconds); seconds = "0"+seconds;} //Here we reconstruct it sig.source="(" +minutes + ":" + seconds + ") " + sig.source ; |
Runs through sig.content and finds words (badWords) and replaces them (goodWords). The words are not case sensitive since the script will make each word it scans to lower before checking for a match, but if a badWord is at the end of a sentence with punctuation, it will not filter it currently. The first if( ) statement checks to see if it is on security channel and can be removed, but you are less likely to get in trouble if you leave it.
if(sig.freq == 1359){ if(find(jobs, sig.job)){ sig.job = jobs[find(jobs, sig.job) + 1]; } sig.source += "[" + sig.job + "]"; return sig; }else{ badWords = list("Insert", "Words", "Here"); goodWords = list("Insert", "Words", "Here"); i = 0; while(i <= length(explode(sig.content, " "))){ message = explode(sig.content, " "); t = find(badWords, lower(message[i])); if(find(badWords, lower(message[i]))){ message[i] = goodWords[t]; } i += 1; sig.content = implode(message, " "); } } |
Broadcasts Poly onto all frequencies with the clown megaphone. Might Probably will get you lynched.
if(find("Poly", sig.source)){ sig.filter += list("clown"); freqs = list(1459, 1447, 1359, 1357, 1355, 1353, 1351, 1349, 1347); n = 0; while(n <= length(freqs)){ sig.freq = freqs[n]; broadcast(sig); } } |