BitByte Posted June 15, 2010 Posted June 15, 2010 (edited) I tried to send keystroke using controlsend(no problem) and controlclick(problem) to a gamewindow but seems like the mouse click on the wrong position. I'm using AutoIt Window Info to get the position. There must be something wrong. Need advice.. Sample of my code: Opt("CaretCoordMode", 0) ;1=absolute, 0=relative, 2=client Opt("MouseCoordMode", 0) ;1=absolute, 0=relative, 2=client Opt("PixelCoordMode", 0) ;1=absolute, 0=relative, 2=client Global $X[6] = [792, 831, 869, 906, 944, 981] Global $Y1 = 125 Global $Y2 = 166 Global $Y3 = 201 Global $Y4 = 237 Global $Y5 = 274 Global $Y6 = 315 Global $Y7 = 347 Global $Y8 = 387 Global $JX = 508 Global $JY = 508 $r1 = 0 For $r1 = 0 To 5 ControlClick("[CLASS:ZElementClient Window]", "", "", "right", 1, $X[$r1], $Y1) Sleep(250) Do ControlClick("[CLASS:ZElementClient Window]", "", "", "left", 1, $JX, $JY) Sleep(250) Until (PixelGetColor(510, 513) == 0xA8A8A8) Next Another question, under the option section on the AutoIt Window Info, there's an option Coord Mode, which should I chooose? Curently I'm using 'Window' option. Pls. advice.. Thanks Edited June 15, 2010 by BitByte
JohnOne Posted June 15, 2010 Posted June 15, 2010 A lot of "gamewindows" have bot countermeasures, where they are designed to not expose information about colours and coordinates. Also it will be difficult trying to ControlClick a Contol without giving the Control ID of the Control you are trying to ContolClick AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Remnant Posted June 15, 2010 Posted June 15, 2010 (edited) Several things. try mouseclick instead of Controlclick and add the left and top pixels of the window to your co-ordinates in the window It's picky, but this is redundant "$r1 = 0" You appear to be attempting to rightclick at 792 across, 125 down, then left click at 508 across and down until the pixel at 510 across, 513 down is a particular color, then repeat at various other points across on the 125 line. you don't appear to use the vast majority of your global variables. Is this intentional? Failing all else, trial and error: you say its clicking on the wrong spot. Is it too high (subtract from y's) too low(add to y's) too far left(subtract from x's) or too far right(add to y's) Edited June 15, 2010 by Remnant
BitByte Posted June 15, 2010 Author Posted June 15, 2010 Got no problem when using mouseclick. The reason I want to use controlclick is because i want it to click even if the windows in unfocus/minimized.
JohnOne Posted June 15, 2010 Posted June 15, 2010 You are not providing the function with an ID for the control you want to click. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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