pezo89 Posted July 27, 2009 Posted July 27, 2009 what am i doing wrong? :S the code below; errors: it dosent act deppending on the pixelsearch, first while is supposed to be activated on first pixelsearch, if found then do it, and wait until second pixelsearch is found. then when 2 is done it does it all over again.. =/ help please! =/ expandcollapse popupGlobal $Paused sleep ("1000") HotKeySet("{Pause}", "TogglePause") HotKeySet("{ESC}", "Terminate") sleep (1000) ;setup WinActivate ("EVE") sleep (2000) mouseclick ("Left",884, 187) sleep (500) mouseclick ("Left",961, 378) sleep (500) MouseClickDrag ("Left",892, 921, 893, 301) sleep (500) MouseClickDrag ("Left", 604, 62, 260, 63) sleep (500) mouseclick ("Left",445, 291) sleep (500) mouseclick ("Left",314, 173) sleep (500) send ("{down 11}") mouseclick ("Left", 314, 263) sleep (500) mouseclick ("Left",300, 291) sleep (500) send ("{up 11}") mouseclick ("Left",363, 183) sleep (500) mouseclick ("Left",542, 67) sleep (500) sleep (1000) send ("{f2}") sleep (1000) ;Done; mouseclick ("Left", 926, 264) $var1=PixelGetColor(881, 241);sjekk om locked sleep (1000) ;$var2=PixelGetColor( 925, 166);sjekk om in range sleep (1000) while 1 while 1 mouseclick ("Left", 926, 264) PixelSearch ( 882, 256, 882, 256, $var1) if @error Then sleep (1000) mouseclick ("Left", 923, 246) sleep (1000) mouseclick ("Left",1059, 151) sleep (1000) mouseclick ("Left", 889, 150) sleep (5000) ExitLoop EndIf WEnd While 1 PixelSearch ( 882, 256, 882, 256, 0x404040) if @error Then mouseclick ("Left", 971, 246) sleep (1000) MOUSECLICK ("LEFT", 957, 149) SLEEP (500) MOUSECLICK ("RIGHT", 542, 709) SLEEP (1000) MOUSECLICK ("lEFT", 590, 717) SLEEP (1000) MouseClickDrag ("lEFT", 579, 752, 635, 482) SLEEP (1500) SEND ("{F5}") SEND ("{F6}") SEND ("{F7}") SEND ("{F8}") SLEEP (15000) ExitLoop EndIf WEnd WEnd Func TogglePause() $Paused = NOT $Paused While $Paused sleep(100) toolTip('Script - "Scriptet er - AV"',0, 40) WEnd ToolTip("") EndFunc Func Terminate() Exit 0 EndFunc
rudi Posted July 27, 2009 Posted July 27, 2009 (edited) Hi. Is this what you mentioned to do? While 1 While 1 MouseClick("Left", 926, 264) PixelSearch(882, 256, 882, 256, $var1) If @error Then ; searched color *NOT* found ; do some mouse clicks, sleep 8 seconds inbetween ExitLoop EndIf WEnd While 1 PixelSearch(882, 256, 882, 256, 0x404040) If @error Then ; searched color *NOT* found ; do some mouseclicks, send some <F> keys, sleep 20 seconds inbetween ExitLoop EndIf WEnd WEnd I have no clue what should work and what does happen for you >_< regards, Rudi. Edited July 27, 2009 by rudi Earth is flat, pigs can fly, and Nuclear Power is SAFE!
pezo89 Posted July 27, 2009 Author Posted July 27, 2009 Hi. Is this what you mentioned to do? While 1 While 1 MouseClick("Left", 926, 264) PixelSearch(882, 256, 882, 256, $var1) If @error Then ; searched color *NOT* found ; do some mouse clicks, sleep 8 seconds inbetween ExitLoop EndIf WEnd While 1 PixelSearch(882, 256, 882, 256, 0x404040) If @error Then ; searched color *NOT* found ; do some mouseclicks, send some <F> keys, sleep 20 seconds inbetween ExitLoop EndIf WEnd WEnd I have no clue what should work and what does happen for you regards, Rudi. well yea. but isent that exactly as the code i posted?, wont work yet thou >_< mabye i should try to use 3 scrips? one main that starts the two other pixel finds?
rudi Posted July 28, 2009 Posted July 28, 2009 Hi.[isn't it exatly the same?]No.1.) it's just the important part, and even that one shortened. So just the main logic remained.2.) it's tidy (tabs used to make it really readable).So now you could check, if that is really what you wanted to do.Use consolewrite("some message where you are" & @crlf) at important positions of your script to see, where it's NOT working as expected.Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE!
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