ID:178072
 
I thought it would be a good idea to create an administration verb named "Alert", which will send an alert box with a message to a player. This would be used in case they need to be warned of something they are doing wrong, or to privately send a message.

It's a great idea, but I wish it worked. It does work, except if the player hits the escape key instead of the default "Ok" button, some of the other verbs will be locked and unable to be used. Probably because the alert box sleeps the proc. Not sure how to fix this bug. Here's the code:
mob/GM
verb/Alert(mob/M as mob in world)
set category = "GM"
if(M == src) return
var/mob/A = input("Alert [M]:") as null|text
if(!A) return
alert(M,"[A]","Alert from [src] :")

What am I doing wrong?

Matic293
I hope I waited long enough to bother bumping this post. Compared to some people's posts, I was patient for one week, two days, and nine pages. Sorry if this is still unacceptable, and it will not happen again.

I've looked through as many alert-related posts as I could, and still nothing. My Alert verb displays the message to the player, however if the player hits the escape key instead of the deault "OK" button, any proc using "mob/M as mob in world" as an arguement will no longer work.

var/A = input("Alert [M]:") as null|text

Could this be the cause? Point me in the right direction at the least and I would be most grateful.

Matic293
In response to Matic293
it happened to me too. somebody help
In response to Mrhat99au
Mrhat99au wrote:
it happened to me too. somebody help

For the past week, anytime I'd be playing someone's game that uses an alert, I'd hit escape to see what would happen. Many times I got stuck just like I described, while others seemed to cancel properly. Is this a bug, or just bad code?
In response to Matic293
Do you mean Like an alert msg thingie?

Like,

mob/proc/gmalert(mob/M in world,Msg as text)
alert(M,"[usr] Alerts: [Msg]")
In response to Matic293
mob/GM/verb/Alert(mob/M in world, T as text)
if(!M.client || M=usr)
usr<<"You can't send a message to [M]"
else
if(T=null)
usr<<"Please Enter a Message"
else
M<<alert("[usr] alerts you: [T]"
And don't worry if your post hasn't been answered in a week and two days or nine pages I'm pretty sure thats ok.