diablo1903 Posted May 2, 2009 Posted May 2, 2009 (edited) Hey, im really new to auto-it, and im just wondering if there was a possible way to find the color of a set pixel, and use a certain key depending on what it is. The main thing is that it wont be the active window, and was wondering if it was possible to send a key to that specific (non-active) window instead of the active one. Im assuming for the pixel color, their just cant be anything in front of it, which isnt a problem. Thanks Edited May 2, 2009 by diablo1903
Developers Jos Posted May 2, 2009 Developers Posted May 2, 2009 Let me guess: You did an extensive search on these forums and found out that you must be the first asking this... right ? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
CodyBarrett Posted May 2, 2009 Posted May 2, 2009 Controlsend() pixlegetcolor() sorry jos for ruining your fun [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
Developers Jos Posted May 2, 2009 Developers Posted May 2, 2009 sorry jos for ruining your funYou didn't .. he is all yours. Success with explaining the commands you just posted and making that work. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
CodyBarrett Posted May 2, 2009 Posted May 2, 2009 Controlsend (FROM HELPFILE) ControlSend ( "title", "text", controlID, "string" [, flag] ) title - The title of the window to access. text - The text of the window to access. controlID - The control to interact with. See Controls. string - String of characters to send to the control. flag - [optional] Changes how "keys" is processed: flag = 0 (default), Text contains special characters like + to indicate SHIFT and {LEFT} to indicate left arrow. flag = 1, keys are sent raw. Return Value Success: Returns 1. Failure: Returns 0 if window/control is not found. Remarks ControlSend works in a similar way to Send but it can send key strokes directly to a window/control, rather than just to the active window. ControlSend is only unreliable for command prompts as that works differently to normal windows (seems to check physical states rather than accepting the keystroke messages). For normal windows ControlSend should be way more reliable than a normal Send - and yes it does send shift, ctrl, alt etc. As mention in the Send help the keyboard that send different chars when in CAPS LOCK and using the Shift Key cannot be simulated. An example is the Czech Keyboard. A good workaround is to use the ControlSetText. The control might first need to be given focus with the ControlFocus command, specially when referencing an controlID created by the script itself. Opt("SendKeyDelay",...) alters the the length of the brief pause in between sent keystrokes. Opt("SendKeyDownDelay",...) alters the length of time a key is held down before being released during a keystroke. lol hope some of that helps [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
Humper Posted May 2, 2009 Posted May 2, 2009 I just have to ask one thing:title - The title of the window to access.text - The text of the window to access.Whats the difference? [center][/center]
Developers Jos Posted May 2, 2009 Developers Posted May 2, 2009 (edited) Controlsend (FROM HELPFILE)lol hope some of that helpsMy conclusions:what are the odds that a member called diablo1903 will be making a bot for a game? (diablo??) How many controls do you think there will be on a games window?How would you use pixelgetcolor() on a hidden/minimized window?Jos - out... Edited May 2, 2009 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
CodyBarrett Posted May 2, 2009 Posted May 2, 2009 (edited) true... once again.. like in my sig.. helpfile is your best friend.. oh and the forums help too and humper the title is the windows TITLE the text is whats in the window.. like controls and text Edited May 2, 2009 by CodyBarrett [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
Developers Jos Posted May 2, 2009 Developers Posted May 2, 2009 I just have to ask one thing:Whats the difference?Title versus Text. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Humper Posted May 2, 2009 Posted May 2, 2009 Still don't really getting it Title is: Mozilla Firefox Text is: Pixel color and keypresses - autoit forums or do I get this wrong? [center][/center]
Developers Jos Posted May 2, 2009 Developers Posted May 2, 2009 Still don't really getting it Title is: Mozilla FirefoxText is: Pixel color and keypresses - autoit forums or do I get this wrong?Please read the helpfile on this which clearly explains the difference between searching the Window Title and the text in the window itself.This thread needs to go back on the OP's topic. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
diablo1903 Posted May 3, 2009 Author Posted May 3, 2009 My conclusions:what are the odds that a member called diablo1903 will be making a bot for a game? (diablo??) How many controls do you think there will be on a games window?How would you use pixelgetcolor() on a hidden/minimized window?Jos - out...It essentially is a bot of sorts, but its not for Diablo. The type of thing I'm making should really be a lot simpler then that, more like:if pixel x is red, press b. if pixel x is blue, press c.Just something extremely simple like that, my question wasn't essentially of how to do it, just a general question of if it was possible to check the color of a minimized/inactive window, and to send keypress' to it.As for the searching comment- I didn't think id be able to find a simple yes/no answer with a certain code line id be able to use, without finding an entirely made bot. As if I found a made one, my laziness would force me to use that instead of making one (Which I don't want to happen)Also just as another small question, is it possible to move a specified window to a pre-set point on the screen?
will88 Posted May 3, 2009 Posted May 3, 2009 is it possible to move a specified window to a pre-set point on the screen?WinMove() ? Password-Keeper
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