Page 1 of 1 1
Topic Options
#200619 - 2010-11-15 03:53 PM How do I read input from the display?
Bosborn Offline
Just in Town

Registered: 2010-11-15
Posts: 1
Loc: Pennsylvania
Is it possible to do this? I am attempting to write a script that will play a TUI game. Is there a method to capture text output to the display?

Thanks!

Brian

Top
#200620 - 2010-11-15 05:27 PM Re: How do I read input from the display? [Re: Bosborn]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
You could have a look at the WSHPipe UDF.

WshPipe() - Pipes the results of a shell command to an array
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#200621 - 2010-11-15 06:11 PM Re: How do I read input from the display? [Re: Bosborn]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Yes, you can capture the console output but it's damned tricky.

Probably the easiest way to do it is to leverage the facilities provided by AutoIT. Is you use the scriptable DLL you'll be able to grab the window, read it's contents in KiXtart and send key-strokes to it.

Oh yeah, it's free too, which is nice.

Top
#200645 - 2010-11-18 05:51 AM Re: How do I read input from the display? [Re: alexberger753]
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
TUI Game = Text-Based User Input Game ?

(Had to Google it)

Does that mean what your really looking for is a method to read input "from" the display ?

-Shawn


Top
#200647 - 2010-11-18 08:37 AM Re: How do I read input from the display? [Re: Shawn]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
That was certainly my interpretation, hence the suggestion that AutoIT was a good fit - you can pull the text from a (console) window and push keystrokes. Asynchronously.

I missed a link earlier: http://www.autoitscript.com/

Top
#200657 - 2010-11-19 02:45 AM Re: How do I read input from the display? [Re: Richard H.]
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
ok, I was just thinking our friend was looking for ...

 Code:

? "Do you want to play a TUI game ? [Y/N]: " 

GETS $Answer

If $Answer = "Y"
 
 ?"Alrighty then ... pick a number between 1 and 10 ..."

Endif


Top
#200659 - 2010-11-19 09:57 AM Re: How do I read input from the display? [Re: Shawn]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Ahhh... I see what you mean.

I was in PA on business recently, they sure do talk funny.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.055 seconds in which 0.029 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org