Jump to content

2 problems i have + a question


MrM
 Share

Recommended Posts

hey there im new here ;)

srtarted using autoit 2 days ago and like very much

i have 2 problems:

1. i need to get all the ips used in a certain port, i didnt find a function for that, thought of using dos 'netsat -n | find "port" ' but the only function i found the manual was _RunDOS($sCommand) (in my case: _RunDOS('netstat -n | find "4000"'') and it return 0, no array not anything else , just a zero.

also, in the manual its not writen how to use that function.

if using that function is not possible for that purpose, how can i do it?

2. autoit doesnt recotnize text inside comuter games, this particular thing is very importante to me, is there a way to make it see text in games?

and the question:

is it possible to do things in inactive windows with autoit? like keystrokes, mouse moves/click and all there is to do with recotnizing text and pixel colors? (i realy hope for a positive answer :P)

Link to comment
Share on other sites

i need to get all the ips used in a certain port

netstat -n | find "4000"'')

Here it is:

#include <Constants.au3>

dim $PID, $cmdOUT

$PID = Run(@comspec & ' /c ' & 'netstat -n | find ' & '"4000"', "","", $STDOUT_CHILD)
       ;MsgBox(1,"PID=",$PID)
While NOT @ERROR
    $cmdOUT &= StdoutRead($PID)
Wend
        if StringInStr($cmdOUT,"ESTABLISHED") <> 0 Then
            MsgBox(1, "netstat results:", $cmdOUT)
        else
            MsgBox(1, "netstat results:", "Port not found")
            Exit
        EndIf

Exit
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Link to comment
Share on other sites

Welcome to the forums!

2. autoit doesnt recotnize text inside comuter games, this particular thing is very importante to me, is there a way to make it see text in games?

Games don't use standard Microsoft controls. If you can manipulate your game to copy text to the clipboard then you could read it using ClipGet(). You may also wish to search the forums for 'OCR'.

is it possible to do things in inactive windows with autoit? like keystrokes, mouse moves/click and all there is to do with recotnizing text and pixel colors? (i realy hope for a positive answer ;) )

Positive! :P

Check out the ControlSend(), ControlClick(), WinGetText() and ControlGetText() functions. I believe that there are also a few pieces of code in the Scripts and Scraps forum that could help you find pixel colours on minimised/hidden windows, but don't quote me on that.

Link to comment
Share on other sites

Jef, just out of curiousity, why did you format that string like this?

I'm the same way with commas. If two are good, six must be better! Also, it was late at night and it worked that way, so I posted and retired... ;) I appreciate the + feedback and will eschew surplusage in the future...
...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
Link to comment
Share on other sites

Seems to work on my w2k sp4 with the autoit beta 3.1.1.75. The function StdoutRead is also documented in the beta help file..;))

Best Regards

Uten

Link to comment
Share on other sites

ty all!

jefhal, in the script u gave me, the function StdoutRead() is not recotnized by compiler, and search thrue manual gave no results...

MrM- Save this link in three places (favorites, on a piece of paper, on the back of your hand). It's a link I go to every time I need to remember where to find the beta code and how to install it correctly: http://www.autoitscript.com/autoit3/scite/...nstallation.htm (hyperlink function broken in forum editor)

I forgot to mention that you would need beta code...My apologies...

...by the way, it's pronounced: "JIF"... Bob Berry --- inventor of the GIF format
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...