igotandrew Posted January 21, 2008 Share Posted January 21, 2008 (edited) Hello, I'm trying to create a little script that renews my ip address, because I am behind a router. expandcollapse popupCall("rInternet") Func rInternet() if WinExists("Mozilla Firefox") or WinExists(" - Mozilla Firefox") Then WinActivate("Mozilla Firefox") Sleep(1500) Else Run("C:\Program Files\Mozilla Firefox\firefox.exe", "", @SW_MAXIMIZE) Sleep(4000) EndIf If WinActive("Mozilla Firefox") Then ;Do Something Else WinActivate("Mozilla Firefox") EndIf MouseClick("left", 378, 66) Sleep(1000) Send("{DELETE}") Sleep(250) Send("192.168.1.1{ENTER}") Sleep(1000) Send("admin{tab}admin{ENTER}") ;Authentication Required Sleep(7000) MouseMove(256, 629, 100) Sleep(100) MouseDown("left") sleep(250) MouseUp("left") ;MouseClick("left", 256, 629, 2) ; $pix1 = PixelGetColor(137, 450) ; $pix2 = PixelGetColor(263, 460) ; $pix3 = PixelGetColor(131, 567) ; $pix4 = PixelGetColor(268, 568) ;if $pix1 = "0x6666CC" Then ; MouseClick("left", 256, 629, 2) ;MsgBox(0, "", "Found Pixel 1") ;ElseIf $pix2 = "0x6666CC" Then ; MouseClick("left", 256, 629, 2) ; MsgBox(0, "", "Found Pixel 2") ;ElseIf $pix3 = "0x6666CC" Then ; MouseClick("left", 256, 629, 2) ; MsgBox(0, "", "Found Pixel 3") ;ElseIf $pix4 = "0x6666CC" Then ; MouseClick("left", 256, 629, 2) ; MsgBox(0, "", "Found Pixel 4") ; EndIf Sleep(18000) EndFunc I'm trying to get it to click the renew ip button, but thats not happening. Everything else works. Any ideas? I've tried 2 different methods. --- Couple of things I forgot to add 0x6666CC << Is a safe pixel (it only shows on the webpage after it's loaded) 256, 629 << Coords of the Renew Ip button Edited January 21, 2008 by Depression Link to comment Share on other sites More sharing options...
igotandrew Posted January 21, 2008 Author Share Posted January 21, 2008 So no one knows the answer? Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 21, 2008 Share Posted January 21, 2008 If you want to do this in AutoIt, then you should be using IE and the IE.au3 UDF. I personally never use IE except where I have to, but if you want to script it from AutoIt, this is one of the "have to's". Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
igotandrew Posted January 22, 2008 Author Share Posted January 22, 2008 I don't know how to load ie w/ it. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 22, 2008 Share Posted January 22, 2008 I don't know how to load ie w/ it. The way to find out is to learn. Read the help file for the _IE* functions. Try a few of the example scripts. Yours would start like this: #include <IE.au3> $oIE = _IECreate("http://192.168.1.1") ; ... Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
igotandrew Posted January 22, 2008 Author Share Posted January 22, 2008 is IE.au3 already included in the installation? I can't seem to find it on the forums. Link to comment Share on other sites More sharing options...
Swift Posted January 22, 2008 Share Posted January 22, 2008 it is...type: #Include <IE.au3> cheers Link to comment Share on other sites More sharing options...
igotandrew Posted January 22, 2008 Author Share Posted January 22, 2008 So I've been toying with IE and for some reason I can't get the window to work... I try stuff like WinExist(" - Microsoft Internet") and it doesn't return 1. Link to comment Share on other sites More sharing options...
igotandrew Posted January 22, 2008 Author Share Posted January 22, 2008 This is the status of my router page.Is there a way to read the status, to see if its "Disconnect", "Connecting", or "Connected"?This doesn't seem to show up on visible text with the au3 window info app. Link to comment Share on other sites More sharing options...
igotandrew Posted January 22, 2008 Author Share Posted January 22, 2008 This is the status of my router page.Is there a way to read the status, to see if its "Disconnect", "Connecting", or "Connected"?This doesn't seem to show up on visible text with the au3 window info app. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 22, 2008 Share Posted January 22, 2008 Yes, you can get into the HTML web page document from the router in IE using the _IE* functions, and find out what text comes after "Status:". View the source on the page and find out what kind of Form/Frame/Tag/etc. that text is in. Then you go get it with the _IE* functions. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
igotandrew Posted January 22, 2008 Author Share Posted January 22, 2008 Like which function? I know how to isolate it, but how do I get the source? Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 22, 2008 Share Posted January 22, 2008 Like which function?I know how to isolate it, but how do I get the source?On the IE toolbar: View | SourceYou are looking for Form tags then probably the input tags for the input boxes and buttons you want to work with. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
SpookMeister Posted January 22, 2008 Share Posted January 22, 2008 _IEBodyReadHTML() ? [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
igotandrew Posted January 22, 2008 Author Share Posted January 22, 2008 _IEBodyReadHTML() ?Thanks, thats what I was looking for. Link to comment Share on other sites More sharing options...
igotandrew Posted January 23, 2008 Author Share Posted January 23, 2008 What do I do with that? I can't even get the source w/o obj var or something.. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 23, 2008 Share Posted January 23, 2008 What do I do with that? I can't even get the source w/o obj var or something..You should really temporarily stop work on this project and work your way through the examples in the help file for the _IE* functions. Once you understand that, it will be much easier to help you.What you are looking to pick up on is how the Document Object Model (DOM) works in a web browser (IE in this case). How to find objects in a Form, how to find input tags and identify the ones the ones you want, etc. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
igotandrew Posted January 24, 2008 Author Share Posted January 24, 2008 You should really temporarily stop work on this project and work your way through the examples in the help file for the _IE* functions. Once you understand that, it will be much easier to help you.What you are looking to pick up on is how the Document Object Model (DOM) works in a web browser (IE in this case). How to find objects in a Form, how to find input tags and identify the ones the ones you want, etc. What do you mean? Link to comment Share on other sites More sharing options...
igotandrew Posted January 25, 2008 Author Share Posted January 25, 2008 I read the function info.. Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 25, 2008 Share Posted January 25, 2008 I read the function info..That's a start. Did you run any of the examples in the help file for the various _IE* functions? Have you successfully gotten it show you the HTML for the page? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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