Sign in to follow this  
Followers 0
jdisme

Yeah, I'm new.

15 posts in this topic

I just started using autoit yesterday and I love it! But I dont quite have the experience that I'm sure you all do.

Ok, I'm trying to make a program that people enter the website that they would like to access and autoit automatically pings that website (to get around filters), opens Browser, and inputs that ping result. but i cant find a way to make it copy that address since i cant click or copy anything from cmd. anyone got any ideas? I'm sure I can complete it after I find a way around this problem...

Here is what I have so far:

$var = InputBox ("Bypass", "Please enter the site that you are trying to access.")

Sleep (500)

Send ("{Lwin}")

Sleep (10)

Send ("{r}")

Sleep (50)

Send ("ping ")

Send ($var)

Send ("{enter}")

Share this post


Link to post
Share on other sites



Why not check the ip with AutoIt instead of dos??

Ehhh.... because I dont know how? (just started yesterday) If you could enlighten me on how to do that I would be eternally grateful...

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I just started using autoit yesterday and I love it! But I dont quite have the experience that I'm sure you all do.

Ok, I'm trying to make a program that people enter the website that they would like to access and autoit automatically pings that website (to get around filters), opens Browser, and inputs that ping result. but i cant find a way to make it copy that address since i cant click or copy anything from cmd. anyone got any ideas? I'm sure I can complete it after I find a way around this problem...

Here is what I have so far:

$var = InputBox ("Bypass", "Please enter the site that you are trying to access.")

Sleep (500)

Send ("{Lwin}")

Sleep (10)

Send ("{r}")

Sleep (50)

Send ("ping ")

Send ($var)

Send ("{enter}")

This is one way that might do what you have asked for

$var = InputBox ("Bypass", "Please enter the site or IP Address that you are trying to access.")
InetGet("http://" & $var & "/","result.htm")
ShellExecute("result.htm")
Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Maybe try TCPNameToIP() ???

Dont know how to use it yet but I'm looking into it, thanks for the help :D

Share this post


Link to post
Share on other sites

Run(@ComSpec & " /c ping www.site.com >> ip.txt", @ScriptDir, @SW_HIDE)

Will output the result of the ping command to ip.txt.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Thanks so much for your help guys, I completed the script.

here it is:

$var = InputBox ("Bypass", "Please enter the site that you are trying to access.")
Run ("C:\Program Files\Mozilla Firefox 3 Beta 5\firefox.exe")
Sleep (1000)
Send ("{tab}")
Send ("{tab}")
TCPStartup()
Send (TCPNameToIP($var))
Send ("{enter}")

You may have to change the second line depending on your browser.

Edited by jdisme

Share this post


Link to post
Share on other sites

Thanks so much for your help guys, I completed the script.

here it is:

$var = InputBox ("Bypass", "Please enter the site that you are trying to access.")
Run ("C:\Program Files\Mozilla Firefox 3 Beta 5\firefox.exe")
Sleep (1000)
Send ("{tab}")
Send ("{tab}")
TCPStartup()
Send (TCPNameToIP($var))
Send ("{enter}")

You may have to change the second line depending on your browser.

This would be a little simpler and wouldn't depend on the browser or path to it

$var = InputBox ("Bypass", "Please enter the site that you are trying to access.");eg www.google.com
ShellExecute($var)

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Ok. now that I know a little about shellexecute works how could I work that into the script?

$var = InputBox ("Bypass", "Please enter the site that you are trying to access.")
TCPStartup()
(TCPNameToIP($var))
ShellExecute ($var)

^---- does not work

Share this post


Link to post
Share on other sites

First of all you dont save the value from TCPNameToIP, second you have a couple of paranthesis around your TCPNameToIp which there shouldn't be in the way you use it and third of all you cant ShellExecute() a ip-address, that will only give an error from windows about unknown application.

I created a quick working example (dont forget to change the first variable)

$IE = "C:\Program\Internet Explorer" ;change this to where you have Internet Explorer installed
$Website = InputBox("Bypass", "Please enter the site that you are trying to access.")
TCPStartup()
$TcpIp = TCPNameToIP($Website)
ShellExecute("iexplore.exe", $TcpIp, $IE)

Share this post


Link to post
Share on other sites

can i make it bring up their default browser instead of IE?

Share this post


Link to post
Share on other sites

#13 ·  Posted

Ok. now that I know a little about shellexecute works how could I work that into the script?

$var = InputBox ("Bypass", "Please enter the site that you are trying to access.")
TCPStartup()
(TCPNameToIP($var))
ShellExecute ($var)

^---- does not work

What is wrong with the simpler

$var = InputBox ("Bypass", "Please enter the site that you are trying to access.");eg www.google.com
ShellExecute($var)

that I suggetsed?

If you enter, for example, www.google.com then it works fine for me, and it uses the default browser.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

I think he has a filter wich blocks by URL, not by IP :)

$Website = InputBox("Bypass", "Please enter the site that you are trying to access.")
TCPStartup()
$TcpIp = "http://"&TCPNameToIP($Website)
ShellExecute($TcpIp)
TCPShutdown()

But this works only for pages with a real IP, not Virtual Servers .

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

#15 ·  Posted

I think he has a filter wich blocks by URL, not by IP :)

Oh thanks ProgAndy, I didn't understand that was what a filter did.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
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
Sign in to follow this  
Followers 0