Avignale2 Posted August 3, 2008 Share Posted August 3, 2008 Hey there i've been learning Autoit for about a day, and already i've run into a snag. one that will make me go insane very soon do PixelSearch( 1025, 290, 1279, 416, 0x000000 ) Msgbox(64,"Scott's Eve Mining. Aka Jabba Bot", "THERE IS NO REASON THIS SHOULDNT BE WORKING!!!!") Until @error <> 0 how come this part of my code doesn't work, no matter what, @error always returns 0, no matter what, whether or not there are actually the pixels there, it just wont work here is my complete code if it is related to something iIve scrwed up over in it, however its unlikely since the pixelsearching within it works fine. expandcollapse popup#include <GUIConstantsEx.au3> Dim $i $i = 2 Msgbox(64,"Scott's Eve Mining. Aka Jabba Bot", "Welcome to my mining bot, Toni is a whore. Work of Scott Klein. © 2008 ") WinActivate ( "EVE" ) while 1 ;Moving Ore MouseClickDrag ( "left", 185, 134, 610, 870, 7 ) sleep(1000) ;Stacking Ore Mouseclick("right", 1065, 890, 1, 0) sleep(500) Mouseclick("left", 1120, 945, 1, 0) ;Undocking sleep(500) Mouseclick("left", 75, 932, 1, 0) sleep(500) ;looking for the color of the screen to indicate that the ship has been undocked $coord = PixelSearch( 635, 900, 646, 924, 0xECEC95 ) sleep(5000) While @error = 0 sleep(1000) $coord = PixelSearch( 635, 900, 646, 924, 0x000000 ) WEnd ;Warping sleep(5000) MouseClick("right", 1050, 948, 1, 0) sleep(50) Mouseclick("left", 1070, 902, 1, 0) ;Detecting events to indicate warping sleep(10000) $coord = PixelSearch( 562, 748, 727, 773, 0xC0C0C0, 10 ) while @error = 1 $coord = PixelSearch( 562, 748, 727, 773, 0xC0C0C0, 10 ) Wend $coord = PixelSearch( 562, 748, 727, 773, 0xC0C0C0, 10 ) While @error = 0 $coord = PixelSearch( 562, 748, 727, 773, 0xC0C0C0, 10 ) WEnd sleep(4000) ;At mining rocks Mouseclick("right", 995, 213, 1, 0) sleep(500) Mouseclick("left", 1078, 274, 1, 0) sleep(50) ControlSend("EVE", "", "", "{F2}") ControlSend("EVE", "", "", "{F1}") ;Searching if cargo is full Do $coord = PixelSearch( 842, 62, 850, 70, 0xBB7B33, 8 ) $i = $i + 1 Until $i = 1500000 or @error = 0 sleep(50) $i = 1 sleep(50) MouseClick("right", 1111, 925, 1, 0) sleep(50) MouseClick("left", 1155, 900, 1, 0) ;Detecting if in Doc sleep(10000) do PixelSearch( 1025, 290, 1279, 416, 0x000000 ) Msgbox(64,"Scott's Eve Mining. Aka Jabba Bot", "THERE IS NO REASON THIS SHOULDNT BE WORKING!!!!") Until @error = 0 sleep(10000) WEnd i beg somebody to help me, this might be very simple but i cant control myself, i've gone through this a million times and there is no reason why it should keep returning 0, no reason at all, and this really gets into my head and causes an explosion of anger, the most pure rage ive ever felt, it just shouldnt be doing that.... thank you for help. Link to comment Share on other sites More sharing options...
Valik Posted August 3, 2008 Share Posted August 3, 2008 Calling a function resets @error to 0. In your case, calling MsgBox() resets @error so it is always 0 when you test it. Link to comment Share on other sites More sharing options...
Avignale2 Posted August 3, 2008 Author Share Posted August 3, 2008 okey dokey Link to comment Share on other sites More sharing options...
Avignale2 Posted August 3, 2008 Author Share Posted August 3, 2008 i finishided it and everything is fine, and thank god i didnt post a working version of my bot 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