ID:168260
 
I'm trying to remember what the command(s) are to basically say, "[player] has challenged you to a fight!","Accept","Decline"" but I forgot what to put in front of that to make it pop up on-screen
for the target of the verb, which is (Player as mob). I know one is alert, but i don't remember the other, can someone help?

~Vlad~
switch(input("[usr] has challenged you. Would you like to accept?","Battle"/* "battle" here is the popup title*/) in list ("Yes","No")
if("Yes")
lalalalala
else if("No") // the else if() can also be else I guess o.o
lalalalalalala

Look up input() and Lummox JR's AreYouSure library, useful to make sure the person recieving the question doesn't have the window up for too long.
In response to Mysame
Thx you kindly! That helped a bunch!

~Vlad~
In response to Mysame
Mysame wrote:
> switch(input("[usr] has challenged you. Would you like to accept?","Battle"/* "battle" here is the popup title*/) in list ("Yes","No")
> if("Yes")
> lalalalala
> else if("No") // the else if() can also be else I guess o.o
> lalalalalalala


else if() is used when there is more then two arguments.
For instance:
switch(input("Choose something","Roah") in list("A","B","C","D","Cancel"))
if("A")
world << "Roah"
else if("B")
world << "Doah"
else if("C")
world << "Koah"
else if("D")
world << "Moah"
else
world << "Ohh, cancel me why don't you!! *crys*"


Normally it isn't needed, because the same script would work just fine as:

switch(input("Choose something","Roah") in list("A","B","C","D","Cancel"))
if("A")
world << "Roah"
if("B")
world << "Doah"
if("C")
world << "Koah"
if("D")
world << "Moah"
if("Cancel")
world << "Ohh, cancel me why don't you!! *crys*


Well, I know thats how it works in Visual Basic. I'm not sure if DM uses else if() for more then one argument or not. But I imagine it would be the same.