 |
danweasel Newbie
Joined: 01 May 2004 Posts: 2 Location: USA
|
Posted: Sat May 01, 2004 1:05 pm
Interactive scripts |
Is there a way to design a script so that it prompt the user for text, takes that text and does something with it? I'm relatively new to this, so forgive me if this is a stupid question.
A sample concept model might work something like this:
:run_script_config_pipes
What is the number of the pipe you wish to use for elm?
:1234
What is the number of the pipe you wish to use for valerian?
:1235
etc.
The script would set variables to contain the numbers the user entered, which would then be used in later aliases. The basic reason I want something like this is to more easily configure larger systems, where the number of variables that different users might want to configure is large and dispersed throughout the class hierarchy.
Any thoughts? |
|
|
 |
Amylon Novice
Joined: 31 Jan 2003 Posts: 49 Location: Australia
|
Posted: Sat May 01, 2004 3:24 pm |
Try this Danweasel
#class PIPESET
#alias resetpipes {skullpipe=0;valerianpipe=0;elmpipe=0}
#alias setpipes {resetpipes;#PR skullpipe {What number pipe do you wish to use for skullcap?};#if @skullpipe=0 {#abort 1};#PR valerianpipe {What number pipe do you wish to use for valerian?};#if @valerianpipe=0 {#abort 1};#PR elmpipe {What number pipe do you wish to use for elm?}}
#CLASS 0 |
|
|
 |
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Sat May 01, 2004 6:13 pm |
Commands and functions specifically designed to get information from the user:
#PICK
#PROMPT
#YESNO
%pick
%prompt
%yesno |
|
|
 |
danweasel Newbie
Joined: 01 May 2004 Posts: 2 Location: USA
|
Posted: Sat May 01, 2004 10:02 pm |
Thanks to both of you, Amylon for giving an example of how to use commands and LightBulb for listing out the various interactive commands. That should be able to get what I need done.
|
|
|
 |
|
|