View unanswered posts | View active topics It is currently Thu Mar 28, 2024 11:41 pm



Reply to topic  [ 10 posts ] 
 UI question 
Author Message
Ambassador
User avatar

Joined: Fri Feb 23, 2001 3:00 am
Posts: 4016
Location: USA
Unread post 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
Profile ICQ WWW
Veteran Op
User avatar

Joined: Sat Dec 29, 2007 5:06 pm
Posts: 2059
Location: Oklahoma
Unread post 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
Profile ICQ YIM WWW
Commander

Joined: Sun Feb 25, 2001 3:00 am
Posts: 1837
Location: Guam USA
Unread post 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

Image
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
Profile WWW
Ambassador
User avatar

Joined: Fri Feb 23, 2001 3:00 am
Posts: 4016
Location: USA
Unread post 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
Profile ICQ WWW
Ambassador
User avatar

Joined: Fri Feb 23, 2001 3:00 am
Posts: 4016
Location: USA
Unread post 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
Profile ICQ WWW
Commander

Joined: Sun Feb 25, 2001 3:00 am
Posts: 1837
Location: Guam USA
Unread post 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

Image
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
Profile WWW
Veteran Op
User avatar

Joined: Sat Dec 29, 2007 5:06 pm
Posts: 2059
Location: Oklahoma
Unread post 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
Profile ICQ YIM WWW
Ambassador
User avatar

Joined: Fri Feb 23, 2001 3:00 am
Posts: 4016
Location: USA
Unread post 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.

_________________

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
Profile ICQ WWW
Veteran Op
User avatar

Joined: Sat Dec 29, 2007 5:06 pm
Posts: 2059
Location: Oklahoma
Unread post 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
Profile ICQ YIM WWW
Ambassador
User avatar

Joined: Fri Feb 23, 2001 3:00 am
Posts: 4016
Location: USA
Unread post 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
Profile ICQ WWW
Display posts from previous:  Sort by  
Reply to topic   [ 10 posts ] 

Who is online

Users browsing this forum: No registered users and 33 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.