Realm Posted November 14, 2011 Share Posted November 14, 2011 Try adding something to bring the focus of your window into perspective before it does it's checks Local $myWindow = 'ApplicationTitle' While True If Not WinActive( $myWindow ) Then WinActivate( $myWindow ) $color = PixelSearch(563,222,852,451,0xFF0000) ;Read Help file for what functions really do! If Not @error Then ;PixelSearch returns the coordinates that if finds your color, not the color found. MouseClick("left", $color[0], $color[1]) ;<--Needs coords to click at which are returned in an array from PixelSearch Sleep(30) EndIf WEnd My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
John404 Posted November 14, 2011 Author Share Posted November 14, 2011 Try adding something to bring the focus of your window into perspective before it does it's checks Local $myWindow = 'ApplicationTitle' While True If Not WinActive( $myWindow ) Then WinActivate( $myWindow ) $color = PixelSearch(563,222,852,451,0xFF0000) ;Read Help file for what functions really do! If Not @error Then ;PixelSearch returns the coordinates that if finds your color, not the color found. MouseClick("left", $color[0], $color[1]) ;<--Needs coords to click at which are returned in an array from PixelSearch Sleep(30) EndIf WEnd This opened up the window, yes... but it wasn't focusing on FF0000, it was clicking in 1 random black spot, why is that? ToolTip("Shotbot created by iolaka - www.TheGunzKidz.com") HotKeySet("{F6}","_Exit") HotKeySet("{F7}", "TogglePause") Global $Paused = False Local $myWindow = 'Project' While True If Not WinActive( $myWindow ) Then WinActivate( $myWindow ) $color = PixelSearch(563,222,852,451,0xFF0000) ;Read Help file for what functions really do! If Not @error Then ;PixelSearch returns the coordinates that if finds your color, not the color found. MouseClick("left", $color[0], $color[1]) ;<--Needs coords to click at which are returned in an array from PixelSearch Sleep(30) EndIf WEnd Func TogglePause() $Paused = NOT $Paused While $Paused Sleep(100) WEnd ToolTip("") EndFunc Func _Exit() Exit endfunc Thanks Link to comment Share on other sites More sharing options...
Realm Posted November 14, 2011 Share Posted November 14, 2011 It must be something on your end. I tested the same script on this site http://www.nthelp.com/colorcodes.htm and it worked fine for me. My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
John404 Posted November 14, 2011 Author Share Posted November 14, 2011 It must be something on your end. I tested the same script on this site http://www.nthelp.com/colorcodes.htm and it worked fine for me.Yes but my tool would be an .EXE application, and it'd open an entire new interface.It was working perfectly last night... I don't understand =I started to edit it a little, I don't remember what it was. Link to comment Share on other sites More sharing options...
John404 Posted November 14, 2011 Author Share Posted November 14, 2011 Still couldn't figure it out Link to comment Share on other sites More sharing options...
John404 Posted November 14, 2011 Author Share Posted November 14, 2011 Oh, I can use this when the window is in windowed mode... strange But I think I may know why, it doesn't work whenever my Windows crashes. Link to comment Share on other sites More sharing options...
John404 Posted November 14, 2011 Author Share Posted November 14, 2011 Help .. please Link to comment Share on other sites More sharing options...
Realm Posted November 14, 2011 Share Posted November 14, 2011 I'm just guessing here, but from what you have said, it appears that you are only showing us an example of what your attempting, and not your actual code. The example works just fine as it stands. So if this is the case, the problem is in your original code which your not sharing. It's very difficult to help if we can't even look at the source of your problem. My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
John404 Posted November 14, 2011 Author Share Posted November 14, 2011 (edited) I'm just guessing here, but from what you have said, it appears that you are only showing us an example of what your attempting, and not your actual code. The example works just fine as it stands. So if this is the case, the problem is in your original code which your not sharing. It's very difficult to help if we can't even look at the source of your problem.Oh, I see. I'm basically making something called a "Shotbot" for a game called GunZ, now... this isn't something considered as cheating / a bot/macro, anything that you guys would hate...This is actually going to be posted on the GunZ site itself, it's just a shotgun helper, whenever the red bar turns Red, it will shoot. What will this do? Help the newcomers with their shot timing, I'll enhance it later. GunZ is an extremely fast game and mouse + keyboard movement is required... a LOT, sometimes a player may have their vains strained from playing a lot, this will allow you to play with ease but of course the professionals will not need this.Thanks. Edited November 14, 2011 by John404 Link to comment Share on other sites More sharing options...
Zedna Posted November 14, 2011 Share Posted November 14, 2011 Read forum rules. Reported Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Recommended Posts