markyrocks Posted March 5, 2015 Share Posted March 5, 2015 Ok So I been working on a program for awhile and I have a bunch of preset places to click and if anyone else than me ever uses it the program won't work if their resolution is different than mine so long story short I made a function that gets the % the users resolution is to mine. And I save that as a variable and just add *$varx and *$vary to the x and y coordinate. So I really haven't tested it yet but there's a strong possibility that it could be a decimal. So what can I expect to happen if it is? I'd hope that it just rounds up or down. I guess I could add mouseclick(int (123*$xdif),int (123*$ydif)) But that still a lot more messing around than what I want Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
jdelaney Posted March 5, 2015 Share Posted March 5, 2015 (edited) You can easily test this out yourself... MouseMove(500.8, 500.8) Sleep(2000) MouseMove(500, 500) These will end up moving the mouse to the same spot. So there must be some rounding as part of the function. You can replace mousemove with mouseclick...I just didn't want to actually click anything on my comp. As per the actual issue...I'd suggest using: ControlClick This function has NO reliance on your resolution, location, etc. The window can even be off the screen, or minimized, and this will still do the trick. Edited March 5, 2015 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
markyrocks Posted March 5, 2015 Author Share Posted March 5, 2015 I would test it myself kinda busy atm... thanks tho Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
TheSaint Posted March 5, 2015 Share Posted March 5, 2015 Not too hard to just use the Round (or Floor or Ceiling) function with no decimal places. Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
markyrocks Posted March 5, 2015 Author Share Posted March 5, 2015 (edited) Nm I need to stop posting after I've had couple beers Edited March 5, 2015 by markyrocks Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
Bert Posted March 5, 2015 Share Posted March 5, 2015 is there some reason you can't do controlclick? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
markyrocks Posted March 5, 2015 Author Share Posted March 5, 2015 Yes bc for one I don't totally understand how it works. But u guess I'll look into it Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
Bert Posted March 5, 2015 Share Posted March 5, 2015 it may be helpful for you to tell us the app you are working with. We may have code ready for you to make it easier. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
markyrocks Posted March 5, 2015 Author Share Posted March 5, 2015 I'm just trying to click on different buttons on webpages. My logic is sound the only issue is the webpages don't scale the way I'd expect them to. I've tried using control click but the info tool doesn't display unique info when I highlight a particular button . When I talk about scaling in a predictable way. Going from 1536x864 res to 1920x1080 the x coordinate of an item doesn't match the scale. I.e. 1920/1536=1.25 if x was 1000 @ 1536x864 it should be 1250@1920x1080 but the actual location is different the higher the x pos the more it's off. And also in regards to the scaling the y coordinate between the 2 resolutions stays the same i.e if an object was at y=400 at 1536x864 it would still be there at 1920x1080. This has to be a coding issue related to the page bc if I say find a specific point on my desktop change the resolution find the spot again compare numbers. And multiply the x,y(@1536x864)by 1.25 (which should be the spot @1920×1080) it matches almost to the pixel of where I determined it would be with the mouse. The only reason it's not exact is probably on my ability to get the mouse in exactly the same spot... Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
jdelaney Posted March 6, 2015 Share Posted March 6, 2015 (edited) This doesn't rely on coordinates...get the object, and click it directly: _IeAction($oyourobject,"Click") Edited March 6, 2015 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
markyrocks Posted March 6, 2015 Author Share Posted March 6, 2015 (edited) That would be great but unfortunately I'm using chrome. I've even tried using the simplespy.au3 and the uiawrappers.au3 ect and it just doesn't recognize it as an object. Maybe I should consider using IE but I just don't like it. Chrome is so much faster. Edited March 6, 2015 by markyrocks Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
Bert Posted March 6, 2015 Share Posted March 6, 2015 There is a way to do it with chrome. Look at this:'?do=embed' frameborder='0' data-embedContent>> The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
markyrocks Posted March 6, 2015 Author Share Posted March 6, 2015 Dude I've been all over that thread I have the simplespy.au3 ect it doesn't work. I can't even get it to click on the toolbar. It basically say run simplespy hover cursor over button,control ect hit ctrl+w, it writes the code and it still don't work. Either way I figured out how to bypass pressing those buttons just using Web addresses instead Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
jdelaney Posted March 6, 2015 Share Posted March 6, 2015 Browser DOMs are not accessible to the spy tool. You have to use the _ie functions, like I suggested above. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
markyrocks Posted March 6, 2015 Author Share Posted March 6, 2015 Ok So how exactly do I implement IE functions to work on chrome? Spoiler "I Believe array math to be potentially fatal, I may be dying from array math poisoning" Link to comment Share on other sites More sharing options...
jdelaney Posted March 6, 2015 Share Posted March 6, 2015 you don't. Use IE, or look up the Chrome udf in the 'examples' forum. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window. Link to comment Share on other sites More sharing options...
Bert Posted March 6, 2015 Share Posted March 6, 2015 use IE to get the info FIRST so you get the control codes. THEN use the other stuff I sent you to do it in Chrome The Vollatran project My blog: http://www.vollysinterestingshit.com/ 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