inmysights Posted April 21, 2016 Share Posted April 21, 2016 I have employees who VPN to work, I log into a web version of the Cisco IOS in firefox I want to take a screen shot of them logged in and refresh the page if I am not able to be at my desk This is a very simple script, I all I want it to do is, winactivate the firefox screen then mouseclick the refresh button then screenshot When I run the script it activates the window then just stops, if I eliminate the winactivate it will click and screenshot, something is stopping the mouseclick #include <ScreenCapture.au3> WinActivate("Mozilla Firefox") MouseClick("left",876,357,1,0) _ScreenCapture_Capture(@MyDocumentsDir & "\VPN.jpg") IS there a way to troubleshoot and find out what is running to block my mouseclicks? Thank you Link to comment Share on other sites More sharing options...
mikell Posted April 21, 2016 Share Posted April 21, 2016 MouseClick is not very reliable... please try this instead #include <ScreenCapture.au3> Opt("WinTitleMatchMode", 2) $hwnd = WinActivate("Mozilla Firefox") ControlSend($hwnd, "", "", "{F5}") _ScreenCapture_Capture(@ScriptDir & "\VPN.jpg") Link to comment Share on other sites More sharing options...
inmysights Posted April 21, 2016 Author Share Posted April 21, 2016 Thank you, that is much better, wasn't thinking about F5 refresh I also figured out why it wasn't working initially, I needed to run SCITE as admin and it was doing mouseclicks just fine after that. one thing I was also trying to figure out I have a query button that I want to check on the same page, what I am trying to do is, if that query button equals the color in $query then mouseclick at that location, is this correct, my logic maybe on the right track I am using the color number from the info tool, is the number in the tool Dec or Hex? Under the mouse tab 0x0FAEB1 $query = PixelGetColor( 654, 567) while 1 If $query = Dec("0FAEB1") Then MouseClick("left",654,567,1,0) EndIf WEnd Link to comment Share on other sites More sharing options...
mikell Posted April 22, 2016 Share Posted April 22, 2016 If the while loop is here to check a color change at (654, 567) then it should probably work better if you put the PixelGetColor inside the loop 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