//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") /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 << "\red 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 //remove out adminhelp verb temporarily to prevent spamming of admins. src.verbs -= /client/verb/adminhelp spawn(1200) src.verbs += /client/verb/adminhelp // 2 minute cool-down for adminhelps //clean the input msg if(!msg) return msg = sanitize(copytext(msg,1,MAX_MESSAGE_LEN)) if(!msg) return var/original_msg = msg //explode the input msg into a list var/list/msglist = text2list(msg, " ") //generate keywords lookup var/list/surnames = list() var/list/forenames = list() var/list/ckeys = list() 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 = text2list(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, iCL)" : ""]: [msg]" //send this msg to all admins var/admin_number_total = 0 //Total number of admins var/admin_number_afk = 0 //Holds the number of admins who are afk var/admin_number_ignored = 0 //Holds the number of admins without +BAN (so admins who are not really admins) var/admin_number_decrease = 0 //Holds the number of admins with are afk, ignored or both for(var/client/X in admins) admin_number_total++; var/invalid = 0 if(!check_rights_for(X, R_BAN)) admin_number_ignored++ invalid = 1 if(X.is_afk()) admin_number_afk++ invalid = 1 if(invalid) admin_number_decrease++ if(X.prefs.toggles & SOUND_ADMINHELP) X << 'sound/effects/adminhelp.ogg' X << msg //show it to the person adminhelping too src << "PM to-Admins: [original_msg]" var/admin_number_present = admin_number_total - admin_number_decrease //Number of admins who are neither afk nor invalid log_admin("HELP: [key_name(src)]: [original_msg] - heard by [admin_number_present] non-AFK admins who have +BAN.") if(admin_number_present <= 0) if(!admin_number_afk && !admin_number_ignored) send2irc(ckey, "[original_msg] - No admins online") else send2irc(ckey, "[original_msg] - All admins AFK ([admin_number_afk]/[admin_number_total]) or skipped ([admin_number_ignored]/[admin_number_total])") feedback_add_details("admin_verb","AH") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc! return proc/send2irc(msg,msg2) if(config.useircbot) shell("python nudge.py [msg] [msg2]") return