Ayaaa Posted August 15, 2011 Posted August 15, 2011 (edited) Hi everybody I started recently to use Autoit3, and im starting an automated task. The function is easy, but I cant figure out how to do it >_> Works like this: - Reads the coord of a pixel color. - Saves it - clicks on it - Delete the memory saved of the pixel color. - repeat it. Here is my code if it can help you :3 Func Function() ;===========================Colores de pixeles=============================== local $Ctrigo1 = pixelsearch(0,0, 900, 700, 0xffdf2d,10) If (GuiCtrlRead($cereal) = 'Trigo') Then MouseClick("left", send $Ctrigo1[0], send $Ctrigo1[1]) MouseClick("left", send $Ctrigo1[1], send $Ctrigo1[1]) Sleep(GuiCtrlRead($time) * 1000) Endif Endif EndFunc Edited August 15, 2011 by Ayaaa
kaotkbliss Posted August 15, 2011 Posted August 15, 2011 You can use IniWrite before any exit functions to save all the info you need to a file. Then at the beginning of your script you can add in IniRead to see if the ini is there and read any values you need to your variables. 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy!
Ayaaa Posted August 15, 2011 Author Posted August 15, 2011 So... could you tell me how to write in a .ini file through autoit the mouse coords X,Y, and later read them please? x.x Thanks
PowerCat Posted August 15, 2011 Posted August 15, 2011 So... could you tell me how to write in a .ini file through autoit the mouse coords X,Y, and later read them please? x.xThanksIniRead and IniWrite shouldn't be too hard to understand
Ayaaa Posted August 15, 2011 Author Posted August 15, 2011 Thanks anyways, i figured out :3 Global $pos = pixelsearch(0,0, 900, 700, 0xf9e243, 25) If (GuiCtrlRead($cereal) = 'Trigo') Then MouseClick("left", $pos[0], $pos[1]) iniWrite ( 'Config.ini', 'Poss', 'Xpos', $pos[0]+25 ) iniWrite ( 'Config.ini', 'Poss', 'Ypos', $pos[1]+25 ) MouseClick("left", iniread("Config.ini", "Poss", "Xpos", ""), iniread("Config.ini", "Poss", "Ypos", "")) Sleep(GuiCtrlRead($time) * 1000) Endif
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