intelPiggy Posted October 22, 2007 Share Posted October 22, 2007 I get error when running this script expandcollapse popupOpt("PixelCoordMode", 2) Opt("MouseCoordMode", 2) HotKeySet("^z", "_Pause") HotKeySet("^x", "_exit") Global $Paused Func _Pause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip("GzAuto Stopped...", 800, 0) WEnd EndFunc ;==>_Pause Func _exit() Exit EndFunc ;==>_exit $colour = 0x73AE9C $sleep = InputBox("Please Enter", "The Time Needed To Kill 1 Monster(Second)", "", " M4", 250, 100) If @error = 1 Then Exit WinWaitActive("Tester") While 1 ToolTip("GzAuto Running...", 800, 0) For $search = 150 To 800 Step 30 $click = 0 Sleep(100) $jp = PixelSearch(0, 0, 900, 900, 0x73AE9C) $point = PixelGetColor($jp[0], $jp[1]) MouseClick("", $jp[0], $jp[1], 1, 0) MouseMove(0, 0, 0) Sleep($sleep * 1000) ExitLoop Next For $search = 150 To 800 Step 30 $click = 0 Sleep(100) $jp = PixelSearch(0, 0, 900, 900, 0xffe7ad) $point = PixelGetColor($jp[0], $jp[1]) MouseClick("", $jp[0], $jp[1], 1, 0) MouseMove(0, 0, 0) Sleep($sleep * 1000) ExitLoop Next WEnd All i want is to change colour after the first one have been done.... anyhelp? Link to comment Share on other sites More sharing options...
weaponx Posted October 22, 2007 Share Posted October 22, 2007 Since I have no clue what you mean by "after the first one is done"... Also the variable $colour is declared but you never actually use it in your script... expandcollapse popupOpt("PixelCoordMode", 2) Opt("MouseCoordMode", 2) HotKeySet("^z", "_Pause") HotKeySet("^x", "_exit") Global $Paused $colour = 0x73AE9C $sleep = InputBox("Please Enter", "The Time Needed To Kill 1 Monster(Second)", "", " M4", 250, 100) If @error = 1 Then Exit WinWaitActive("Tester") While 1 ToolTip("GzAuto Running...", 800, 0) For $search = 150 To 800 Step 30 $click = 0 Sleep(100) $jp = PixelSearch(0, 0, 900, 900, 0x73AE9C) $point = PixelGetColor($jp[0], $jp[1]) MouseClick("", $jp[0], $jp[1], 1, 0) MouseMove(0, 0, 0) Sleep($sleep * 1000) ExitLoop Next For $search = 150 To 800 Step 30 $click = 0 Sleep(100) $jp = PixelSearch(0, 0, 900, 900, 0xffe7ad) $point = PixelGetColor($jp[0], $jp[1]) MouseClick("", $jp[0], $jp[1], 1, 0) MouseMove(0, 0, 0) Sleep($sleep * 1000) ExitLoop Next $colour = 0x73AE9C ;???????????????????????????? WEnd Func _Pause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip("GzAuto Stopped...", 800, 0) WEnd EndFunc ;==>_Pause Func _exit() Exit EndFunc ;==>_exit Link to comment Share on other sites More sharing options...
intelPiggy Posted October 22, 2007 Author Share Posted October 22, 2007 Actually i was going to use $colour1 and $colour2 but i can't find a way, mean after the script search for a colour and click it will go to next color then return to the first one Link to comment Share on other sites More sharing options...
weaponx Posted October 22, 2007 Share Posted October 22, 2007 (edited) I'm not really sure what you are looking for. Maybe.... expandcollapse popupOpt("PixelCoordMode", 2) Opt("MouseCoordMode", 2) HotKeySet("^z", "_Pause") HotKeySet("^x", "_exit") Global $Paused $colour1 = 0x73AE9C $colour2 = 0xffe7ad $sleep = InputBox("Please Enter", "The Time Needed To Kill 1 Monster(Second)", "", " M4", 250, 100) If @error = 1 Then Exit WinWaitActive("Tester") While 1 ToolTip("GzAuto Running...", 800, 0) For $search = 150 To 800 Step 30 $click = 0 Sleep(100) $jp = PixelSearch(0, 0, 900, 900, $colour1) $point = PixelGetColor($jp[0], $jp[1]) MouseClick("", $jp[0], $jp[1], 1, 0) MouseMove(0, 0, 0) Sleep($sleep * 1000) ExitLoop Next For $search = 150 To 800 Step 30 $click = 0 Sleep(100) $jp = PixelSearch(0, 0, 900, 900, $colour2) $point = PixelGetColor($jp[0], $jp[1]) MouseClick("", $jp[0], $jp[1], 1, 0) MouseMove(0, 0, 0) Sleep($sleep * 1000) ExitLoop Next WEnd Func _Pause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip("GzAuto Stopped...", 800, 0) WEnd EndFunc ;==>_Pause Func _exit() Exit EndFunc ;==>_exit Edited October 22, 2007 by weaponx Link to comment Share on other sites More sharing options...
intelPiggy Posted October 22, 2007 Author Share Posted October 22, 2007 I used but it give me subsript error for not using array? Link to comment Share on other sites More sharing options...
weaponx Posted October 22, 2007 Share Posted October 22, 2007 (edited) Thats because you are doing a presumptious pixel search. $jp = PixelSearch(0, 0, 900, 900, $colour1) $point = PixelGetColor($jp[0], $jp[1]) MouseClick("", $jp[0], $jp[1], 1, 0) You have no error checking after the pixelsearch like IsArray($jp) Also you are searching for a pixel with a KNOWN color and then running a PixelGetColor() on that same exact pixel even though you already know the color. Its bass-ackwards. Edited October 22, 2007 by weaponx Link to comment Share on other sites More sharing options...
intelPiggy Posted October 22, 2007 Author Share Posted October 22, 2007 (edited) How to i remake the script so that it run at a "smarter" way ? do i need to omit out the $point = PixelGetColor($jp[0], $jp[1]) ?? Edited October 22, 2007 by intelPiggy 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