Jump to content

Recommended Posts

Posted

I'm have a difficult problem with reading text from a terminal emulator. To give you some context here, for work I use a terminal emulator that has a couple of different sign on screens, I then have to pass in a series of commands to get to the menu where I actually work from. I'm trying to automate this process for my co-workers and I. I've made a nice little GUI where you enter your username and password. All of this works fine unless of course they have entered the wrong password. AutoIT will pass in the incorrect password and keep running it's script even though the application is waiting for the correct credentials. I'd like my script to be able detect text on the screen for things like login incorrect or password expired.

Here is a screen cap: http://imgur.com/K1DMfHY

I wanted to keep it simple and have my script look for a unique string of text relevent to the "error"... the problem with this is that, even if the error has cleared, it remains on the screen until I move to another page. This being the case, I'd like to search last 30 characters for a unique string. In the event it finds a string, it will produce an input box so a user can input the relevent info.

I actually haven't found a command that will help me detect text. I'd like it to be an IF statement. IF $foundText exists then inputbox. Not sure how to go about this. Your help is much appreciated!

 

  • Moderators
Posted

If you use the AutoIt Window Info Tool (in the same directory where you installed AutoIt) on the terminal window, does it return anything under the visible text tab?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Posted

do you trying to accesc to 

 IBM 3270 Mainframe

?

I have other solution witch support ActiveX

of course I have a working UDF 

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

  • 2 weeks later...
Posted
  On 2/20/2014 at 4:48 PM, JLogan3o13 said:

If you use the AutoIt Window Info Tool (in the same directory where you installed AutoIt) on the terminal window, does it return anything under the visible text tab?

Doesn't look like it does  :(

Posted
  On 2/20/2014 at 5:10 PM, mLipok said:

 

I'm sorry, I'm not sure what to do with this. 

Posted (edited)

  On 3/3/2014 at 4:48 PM, droobot said:

I'm sorry, I'm not sure what to do with this. 

 

First read. 
Secondly, try to understand. 
Thirdly, apply to your own needs.
 

 
Here you have next tip/hint:
 
 
  Quote

 

EXTRA! Basic Code Samples

A collection of over 20 EXTRA! Basic macros is available for download. These educational samples demonstrate:

- displaying Windows dialogs,

- checking the host 3270 OIA status line,

- transferring a file at a regular interval,

- calling Win32 API functions (e.g., modify Windows registry),

- copying host screen text to a Microsoft Excel spreadsheet,

- and more.

Download eb-samples.zip and see the enclosed _ReadMe.txt file for more information.

http://download.attachmate.com/fileinfo.asp?filename=eb-samples.zip

There is a excel.ebm file.

It looks like Visual Basic witch use COM object (EXTRA! Personal Client 6.x (and derivatives))

Try to study it, and come back in a few days if you have further questions.

EDIT:

It looks easy to rewrite version of VisualBasic, on a version for AutoIt.

EDIT2:4

http://docs.attachmate.com/reflection/2014/r1/help/en/vba-reference/

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

how do you interact now with that terminal?
via send() I guess. so, I think you send a sequence of keys (in a near blind way) and you do not knows what's going on on the terminal, but you hope it's all right?
If this is the scenario then the way is a little uphill.

Does your terminal allows you to copy portions of screen to the clipboard via select by mouse and copy?

if so then maybe some rudimental attempt to read characters from terminal could be done in >a way like this.

anyway, the best would be to use the ready made methods pointed out by mLipok

or, as an alternative, to use a terminal emulator that allows you to interact via I/O streams
here there is a good one that is free and that I already used in conjunction with AutoIT

..... good luck

 

image.jpeg.9f1a974c98e9f77d824b358729b089b0.jpeg Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...