The say verb will try to detect some simple errors (say msay) and warn the sender.

The sender is allowed to just send, edit or cancel their message.
This commit is contained in:
Amunak
2014-11-28 10:22:40 +01:00
parent 5dff5228a0
commit b21067596c
+10
View File
@@ -12,6 +12,16 @@
if(say_disabled) //This is here to try to identify lag problems
usr << "\red Speech is currently admin-disabled."
return
//Let's try to make users fix their errors - we try to detect single, out-of-place letters and 'unintended' words
var/first_letter = copytext(message,1,2)
if((copytext(message,2,3) == " " && first_letter != "I" && first_letter != "A" && first_letter != ";") || cmptext(copytext(message,1,5), "say ") || cmptext(copytext(message,1,4), "me ") || cmptext(copytext(message,1,6), "looc ") || cmptext(copytext(message,1,5), "ooc ") || cmptext(copytext(message,2,6), "say "))
var/response = alert(usr, "Do you really want to say this using the *say* verb?\n\n[message]\n", "Confirm your message", "Yes", "Edit message", "No")
if(response == "Edit message")
message = input(usr, "Please edit your message carefully:", "Edit message", message)
if(!message)
return
else if(response == "No")
return
set_typing_indicator(0)
usr.say(message)