falslev Posted May 24, 2004 Share Posted May 24, 2004 I use AutiIt to copy/paste a lot of text from one website to another. Sometimes the server is slow and then my script fucks up because its trying to continue before the page is done loading. Can u somehow get the script to check for that? Link to comment Share on other sites More sharing options...
trids Posted May 24, 2004 Share Posted May 24, 2004 (edited) If you use AutoSpy to watch a page as it loads, have a look at the section called Status Bar Text. You can monitor this from your script, and continue only when the right message appears.EG: (using MSIE), while loading a page, mine gives a whole list of messages while the page is loading, and then a final one that says Done, when it has finished. This might be different depending on the site(s) and browser you're using. Which is why you need to use AutoSpy to see what's good for you Edited May 24, 2004 by trids Link to comment Share on other sites More sharing options...
trids Posted May 24, 2004 Share Posted May 24, 2004 ..OR.. You can monitor the animation that plays while a file is loading: when a pixel stays the same for a second or two, then you can assume the load has finished.In MSIE, the animation I'm referring to is the logo in the top right corner, that revolves around a globe.Again, monitor a page with AutoSpy .. and see how the Pixel Colour Under Mouse section changes while you hover your mouse over the logo.See the help file for AutoItSetOption ("PixelCoordMode",param) and PixelGetColor if you want to use this approach.Hope this helps Link to comment Share on other sites More sharing options...
falslev Posted May 24, 2004 Author Share Posted May 24, 2004 It's correct that in windows Spy it says: >>>>>>>>>( Status Bar Text )<<<<<<<< (1): Done (2): (3): (4): (5): (6): Internet Dos any one know how to set the script to look for (1) to be Done ?? Link to comment Share on other sites More sharing options...
SlimShady Posted May 24, 2004 Share Posted May 24, 2004 I move the mouse cursor to the top of the page, and waits until it turns into a normal arrow. Works 100 percent. MouseMove(100, 1, 0) $x = MouseGetCursor() Do $x = MouseGetCursor() Sleep(500) Until $x = 2 Link to comment Share on other sites More sharing options...
Administrators Jon Posted May 24, 2004 Administrators Share Posted May 24, 2004 ..OR.. You can monitor the animation that plays while a file is loading: when a pixel stays the same for a second or two, then you can assume the load has finished.In MSIE, the animation I'm referring to is the logo in the top right corner, that revolves around a globe.Again, monitor a page with AutoSpy .. and see how the Pixel Colour Under Mouse section changes while you hover your mouse over the logo.See the help file for AutoItSetOption ("PixelCoordMode",param) and PixelGetColor if you want to use this approach.Hope this helps The PixelChecksum() function in the new unstable is also cool for things like that. Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
trids Posted May 24, 2004 Share Posted May 24, 2004 Dos any one know how to set the script to look for (1) to be Done ??I think StatusbarGetText ( "title" [, "text" [, part]] ) is what you're after Link to comment Share on other sites More sharing options...
falslev Posted May 24, 2004 Author Share Posted May 24, 2004 Thank you all very much. I have choosen SlimShady solution because then my scirpt will work on all IE browses no matter what "page is loading" image it's using. Now i only have one question SlimShady. If the page is reel heavy and take a long time to load the scripts stops. Why? Link to comment Share on other sites More sharing options...
SlimShady Posted May 24, 2004 Share Posted May 24, 2004 What do you mean by "it stops"? Does the script pause? It shouldn't do that... Link to comment Share on other sites More sharing options...
bshoenhair Posted May 24, 2004 Share Posted May 24, 2004 This is what I use,seems to work like a charm $MousePos = MouseGetPos() $CursorActivity = MouseGetCursor() Do Sleep(500) MouseMove(100, 1, 0) $CursorActivity = MouseGetCursor() Until $CursorActivity = 2 And StatusbarGetText(WinGetTitle("")) = "Done" MouseMove($MousePos[0], $MousePos[1], 0) Link to comment Share on other sites More sharing options...
falslev Posted May 24, 2004 Author Share Posted May 24, 2004 The script stops like if its done. Link to comment Share on other sites More sharing options...
SlimShady Posted May 24, 2004 Share Posted May 24, 2004 I don't understand. I use this as an example and it works perfect: AutoItSetOption("WinTitleMatchMode", 2) Run("explorer http://www.msn.com") WinWait("Internet Explorer") Sleep(1000) WinSetState("Internet Explorer", "", @SW_MAXIMIZE) MouseMove(100, 1, 0) $x = MouseGetCursor() Do $x = MouseGetCursor() Sleep(500) Until $x = 2 Link to comment Share on other sites More sharing options...
brett Posted May 25, 2004 Share Posted May 25, 2004 The script stops like if its done.do you mean 'done', like it stops when the bottom of the page says "done"? -Brett Link to comment Share on other sites More sharing options...
falslev Posted May 25, 2004 Author Share Posted May 25, 2004 NO It's just like the script expires. Link to comment Share on other sites More sharing options...
Valik Posted May 25, 2004 Share Posted May 25, 2004 Put a MsgBox in your script after the loop checking for the page and see if it comes up. Link to comment Share on other sites More sharing options...
tutor2000 Posted May 29, 2004 Share Posted May 29, 2004 This is what I use,seems to work like a charm $MousePos = MouseGetPos() $CursorActivity = MouseGetCursor() Do Sleep(500) MouseMove(100, 1, 0) $CursorActivity = MouseGetCursor() Until $CursorActivity = 2 And StatusbarGetText(WinGetTitle("")) = "Done" MouseMove($MousePos[0], $MousePos[1], 0)Got this from Larry a long time ago and edited it a bit func pageloaded($a) MouseMove(0,0) $bSure = 0 While $bSure < 5 $ret=StatusBarGetText($a) == "Done" If StatusBarGetText($a) == "Done" or StatusBarGetText($a) =="" then $bSure = $bSure + 1 Else $bSure = 0 EndIf Sleep(150) Wend ;MsgBox(4096, "AutoIt", $ret) ;Return $a EndFunc ;Rick Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm 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