BitByteBit Posted October 1, 2009 Share Posted October 1, 2009 (edited) Ok, so I have this function, whilst it is running the commands, I need it to also be searching for a certain pixel,if it is there it is to click on that location once,then continue running the previous instruction. This is what I have so far, any pointers will be greatly appreciated! expandcollapse popupFunc Laiz2() While 1 If WinExists("Adobe Flash Player") Then $coord = PixelSearch( 142, 46, 900, 600, 0xC3463A) If Not @error Then MouseClick("Left",$coord[0],$coord[1],1,0) else Harvest() Sleep(360000) $coord = PixelSearch( 142, 46, 900, 600, 0xC3463A) If Not @error Then MouseClick("Left",$coord[0],$coord[1],1,0) else Plow() Sleep(360000) $coord = PixelSearch( 142, 46, 900, 600, 0xC3463A) If Not @error Then MouseClick("Left",$coord[0],$coord[1],1,0) else Plant() $coord = PixelSearch( 142, 46, 900, 600, 0xC3463A) If Not @error Then MouseClick("Left",$coord[0],$coord[1],1,0) else Sleep(7800000) $coord = PixelSearch( 142, 46, 900, 600, 0xC3463A) If Not @error Then MouseClick("Left",$coord[0],$coord[1],1,0) Else Login() Sleep(10000) Harvest() Sleep(360000) $coord = PixelSearch( 142, 46, 900, 600, 0xC3463A) If Not @error Then MouseClick("Left",$coord[0],$coord[1],1,0) Plow() $coord = PixelSearch( 142, 46, 900, 600, 0xC3463A) If Not @error Then MouseClick("Left",$coord[0],$coord[1],1,0) Sleep(360000) Plant() $coord = PixelSearch( 142, 46, 900, 600, 0xC3463A) If Not @error Then MouseClick("Left",$coord[0],$coord[1],1,0) Sleep(7800000) $coord = PixelSearch( 142, 46, 900, 600, 0xC3463A) If Not @error Then MouseClick("Left",$coord[0],$coord[1],1,0) EndIf WEnd EndFunc ;==>Laiz2 Edited October 1, 2009 by BitByteBit Link to comment Share on other sites More sharing options...
Seagul Posted October 1, 2009 Share Posted October 1, 2009 hmm if your calling same thing every couple sec why not just call it with adlib enable. Link to comment Share on other sites More sharing options...
BitByteBit Posted October 2, 2009 Author Share Posted October 2, 2009 Good point. I'm still having trouble with this, I changed the code, however now it still doesn't work and i don't know why!!!expandcollapse popupFunc Check () $coord = PixelSearch( 142, 46, 900, 600, 0xC3463A) If Not @error Then MouseClick("Left",$coord[0],$coord[1],1,0) EndIf EndFunc Func Check2 () $coord2 = PixelSearch( 476,538,552,566, 0x94BC41) If Not @error Then MouseClick("Left",$coord2[0],$coord2[1],1,0) EndIf EndFunc Func Laiz3() Sleep(4248000) While 1 Check() Check2() Harvest() Check() Check2() Sleep(280000) Check() Check2() Plow() Check() Check2() Sleep(280000) Check() Check2() Plant() Sleep(280000) Check() Check2() sleep(7800000) WEnd EndFunc Link to comment Share on other sites More sharing options...
Seagul Posted October 5, 2009 Share Posted October 5, 2009 (edited) how about this, your H Plant Plow functions arent even in the code.. Adlibenable("Harvest" 60000) Adlibenable("Plow", 60000) Adlibenable("Plant", 60000) HotKeySet("{PAUSE}", "Escape") While 1=1 Call("Check") Sleep(150) ; longer delay less cpu WEnd Func Check() $coord = PixelSearch(142, 46, 900, 600, 0xC3463A) If @error Then Call("Check2") Else MouseClick("Left", $coord[0], $coord[1], 1, 0) EndIf EndFunc ;==>Check Func Check2() $coord2 = PixelSearch(476, 538, 552, 566, 0x94BC41) If Not @error Then MouseClick("Left", $coord2[0], $coord2[1], 1, 0) EndIf EndFunc ;==>Check2 Func Escape() AdlibDisable() Exit EndFunc ;==>Escape Edited October 5, 2009 by Seagul 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