MAJORSAM Posted May 27, 2009 Share Posted May 27, 2009 (edited) hi...i got a little problem...don´t know how i can fix it i got a aimbot on a window and one on another window all in one browser...and when it finds a color, it should wait until the color is away or changes...here my test: expandcollapse popupHotKeySet("y", "MyExit") Sleep(10000) Func schatz() $Coord0 = PixelSearch(690,555,766,620, 0xFFFF00) if Not @error Then Sleep(100) Mouseclick("left", $Coord0[0]+3, $Coord0[1]+5,1) Sleep(500) EndIf EndFunc Func glitz() $coord1 = PixelSearch(200,100,770,500, 0xFFD050) if Not @error Then Sleep(100) Mouseclick("left", $Coord1[0] , $Coord1[1],1) Sleep(1000) EndFunc ;Func wait() ; While 1 ; if not PixelGetColor($Coord0[0] , $Coord0[1]) = 0xFFFF00 Then ExitLoop ; Sleep(100) ; Wend ;EndFunc Func MyExit() Exit EndFunc While 1 schatz() glitz() ;wait() WEnd would be nice if the function glitz just starts, when func schatz found something, is it makeable? thx in advance Edited May 27, 2009 by MAJORSAM Link to comment Share on other sites More sharing options...
James Posted May 27, 2009 Share Posted May 27, 2009 Do you mean like this? Func wait() While Not PixelGetColor($Coord0[0] , $Coord0[1]) = 0xFFFF00 Then ExitLoop Sleep(100) Wend EndFunc Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
MAJORSAM Posted May 27, 2009 Author Share Posted May 27, 2009 Do you mean like this? Func wait() While Not PixelGetColor($Coord0[0] , $Coord0[1]) = 0xFFFF00 Then ExitLoop Sleep(100) Wend EndFunc i tried that: WARNING: $Coord0: possibly used before declaration. While Not PixelGetColor($Coord0[0] Link to comment Share on other sites More sharing options...
James Posted May 27, 2009 Share Posted May 27, 2009 (edited) This should do it: expandcollapse popupDim $Coord0, $coord1 HotKeySet("y", "MyExit") ; Sleep(10000);~ You don't need this While 1 schatz() glitz() ;wait() WEnd Func schatz() $Coord0 = PixelSearch(690, 555, 766, 620, 0xFFFF00) If Not @error Then Sleep(100) MouseClick("left", $Coord0[0] + 3, $Coord0[1] + 5, 1) Sleep(500) EndIf EndFunc ;==>schatz Func glitz() $coord1 = PixelSearch(200, 100, 770, 500, 0xFFD050) If Not @error Then Sleep(100) MouseClick("left", $coord1[0], $coord1[1], 1) Sleep(1000) EndIf EndFunc ;==>glitz Func wait() While Not PixelGetColor($Coord0[0], $Coord0[1]) = 0xFFFF00 Then ExitLoop Sleep(100) WEnd EndFunc ;==>wait Func MyExit() Exit EndFunc ;==>MyExit Wrong tag. Edited May 27, 2009 by JamesBrooks Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Developers Jos Posted May 27, 2009 Developers Share Posted May 27, 2009 ? While .... Then Exit Loop SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
James Posted May 27, 2009 Share Posted May 27, 2009 ? While .... Then Exit LoopHah, I missed that Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
James Posted May 27, 2009 Share Posted May 27, 2009 This: expandcollapse popupDim $Coord0, $coord1 HotKeySet("y", "MyExit") ; Sleep(10000);~ You don't need this While 1 schatz() glitz() ;wait() WEnd Func schatz() $Coord0 = PixelSearch(690, 555, 766, 620, 0xFFFF00) If Not @error Then Sleep(100) MouseClick("left", $Coord0[0] + 3, $Coord0[1] + 5, 1) Sleep(500) EndIf EndFunc ;==>schatz Func glitz() $coord1 = PixelSearch(200, 100, 770, 500, 0xFFD050) If Not @error Then Sleep(100) MouseClick("left", $coord1[0], $coord1[1], 1) Sleep(1000) EndIf EndFunc ;==>glitz Func wait() While Not PixelGetColor($Coord0[0], $Coord0[1]) = 0xFFFF00 ExitLoop WEnd EndFunc ;==>wait Func MyExit() Exit EndFunc ;==>MyExit Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
MAJORSAM Posted May 27, 2009 Author Share Posted May 27, 2009 still error: (33,64) : ERROR: syntax error While Not PixelGetColor($Coord0[0], $Coord0[1]) = 0xFFFF00 Then Link to comment Share on other sites More sharing options...
James Posted May 27, 2009 Share Posted May 27, 2009 still error: (33,64) : ERROR: syntax error While Not PixelGetColor($Coord0[0], $Coord0[1]) = 0xFFFF00 ThenMissed that too. AutoIt doesn't understand HEX values by nature. This could work: While Not PixelGetColor($Coord0[0], $Coord0[1]) = "FFFF00" Then Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
MAJORSAM Posted May 27, 2009 Author Share Posted May 27, 2009 Missed that too. AutoIt doesn't understand HEX values by nature. This could work: While Not PixelGetColor($Coord0[0], $Coord0[1]) = "FFFF00" Then same error Link to comment Share on other sites More sharing options...
Developers Jos Posted May 27, 2009 Developers Share Posted May 27, 2009 Missed that too. AutoIt doesn't understand HEX values by nature. This could work: While Not PixelGetColor($Coord0[0], $Coord0[1]) = "FFFF00" ThenHUH? Doesn't understand Hex? There is a THEN in that line that probably is causing the error. Also the test looks wrong and think it should be While Not (PixelGetColor($Coord0[0], $Coord0[1]) = 0xFFFF00) Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Developers Jos Posted May 27, 2009 Developers Share Posted May 27, 2009 same error Do you run au3check to allow you to figure basic syntax errors out yourself because this error looks pretty obvious to me? While Not PixelGetColor($Coord0[0], $Coord0[1]) = "FFFF00" Then ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
James Posted May 27, 2009 Share Posted May 27, 2009 HUH? Doesn't understand Hex? There is a THEN in that line that probably is causing the error. Also the test looks wrong and think it should be While Not (PixelGetColor($Coord0[0], $Coord0[1]) = 0xFFFF00) JosWell yeah, you can't say to it, "If $var = 0x000000" as far as I am aware. And I missed the Then again, for some reason, I added that back to it :S Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Developers Jos Posted May 27, 2009 Developers Share Posted May 27, 2009 Well yeah, you can't say to it, "If $var = 0x000000" as far as I am aware. And I missed the Then again, for some reason, I added that back to it :SNot true, but the Func returns a decimal value. Run this script and fill in the shown hex code in the If statement. Then runn it again and you see the MsBox popping up: $x = PixelGetColor(1, 1) ConsoleWrite('$x = ' & $x & ' Hex: ' & Hex($x) & @crlf);### Debug Console If PixelGetColor(1, 1) = 0x00035EE9 Then MsgBox(0,"Yea", "It does work") EndIf Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
MAJORSAM Posted May 27, 2009 Author Share Posted May 27, 2009 i don´t understand what 2 do now? Link to comment Share on other sites More sharing options...
Developers Jos Posted May 27, 2009 Developers Share Posted May 27, 2009 i don´t understand what 2 do now?I think I asked you a simple question and when you are here just to have others do the work then you better go somewhere else.Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
MAJORSAM Posted May 27, 2009 Author Share Posted May 27, 2009 I think I asked you a simple question and when you are here just to have others do the work then you better go somewhere else.Jossry, but my english is not that good!if i start au3check. exe i get a short black window...so short that i can´t see anything in it, thats all! and i try always before i post here, but if i have no suggestion, i post here in hope of getting help! Link to comment Share on other sites More sharing options...
Developers Jos Posted May 27, 2009 Developers Share Posted May 27, 2009 sry, but my english is not that good!if i start au3check. exe i get a short black window...so short that i can´t see anything in it, thats all! and i try always before i post here, but if i have no suggestion, i post here in hope of getting help!Load the full Scite4autoit3 installer which will always run au3check before running your script with autoit3 when pressing F5. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
MAJORSAM Posted May 28, 2009 Author Share Posted May 28, 2009 thats the place where i always copied the errors...or i did s.th wrong! here´s the copy: >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\Major\Desktop\SF-Scripts\SF\schatzglitz.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams +>20:24:44 Starting AutoIt3Wrapper v.2.0.0.1 Environment(Language:0407 Keyboard:00000407 OS:WIN_VISTA/ CPU:X64 OS:X86) >Running AU3Check (1.54.10.0) from:C:\Program Files\AutoIt3 C:\Users\Major\Desktop\SF-Scripts\SF\schatzglitz.au3(37,65) : ERROR: syntax error While Not PixelGetColor($Coord0[0], $Coord0[1]) = "FFFF00" Then ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\Major\Desktop\SF-Scripts\SF\schatzglitz.au3 - 1 error(s), 0 warning(s) !>20:24:44 AU3Check ended.rc:2 +>20:24:48 AutoIt3Wrapper Finished >Exit code: 0 Time: 3.770 Link to comment Share on other sites More sharing options...
Developers Jos Posted May 28, 2009 Developers Share Posted May 28, 2009 thats the place where i always copied the errors...or i did s.th wrong! here´s the copy: >"C:\Program Files\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "C:\Users\Major\Desktop\SF-Scripts\SF\schatzglitz.au3" /autoit3dir "C:\Program Files\AutoIt3" /UserParams +>20:24:44 Starting AutoIt3Wrapper v.2.0.0.1 Environment(Language:0407 Keyboard:00000407 OS:WIN_VISTA/ CPU:X64 OS:X86) >Running AU3Check (1.54.10.0) from:C:\Program Files\AutoIt3 C:\Users\Major\Desktop\SF-Scripts\SF\schatzglitz.au3(37,65) : ERROR: syntax error While Not PixelGetColor($Coord0[0], $Coord0[1]) = "FFFF00" Then ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Users\Major\Desktop\SF-Scripts\SF\schatzglitz.au3 - 1 error(s), 0 warning(s) !>20:24:44 AU3Check ended.rc:2 +>20:24:48 AutoIt3Wrapper Finished >Exit code: 0 Time: 3.770 Seriously: What is your question that isn't answered yet? SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts