Jump to content

Get info from a BBS-type window


 Share

Recommended Posts

I want to get the text from a database's interface window and search it for a given string, but ControlGetText hasn't successfully grabbed it. The window looks like a typical interface for a BBS, like the kind one might Telnet into. I've tried this code (which works fine for searching NotePad files for text):

$words=ControlGetText("WindowName","",59648)

if stringInStr($words,"theTextIWantToFind") then

msgbox(0,"output","found it")

else

msgbox(0,"output","did not find it")

endif

exit

How should I change it?

Link to comment
Share on other sites

Is it actually a console application? If it is you may be able to redirect the output from the screen to AutoIt using the STD I/O functions from the current beta version of AutoIt.

Example, checks if the current user may dial in to Remote Access:

Dim $process, $output, $linesOut, $foundIt

$process = Run("netsh.exe", @SystemDir, @SW_SHOW, 3)

StdinWrite($process, "ras set user " & @UserName & @CRLF)
StdinWrite($process, "bye" & @CRLF)

While 1
   $output = $output & StdoutRead($process)
   If @error = -1 Then ExitLoop
WEnd

$linesOut = StringSplit($output, @CR)

For $step = 1 To $linesOut[0]
   If StringInStr( $linesOut[$step], "Dialin") Then
      If StringInStr($linesOut[$step], "permit") Then
         $foundIt = 1
      EndIf
   EndIf
Next

If $foundIt = 1 Then
   MsgBox(0, "Success!", "The current user is permitted to dial in to this machine.")
Else
   MsgBox(0, "Failure...", "The current user is not permitted to dial in to this machine.")
EndIf

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

Link to comment
Share on other sites

Is it actually a console application? If it is you may be able to redirect the output from the screen to AutoIt using the STD I/O functions from the current beta version of AutoIt.

Example, checks if the current user may dial in to Remote Access:

Dim $process, $output, $linesOut, $foundIt

$process = Run("netsh.exe", @SystemDir, @SW_SHOW, 3)

StdinWrite($process, "ras set user " & @UserName & @CRLF)
StdinWrite($process, "bye" & @CRLF)

<{POST_SNAPBACK}>

[code truncated]

I'm running version 3.1.0. I couldn't find these functions in the Help file. The public history doesn't indicate that they've been added for 3.1.1, which seems to be the most current version. How do I get a version of AutoIt that incorporates them?

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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