botnewb Posted November 27, 2009 Share Posted November 27, 2009 Hi im new to autoit ive been trying to compile an scipt where i can do pixel search find the color in the designated coordinates and if it is the color do nothing, and if it isnt to mouse click at the coordinates listed below in the code, i also added an function startg and stop but i dont know if i did it right, i compiled most of thise from tips and hints and tried to get it as close as the tutorial in autoit, anywho heres the code can any one shed some light or fix the code make it work possibly. HotKeySet("{F4}", "ExitProg") HotKeySet("{F5}", "Start") HotKeySet("{F6}", "Stop") Func ExitProg() Exit 0 EndFunc Func Start() While 1 Wend Func Stop() Endfunc MouseClick ( "left" , 300, 12, 1) sleep (3000) While 1=1 $pixelsearch= Pixelsearch( 156, 709, 157, 709, "0xDE0408", 1, 2) If @error = 1 Then MouseClick("left", 747, 753, 1) Endif WEnd Link to comment Share on other sites More sharing options...
botnewb Posted November 27, 2009 Author Share Posted November 27, 2009 Oops also forgot to add i have auto it version 3 i dont know if its an big difference between the others. Link to comment Share on other sites More sharing options...
Zedna Posted November 28, 2009 Share Posted November 28, 2009 Maybe something like this: HotKeySet("{F4}", "ExitProg") HotKeySet("{F5}", "Start") HotKeySet("{F6}", "Stop") Global $running = False While 1 If $running Then ;~ MouseClick("left", 300, 12, 1) ;~ Sleep(3000) While 1 $pixelsearch = PixelSearch(156, 709, 157, 709, "0xDE0408", 1, 2) If @error = 1 Then MouseClick("left", 747, 753, 1) Else Sleep(10) EndIf If Not $running Then ExitLoop WEnd EndIf Sleep(10) WEnd Func ExitProg() Exit 0 EndFunc Func Start() $running = True EndFunc Func Stop() $running = False EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Zedna Posted November 28, 2009 Share Posted November 28, 2009 Or even simpler: HotKeySet("{F4}", "ExitProg") HotKeySet("{F5}", "Start") HotKeySet("{F6}", "Stop") Global $running = False While 1 If $running Then $pixelsearch = PixelSearch(156, 709, 157, 709, "0xDE0408", 1, 2) If @error = 1 Then MouseClick("left", 747, 753, 1) EndIf EndIf Sleep(10) WEnd Func ExitProg() Exit 0 EndFunc Func Start() $running = True EndFunc Func Stop() $running = False EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search 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