Author |
Message |
Cruncher
Ambassador
Joined: Fri Feb 23, 2001 3:00 am Posts: 4016 Location: USA
|
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.
_________________
BOTE 1998 Champs: Team Fament HHT 2015 Champs: Cloud09 Big Game 2016 Champs: Draft team HHT 2018 Champs: Rock Stars Big Game 2019 Champs: Draft Team
Classic Style Games Here: telnet://crunchers-twgs.com:2002 Web page from 1990's: https://web.archive.org/web/20170103155645/http://tradewars.fament.com/Cruncher/tradewar.htm Blog with current server info: http://cruncherstw.blogspot.com Discord: https://discord.gg/4dja5Z8 E-mail: Cruncherstw@gmail.com FaceBook: http://www.facebook.com/CrunchersTW
|
Sun Aug 16, 2015 6:27 pm |
|
|
T0yman
Veteran Op
Joined: Sat Dec 29, 2007 5:06 pm Posts: 2059 Location: Oklahoma
|
Re: UI question
.
_________________ T0yman (Permanently Retired since 2012) Proverbs 17:28 <-- Don't know it, most should it would stop a lot of the discussions on here.
Last edited by T0yman on Mon Aug 17, 2015 8:09 pm, edited 2 times in total.
|
Mon Aug 17, 2015 10:33 am |
|
|
Vid Kid
Commander
Joined: Sun Feb 25, 2001 3:00 am Posts: 1837 Location: Guam USA
|
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 &"**"
_________________ TWGS V2 Vids World on Guam Port 2002 Telnet://vkworld.ddns.net:2002 Discord @ DiverDave#8374 Vid's World Discord
Founding Member -=[Team Kraaken]=- Ka Pla
Winners of Gridwars 2010 MBN Fall Tournament 2011 winners Team Kraaken Undisputed Champions of 2019 HHT Just for showing up!
The Oldist , Longist Running , Orginal Registered Owner of a TWGS server : Vids World On Guam
|
Mon Aug 17, 2015 11:18 am |
|
|
Cruncher
Ambassador
Joined: Fri Feb 23, 2001 3:00 am Posts: 4016 Location: USA
|
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!
_________________
BOTE 1998 Champs: Team Fament HHT 2015 Champs: Cloud09 Big Game 2016 Champs: Draft team HHT 2018 Champs: Rock Stars Big Game 2019 Champs: Draft Team
Classic Style Games Here: telnet://crunchers-twgs.com:2002 Web page from 1990's: https://web.archive.org/web/20170103155645/http://tradewars.fament.com/Cruncher/tradewar.htm Blog with current server info: http://cruncherstw.blogspot.com Discord: https://discord.gg/4dja5Z8 E-mail: Cruncherstw@gmail.com FaceBook: http://www.facebook.com/CrunchersTW
|
Mon Aug 17, 2015 5:01 pm |
|
|
Cruncher
Ambassador
Joined: Fri Feb 23, 2001 3:00 am Posts: 4016 Location: USA
|
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 ')
_________________
BOTE 1998 Champs: Team Fament HHT 2015 Champs: Cloud09 Big Game 2016 Champs: Draft team HHT 2018 Champs: Rock Stars Big Game 2019 Champs: Draft Team
Classic Style Games Here: telnet://crunchers-twgs.com:2002 Web page from 1990's: https://web.archive.org/web/20170103155645/http://tradewars.fament.com/Cruncher/tradewar.htm Blog with current server info: http://cruncherstw.blogspot.com Discord: https://discord.gg/4dja5Z8 E-mail: Cruncherstw@gmail.com FaceBook: http://www.facebook.com/CrunchersTW
|
Mon Aug 17, 2015 5:21 pm |
|
|
Vid Kid
Commander
Joined: Sun Feb 25, 2001 3:00 am Posts: 1837 Location: Guam USA
|
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
_________________ TWGS V2 Vids World on Guam Port 2002 Telnet://vkworld.ddns.net:2002 Discord @ DiverDave#8374 Vid's World Discord
Founding Member -=[Team Kraaken]=- Ka Pla
Winners of Gridwars 2010 MBN Fall Tournament 2011 winners Team Kraaken Undisputed Champions of 2019 HHT Just for showing up!
The Oldist , Longist Running , Orginal Registered Owner of a TWGS server : Vids World On Guam
|
Mon Aug 17, 2015 5:45 pm |
|
|
T0yman
Veteran Op
Joined: Sat Dec 29, 2007 5:06 pm Posts: 2059 Location: Oklahoma
|
Re: UI question
.
_________________ T0yman (Permanently Retired since 2012) Proverbs 17:28 <-- Don't know it, most should it would stop a lot of the discussions on here.
Last edited by T0yman on Mon Aug 17, 2015 8:09 pm, edited 2 times in total.
|
Mon Aug 17, 2015 7:01 pm |
|
|
Cruncher
Ambassador
Joined: Fri Feb 23, 2001 3:00 am Posts: 4016 Location: USA
|
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 getInputgetInput 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.
_________________
BOTE 1998 Champs: Team Fament HHT 2015 Champs: Cloud09 Big Game 2016 Champs: Draft team HHT 2018 Champs: Rock Stars Big Game 2019 Champs: Draft Team
Classic Style Games Here: telnet://crunchers-twgs.com:2002 Web page from 1990's: https://web.archive.org/web/20170103155645/http://tradewars.fament.com/Cruncher/tradewar.htm Blog with current server info: http://cruncherstw.blogspot.com Discord: https://discord.gg/4dja5Z8 E-mail: Cruncherstw@gmail.com FaceBook: http://www.facebook.com/CrunchersTW
|
Mon Aug 17, 2015 7:35 pm |
|
|
T0yman
Veteran Op
Joined: Sat Dec 29, 2007 5:06 pm Posts: 2059 Location: Oklahoma
|
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.
_________________ T0yman (Permanently Retired since 2012) Proverbs 17:28 <-- Don't know it, most should it would stop a lot of the discussions on here.
Last edited by T0yman on Mon Aug 17, 2015 8:34 pm, edited 1 time in total.
|
Mon Aug 17, 2015 8:17 pm |
|
|
Cruncher
Ambassador
Joined: Fri Feb 23, 2001 3:00 am Posts: 4016 Location: USA
|
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?"
_________________
BOTE 1998 Champs: Team Fament HHT 2015 Champs: Cloud09 Big Game 2016 Champs: Draft team HHT 2018 Champs: Rock Stars Big Game 2019 Champs: Draft Team
Classic Style Games Here: telnet://crunchers-twgs.com:2002 Web page from 1990's: https://web.archive.org/web/20170103155645/http://tradewars.fament.com/Cruncher/tradewar.htm Blog with current server info: http://cruncherstw.blogspot.com Discord: https://discord.gg/4dja5Z8 E-mail: Cruncherstw@gmail.com FaceBook: http://www.facebook.com/CrunchersTW
|
Mon Aug 17, 2015 8:26 pm |
|
|
|