/proc/keywords_lookup(msg,irc) //This is a list of words which are ignored by the parser when comparing message contents for names. MUST BE IN LOWER CASE! var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","alien","as", "i") //explode the input msg into a list var/list/msglist = splittext(msg, " ") //generate keywords lookup var/list/surnames = list() var/list/forenames = list() var/list/ckeys = list() var/founds = "" for(var/mob/M in mob_list) var/list/indexing = list(M.real_name, M.name) if(M.mind) indexing += M.mind.name for(var/string in indexing) var/list/L = splittext(string, " ") var/surname_found = 0 //surnames for(var/i=L.len, i>=1, i--) var/word = ckey(L[i]) if(word) surnames[word] = M surname_found = i break //forenames for(var/i=1, i(?|F) " continue msg += "[original_word] " if(irc) if(founds == "") return "Search Failed" else return founds return msg /client/var/adminhelptimerid = 0 /client/proc/giveadminhelpverb() src.verbs |= /client/verb/adminhelp adminhelptimerid = 0 /client/verb/adminhelp(msg as text) set category = "Admin" set name = "Adminhelp" if(say_disabled) //This is here to try to identify lag problems usr << "Speech is currently admin-disabled." return //handle muting and automuting if(prefs.muted & MUTE_ADMINHELP) src << "Error: Admin-PM: You cannot send adminhelps (Muted)." return if(src.handle_spam_prevention(msg,MUTE_ADMINHELP)) return //clean the input msg if(!msg) return msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN)) if(!msg) return var/original_msg = msg //remove our adminhelp verb temporarily to prevent spamming of admins. src.verbs -= /client/verb/adminhelp adminhelptimerid = addtimer(src, "giveadminhelpverb", 1200, TIMER_NORMAL) //2 minute cooldown of admin helps msg = keywords_lookup(msg) if(!mob) return //this doesn't happen var/ref_mob = "\ref[mob]" var/ref_client = "\ref[src]" msg = "HELP: [key_name(src)] (?) (PP) (VV) (SM) (FLW) (TP) (REJT): [msg]" //send this msg to all admins for(var/client/X in admins) if(X.prefs.toggles & SOUND_ADMINHELP) X << 'sound/effects/adminhelp.ogg' window_flash(X) X << msg //show it to the person adminhelping too src << "PM to-Admins: [original_msg]" //send it to irc if nobody is on and tell us how many were on var/admin_number_present = send2irc_adminless_only(ckey,original_msg) log_admin("HELP: [key_name(src)]: [original_msg] - heard by [admin_number_present] non-AFK admins who have +BAN.") feedback_add_details("admin_verb","AH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return /proc/get_admin_counts(requiredflags = R_BAN) . = list("total" = 0, "noflags" = 0, "afk" = 0, "stealth" = 0, "present" = 0) for(var/client/X in admins) .["total"]++ if(requiredflags != 0 && !check_rights_for(X, requiredflags)) .["noflags"]++ else if(X.is_afk()) .["afk"]++ else if(X.holder.fakekey) .["stealth"]++ else .["present"]++ /proc/send2irc_adminless_only(source, msg, requiredflags = R_BAN) var/list/adm = get_admin_counts(requiredflags) . = adm["present"] if(. <= 0) var/final = "" if(!adm["afk"] && !adm["stealth"] && !adm["noflags"]) final = "[msg] - No admins online" else final = "[msg] - All admins AFK ([adm["afk"]]/[adm["total"]]), stealthminned ([adm["stealth"]]/[adm["total"]]), or lack[rights2text(requiredflags, " ")] ([adm["noflags"]]/[adm["total"]])" send2irc(source,final) send2otherserver(source,final) /proc/send2irc(msg,msg2) if(config.useircbot) shell("python nudge.py [msg] [msg2]") return /proc/send2otherserver(source,msg,type = "Ahelp") if(global.cross_allowed) var/list/message = list() message["message_sender"] = source message["message"] = msg message["source"] = "([config.cross_name])" message["key"] = global.comms_key message["crossmessage"] = type world.Export("[global.cross_address]?[list2params(message)]") /proc/ircadminwho() var/msg = "Admins: " for(var/client/C in admins) msg += "[C] " if(C.holder.fakekey) msg += "(Stealth)" if(C.is_afk()) msg += "(AFK)" msg += ", " return msg