| www.ClassicTW.com http://classictw.com/ |
|
| UI question http://classictw.com/viewtopic.php?f=15&t=34676 |
Page 1 of 1 |
| Author: | Cruncher [ Sun Aug 16, 2015 6:27 pm ] |
| Post subject: | UI question |
When using getInput, I'd like to echo the user input back to the terminal. How can I do this? getinput $var "*Do this" getText $var $value "" "" echo $value This isn't working, but the script does still compile seemingly ignoring the getText and echo lines. |
|
| Author: | T0yman [ Mon Aug 17, 2015 10:33 am ] |
| Post subject: | Re: UI question |
. |
|
| Author: | Vid Kid [ Mon Aug 17, 2015 11:18 am ] |
| Post subject: | Re: UI question |
Cruncher wrote: When using getInput, I'd like to echo the user input back to the terminal. How can I do this? getinput $var "*Do this" getText $var $value "" "" echo $value This isn't working, but the script does still compile seemingly ignoring the getText and echo lines. Just tested what your looking for ... Code: getinput $var "write something here " getText $var $value "" "" echo "**"& ANSI_14 $value &"**" |
|
| Author: | Cruncher [ Mon Aug 17, 2015 5:01 pm ] |
| Post subject: | Re: UI question |
Vid Kid wrote: Just tested what your looking for ... Code: getinput $var "write something here " getText $var $value "" "" echo "**"& ANSI_14 $value &"**" Thanks! That works! |
|
| Author: | Cruncher [ Mon Aug 17, 2015 5:21 pm ] |
| Post subject: | Re: UI question |
T0yman wrote: Cruncher wrote: getinput $var "*Do this" getText $var $value "" "" echo $value I don't think you need the * in the top line. But in order to test add some pauses and echos as you go it will be easier to troubleshoot the problem. getinput $var "Do This" echo $var (result should be Do This) pause getText $var $value "" "" <--- it's grabbing the entire line and is redundant you could just have used setvar $value $var if that's all you're doing. echo $value (result should be Do This) pause Without the second set of double quotes, the getText syntax didn't have enough parameters, I had to leave that in. "Do This" is the question to the user, their input is what's getting echoed. I don't want to echo the question I'm posing, but the user response. So the user can review the settings before the script launches. This just seemed much more "light-weight" than coding a whole menu. T0yman wrote: I don't have a connection here to mess with but I tested just using this: setvar $var "Do This" gettext $var $value "" "" echo $value And it echo's Do This You're more than welcome to come test on my server ') |
|
| Author: | Vid Kid [ Mon Aug 17, 2015 5:45 pm ] |
| Post subject: | Re: UI question |
Cruncher wrote: T0yman wrote: Cruncher wrote: getinput $var "*Do this" getText $var $value "" "" echo $value I don't think you need the * in the top line. But in order to test add some pauses and echos as you go it will be easier to troubleshoot the problem. getinput $var "Do This" echo $var (result should be Do This) pause getText $var $value "" "" <--- it's grabbing the entire line and is redundant you could just have used setvar $value $var if that's all you're doing. echo $value (result should be Do This) pause Without the second set of double quotes, the getText syntax didn't have enough parameters, I had to leave that in. "Do This" is the question to the user, their input is what's getting echoed. I don't want to echo the question I'm posing, but the user response. So the user can review the settings before the script launches. This just seemed much more "light-weight" than coding a whole menu. T0yman wrote: I don't have a connection here to mess with but I tested just using this: setvar $var "Do This" gettext $var $value "" "" echo $value And it echo's Do This You're more than welcome to come test on my server ') This snippet can be tested offline on any machine. Does not require a connection to test an echo command or the getinput. Unless a script requires a game input or prompt , then offline testing can be done with just twx and a telnet client. Vid |
|
| Author: | T0yman [ Mon Aug 17, 2015 7:01 pm ] |
| Post subject: | Re: UI question |
. |
|
| Author: | Cruncher [ Mon Aug 17, 2015 7:35 pm ] |
| Post subject: | Re: UI question |
T0yman wrote: T0yman wrote: setvar $var "Do This" gettext $var $value "" "" echo $value And it echo's Do This The way her script was wrote it required input....that's why I wrote mine the way I did....no way to simulate the input she was looking for. So yea mine was tested but hers couldn't be at my location. Look again, my first line isn't setvar it's getInput getInput has a get & set built into it. Xanos showed me that. He writes the "action" portion of the script. I'm just having a go at writing the UI that he's not that fond of writing the UI himself. |
|
| Author: | T0yman [ Mon Aug 17, 2015 8:17 pm ] |
| Post subject: | Re: UI question |
T0yman wrote: The way her script was wrote it required input....that's why I wrote mine the way I did....no way to simulate the input she was looking for. So yea mine was tested but hers couldn't be at my location. Cruncher wrote: Look again, my first line isn't setvar it's getInput Yea I think that's why I wrote the above message. I should know better than to try.....for some reason I needed a reminder why I will never play this game again. Thanks. |
|
| Author: | Cruncher [ Mon Aug 17, 2015 8:26 pm ] |
| Post subject: | Re: UI question |
T0yman wrote: T0yman wrote: The way her script was wrote it required input....that's why I wrote mine the way I did....no way to simulate the input she was looking for. So yea mine was tested but hers couldn't be at my location. Cruncher wrote: Look again, my first line isn't setvar it's getInput Yea I think that's why I wrote the above message. I should know better than to try.....for some reason I needed a reminded why I will never play this game again. Thanks. You and I never have spoken the same language, have we? Why reiterate what I just asked for? I thought my question was crystal clear, Vid got it. "When using getInput, I'd like to echo the user input back to the terminal. How can I do this?" |
|
| Page 1 of 1 | All times are UTC - 5 hours |
| Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |
|