Author Topic: Yes/No Box  (Read 2985 times)

I've tried both
Code: [Select]
commandToClient(%Client,MessageBoxYesNoDlg',"Title","Message");and
Code: [Select]
commandToClient(%Client,MessageBoxYesNo',"Title","Message");Neither do the trick.

Any ideas? And how does one collect the value from the client's selection?

There isn't a client command for MessageBoxYesNo, only MessageBoxOK.
« Last Edit: June 12, 2008, 09:06:46 AM by Resonance_Cascade »

MessageBoxOKCancel should work I think, but you have to specify functions to be run when the user selects a particular option.

Make the GUI, and make both buttons call a serverCmd.

Make the GUI, and make both buttons call a serverCmd.

You are an idiot.  This can be done without client code.

No, I'm not. The clientside code can be distributed with the GUI.

It doesn't appear from his message that he wants to distribute a GUI or client-side code at all.  Your idea won't work for a server-side solution.

I didn't say it would work as a server-side solution, I simply gave a way to do what he wanted. I'll write a quick chat-based script right now.

Lol, what a waste of time.  You are clearly not understanding what he wants.

Not a waste of time for me. One, I'm bored. Two, I find it rude to simply reply with "Not possible without clientside code" and leave, and would rather give an alternative.

Code: [Select]
function YesNo(%client,%question)
{
messageClient(%client,'',%question);
messageClient(%client,'','Please type yes or no to reply.');
%client.isAnsweringQuestion = 1;
%client.question = %question;
}

package YesNoScript
{
function serverCmdMessageSent(%client,%text)
{
if(%client.isAnsweringQuestion == 1)
{
if(%text $= "Yes")
{
%client.isAnsweringQuestion = 0;
handleYesReply(%client);
}
else if(%text $= "No")
{
%client.isAnsweringQuestion = 0;
handleNoReply(%client);
}
else
{
messageClient(%client,'','Invalid response. Please type yes or no.');
}
return;
}
Parent::serverCmdMessageSent(%client,%text);
}
};
ActivatePackage(YesNoScript);

You will need to create handleYesReply and handleNoReply functions.
« Last Edit: June 12, 2008, 01:01:32 PM by Headcrab Zombie »

Not a waste of time for me. One, I'm bored. Two, I find it rude to simply reply with "Not possible without clientside code" and leave, and would rather give an alternative.

I find it rude when people persistently re-register on forums that the owner clearly doesn't want them on.

A good programmer knows how to construct code that falls within a given set of parameters.


Here are the parameters you were given:

Create server-side code that calls a default GUI interface, providing the user with both a positive and negative response option.


Thus, it is not acceptable to respond with a solution that uses a non-default GUI or one that uses only a text interface.

I tried to explain this to you in advance of you wasting your time, but you refused to listen.

Thank you for proving my declaration of your idiocy correct.

"Not possible without clientside code"

This can be done without client code.

You also didn't take the time to read what I said.

I made a reading error, and read that as can't be done without clientside code.

And if it can, why don't you?

Also, looking through my F10 GUI list, it seems theres is already a MessageBoxYesNo. I don't know if it is part of an add-on I downloaded or not.