Ayaaa 0 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 Share this post Link to post Share on other sites
kaotkbliss 146 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. 010101000110100001101001011100110010000001101001011100110010000001101101011110010010000001110011011010010110011100100001My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueekWe're gonna need another Timmy! Share this post Link to post Share on other sites
Ayaaa 0 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 Share this post Link to post Share on other sites
PowerCat 0 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 Share this post Link to post Share on other sites
Ayaaa 0 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 Share this post Link to post Share on other sites