Admin help tweaks.

The keyword scanner (thing that adds (?) links to player names in admin helps) has been moved to its own proc.
This has been added to all admin pms.
It has been added to asays as well, with the (FLW) link removed to avoid it being distracting.

Replying to an admin help (but not other forms of admin pms nor admin pm replies) by clicking on the name of the ahelper will now send a message to all admins letting them know you are typing up a reply to it. (this should avoid mutiple people replying to the same ahelp) (It also sends a message if you escape out of the ahelp reply as well)
This commit is contained in:
MrStonedOne
2015-06-26 16:30:37 -07:00
parent 5b4dba97d0
commit 0aeffb3c0f
4 changed files with 77 additions and 41 deletions
+48 -36
View File
@@ -1,38 +1,7 @@
/client/var/adminhelptimerid = 0
/proc/keywords_lookup(var/msg, var/followlink = 1)
/client/proc/giveadminhelpverb()
src.verbs |= /client/verb/adminhelp
adminhelptimerid = 0
//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 << "<span class='danger'>Speech is currently admin-disabled.</span>"
return
//handle muting and automuting
if(prefs.muted & MUTE_ADMINHELP)
src << "<span class='danger'>Error: Admin-PM: You cannot send adminhelps (Muted).</span>"
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 out adminhelp verb temporarily to prevent spamming of admins.
src.verbs -= /client/verb/adminhelp
adminhelptimerid = addtimer(src,"giveadminhelpverb",1200) //2 minute cooldown of admin helps
//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 = text2list(msg, " ")
@@ -83,15 +52,58 @@ var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","
mobs_found += found
if(!ai_found && isAI(found))
ai_found = 1
msg += "<b><font color='black'>[original_word] (<A HREF='?_src_=holder;adminmoreinfo=\ref[found]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[found]'>FLW</A>)</font></b> "
if (followlink)
msg += "[original_word]<b><font color='black'>(<A HREF='?_src_=holder;adminmoreinfo=\ref[found]'>?</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[found]'>FLW</A>)</font></b> "
else
msg += "[original_word]<b><font color='black'>(<A HREF='?_src_=holder;adminmoreinfo=\ref[found]'>?</A>)</font></b> "
continue
msg += "[original_word] "
return msg
/client/var/adminhelptimerid = 0
/client/proc/giveadminhelpverb()
src.verbs |= /client/verb/adminhelp
adminhelptimerid = 0
var/list/adminhelp_ignored_words = list("unknown","the","a","an","of","monkey","alien","as", "i")
/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 << "<span class='danger'>Speech is currently admin-disabled.</span>"
return
//handle muting and automuting
if(prefs.muted & MUTE_ADMINHELP)
src << "<span class='danger'>Error: Admin-PM: You cannot send adminhelps (Muted).</span>"
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) //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 = "<span class='adminnotice'><b><font color=red>HELP: </font>[key_name_admin(src)] (<A HREF='?_src_=holder;adminmoreinfo=[ref_mob]'>?</A>) (<A HREF='?_src_=holder;adminplayeropts=[ref_mob]'>PP</A>) (<A HREF='?_src_=vars;Vars=[ref_mob]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=[ref_mob]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=[ref_mob]'>FLW</A>) (<A HREF='?_src_=holder;traitor=[ref_mob]'>TP</A>)[ai_found ? " (<A HREF='?_src_=holder;adminchecklaws=[ref_mob]'>CL</A>)" : ""] (<A HREF='?_src_=holder;rejectadminhelp=[ref_client]'>REJT</A>):</b> [msg]</span>"
msg = "<span class='adminnotice'><b><font color=red>HELP: </font><A HREF='?priv_msg=[ckey];ahelp_reply=1'>[key_name(src)]</A> (<A HREF='?_src_=holder;adminmoreinfo=[ref_mob]'>?</A>) (<A HREF='?_src_=holder;adminplayeropts=[ref_mob]'>PP</A>) (<A HREF='?_src_=vars;Vars=[ref_mob]'>VV</A>) (<A HREF='?_src_=holder;subtlemessage=[ref_mob]'>SM</A>) (<A HREF='?_src_=holder;adminplayerobservefollow=[ref_mob]'>FLW</A>) (<A HREF='?_src_=holder;traitor=[ref_mob]'>TP</A>) (<A HREF='?_src_=holder;rejectadminhelp=[ref_client]'>REJT</A>):</b> [msg]</span>"
//send this msg to all admins