jdisme Posted April 25, 2008 Share Posted April 25, 2008 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}") Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted April 25, 2008 Share Posted April 25, 2008 Why not check the ip with AutoIt instead of dos?? But if you really want to use a ">" to redirect the command to a file or use StdoutRead() .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
jdisme Posted April 25, 2008 Author Share Posted April 25, 2008 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... Link to comment Share on other sites More sharing options...
martin Posted April 25, 2008 Share Posted April 25, 2008 (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 April 25, 2008 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. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted April 25, 2008 Share Posted April 25, 2008 Maybe try TCPNameToIP() ??? .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
jdisme Posted April 25, 2008 Author Share Posted April 25, 2008 Maybe try TCPNameToIP() ???Dont know how to use it yet but I'm looking into it, thanks for the help Link to comment Share on other sites More sharing options...
TomZ Posted April 25, 2008 Share Posted April 25, 2008 Run(@ComSpec & " /c ping www.site.com >> ip.txt", @ScriptDir, @SW_HIDE) Will output the result of the ping command to ip.txt. Link to comment Share on other sites More sharing options...
jdisme Posted April 25, 2008 Author Share Posted April 25, 2008 (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 April 25, 2008 by jdisme Link to comment Share on other sites More sharing options...
martin Posted April 25, 2008 Share Posted April 25, 2008 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. Link to comment Share on other sites More sharing options...
jdisme Posted April 29, 2008 Author Share Posted April 29, 2008 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 Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted April 29, 2008 Share Posted April 29, 2008 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) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
jdisme Posted April 30, 2008 Author Share Posted April 30, 2008 can i make it bring up their default browser instead of IE? Link to comment Share on other sites More sharing options...
martin Posted May 2, 2008 Share Posted May 2, 2008 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. Link to comment Share on other sites More sharing options...
ProgAndy Posted May 2, 2008 Share Posted May 2, 2008 (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 May 2, 2008 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 Link to comment Share on other sites More sharing options...
martin Posted May 2, 2008 Share Posted May 2, 2008 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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now