Prompt for input

Post Reply
Darmir
Posts: 226
Joined: Sun May 01, 2011 6:51 pm
Contact:

Prompt for input

Post by Darmir »

How do you make a question that is awaiting for an answer before continuing?

Example: (Y/N) Do you want to add bashing triggers?

User avatar
Omit
Posts: 190
Joined: Sun Aug 01, 2010 10:54 pm
Location: Middle Earth
Contact:

Re: Prompt for input

Post by Omit »

could use a temp alias....
ask question, create temp alias for all input, process result (if valid response, disable alias, else re-ask question.)

I would love the ability to use a dialog box to do this kind of stuff... should be fairly easy to add to mudlet. (not for me tho, I do not know c++)

Darmir
Posts: 226
Joined: Sun May 01, 2011 6:51 pm
Contact:

Re: Prompt for input

Post by Darmir »

there is an api request to do this. I was hoping someone wrote a script for it already.
See here.

Darmir
Posts: 226
Joined: Sun May 01, 2011 6:51 pm
Contact:

Re: Prompt for input

Post by Darmir »

Anybody know how have this? I tried an example in the lua manual and it isn't working.

User avatar
tsuujin
Posts: 695
Joined: Fri Feb 26, 2010 12:59 am
Location: California
Contact:

Re: Prompt for input

Post by tsuujin »

I don't know if you're entirely set on the whole "modal dialog" thing, but a simple solution to this would be to print a message to the screen and create a self-destroying, catch-all alias for the next entry.

Darmir
Posts: 226
Joined: Sun May 01, 2011 6:51 pm
Contact:

Re: Prompt for input

Post by Darmir »

Anybody have some code for this? I just want to stop a script until the user replies to a question?

User avatar
Omit
Posts: 190
Joined: Sun Aug 01, 2010 10:54 pm
Location: Middle Earth
Contact:

Re: Prompt for input

Post by Omit »

Lua does not have a "pause script" or "wait for response" option at all...
In order to do this... you need to break up the code....
Have one part ask the question(echo the question to the main window),
setup the event to capture response(setup a temp alias to capture the result),
complete the task when the response is captured(preform some code when the temp alias fires and then destroy temp alias).

(with or without modal dialogs the code has to be broken up.... I would prefer modal dialogs for some things as they are more user friendly for certain applications)

Post Reply