Jump to content

Yeah, I'm new.


Recommended Posts

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

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.
Link to comment
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.

Edited by jdisme
Link to comment
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.
Link to comment
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

Link to comment
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)
Link to comment
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

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

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

Link to comment
Share on other sites

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

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...