christian11 Posted May 29, 2016 Share Posted May 29, 2016 my script is working fine in my main monitor. but however when i use with my dual monitor it cant detect pixels from extended monitor.. any idea why? green=PixelSearch(0, 0, @DesktopWidth, @DesktopHeight, 0x00FF00) If isArray($green) then send("1") sleep (300) Link to comment Share on other sites More sharing options...
AutoBert Posted May 29, 2016 Share Posted May 29, 2016 (edited) Pixelsearch is one oft the worst and unsafest ways to automate a application. There are much better ways for automation, so please: tell the name of the apllication you want to automate for finding a good solution. Edited May 29, 2016 by AutoBert Link to comment Share on other sites More sharing options...
christian11 Posted May 29, 2016 Author Share Posted May 29, 2016 (edited) im trying to automate google chrome with two displays. using controlsend in inactive window any suggestions? Edited May 29, 2016 by christian11 Link to comment Share on other sites More sharing options...
AutoBert Posted May 29, 2016 Share Posted May 29, 2016 There is a Chrome.au3 (by seangriffin) available. Automate the most common tasks in Chrome with the Chrome UDF. Link to comment Share on other sites More sharing options...
EmilyLove Posted May 29, 2016 Share Posted May 29, 2016 Don't use 0 as your left and top values as these numbers can be negative if your secondary monitor is positioned above or to the left of your main monitor. Might be why it's not working for you. Link to comment Share on other sites More sharing options...
christian11 Posted May 29, 2016 Author Share Posted May 29, 2016 so it would be green=PixelSearch(-1, -1, @DesktopWidth, @DesktopHeight, 0x00FF00) is it correct?? Link to comment Share on other sites More sharing options...
Bert Posted May 29, 2016 Share Posted May 29, 2016 christian - did you read the post where there is a chrome au3 that will work no matter what? Pixel search is a terrible way to deal with screen interaction. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
AutoBert Posted May 29, 2016 Share Posted May 29, 2016 38 minutes ago, christian11 said: so it would be green=PixelSearch(-1, -1, @DesktopWidth, @DesktopHeight, 0x00FF00) is it correct?? no would raise a syntax error. Link to comment Share on other sites More sharing options...
AutoBert Posted May 29, 2016 Share Posted May 29, 2016 10 hours ago, AutoBert said: There is a Chrome.au3 (by seangriffin) available. Automate the most common tasks in Chrome with the Chrome UDF. Link to comment Share on other sites More sharing options...
christian11 Posted May 30, 2016 Author Share Posted May 30, 2016 unfortunately chrome.au3 didnt work in extended screen Link to comment Share on other sites More sharing options...
Bert Posted May 30, 2016 Share Posted May 30, 2016 please post your code The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
EmilyLove Posted May 31, 2016 Share Posted May 31, 2016 (edited) On 5/29/2016 at 5:34 PM, christian11 said: so it would be green=PixelSearch(-1, -1, @DesktopWidth, @DesktopHeight, 0x00FF00) is it correct?? No. As an example, let's say your monitor setup is the following: Monitor 1 (main) has a resolution of 1920x1080. This monitor is to the right of Monitor 2 Monitor 2 (secondary) has a resolution of 1024x768. This monitor is to the left of Monitor 1. The top left pixel of the monitor 1 is 0x0. The top right pixel of the monitor 1 is 1920x0. The center pixel of monitor 1 is 960x540. The bottom left pixel of the monitor 1 is 0x1080. The bottom right pixel of the monitor 1 is 1920x1080. The top left pixel of the monitor 2 is -1024x0. The top right pixel of the monitor 2 is -1x0. The center pixel of monitor 2 is -512x384. The bottom left pixel of the monitor 2 is -1024x768. The bottom right pixel of the monitor 2 is -1x768. Try to think of it like plotting boxes on a horizontally (x) inverted axis graph. Right is +x, Down is +y, Left is -x, and Up is -y. If you are unsure as where your monitors are positioned, refer to Control Panel's Display Resolution page. "Control Panel\All Control Panel Items\Display\Screen Resolution" Edited May 31, 2016 by BetaLeaf Fixed coordinates. Link to comment Share on other sites More sharing options...
junkew Posted May 31, 2016 Share Posted May 31, 2016 https://www.autoitscript.com/wiki/FAQ faq 31. IUIAutomation works independent of monitor FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Bert Posted May 31, 2016 Share Posted May 31, 2016 OMG - why do some you keep insisting on using pixelsearch? Several of the more experienced people keep pointing out how bad and unreliable it is yet you keep beating that drum. EmilyLove 1 The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
EmilyLove Posted May 31, 2016 Share Posted May 31, 2016 Because we are stuborn haha . The op asked for help in pixelsearch so help in pixelsearch I gave. Yea pixelsearch is bad in most cases but sometimes it's the only option that works. It's all case by case. Link to comment Share on other sites More sharing options...
Bert Posted May 31, 2016 Share Posted May 31, 2016 in this case it is NOT the only option that works. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
EmilyLove Posted May 31, 2016 Share Posted May 31, 2016 5 hours ago, Bert said: in this case it is NOT the only option that works. Look man I'm just trying to help. We don't know what the op is even trying to do, we haven't seen the full code. How can you be so sure stuff doesn't work when you don't know what the op is trying to do. For all we know, he might be trying to automate a Java based speed test. We just don't know so don't be so sure. Everything is case by case, some stuff works, others dont. Sorry if you don't like my opinion. Synapsee 1 Link to comment Share on other sites More sharing options...
junkew Posted May 31, 2016 Share Posted May 31, 2016 OP is trying to automate chrome so pixelsearch is not easy with chrome so alternatives are better. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
AutoBert Posted May 31, 2016 Share Posted May 31, 2016 2 hours ago, BetaLeaf said: Look man I'm just trying to help. We don't know what the op is even trying to do, we haven't seen the full code. We don't know what op trying to do in case of he's not saying exactly what he want to do and isn't anwering: 21 hours ago, Bert said: please post your code and when a MVP ask, it's usual noone give further support until question is answered. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 31, 2016 Moderators Share Posted May 31, 2016 1 hour ago, AutoBert said: and when a MVP ask, it's usual noone give further support until question is answered. Not sure where you picked that up from... "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! 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