Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
danweasel
Newbie


Joined: 01 May 2004
Posts: 2
Location: USA

PostPosted: 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?
Reply with quote
Amylon
Novice


Joined: 31 Jan 2003
Posts: 49
Location: Australia

PostPosted: 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
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Sat May 01, 2004 6:13 pm   
 
Commands and functions specifically designed to get information from the user:
#PICK
#PROMPT
#YESNO
%pick
%prompt
%yesno
Reply with quote
danweasel
Newbie


Joined: 01 May 2004
Posts: 2
Location: USA

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net