pixelfiend Posted August 18, 2009 Posted August 18, 2009 I've built this script from bits found in these forums. My intent is to have it scan an area around the crosshair in a game for colors within a certain range, and move the mouse accordingly. Just a basic color aimbot script, nothing too complex. Due to the nature of first person shooters the mousemove method used here will not work, so I'll have to do some ifstatements to limit the mouse moves to one tick away from the base xy coordinates since the pixel locations on the screen are going to change in a nonlinear fashion when the viewangles are changed. That can be done later, right now I seek help in troubleshooting exactly why this script doesnt do anything. I see no obvious error in the script, to my eyes this should at least give some reaction. expandcollapse popupHotKeySet ( "!z", "_TimeOut") Global $ScanColor = 0x00FF00 Global $ScanShadeVar = 125 Global $ScanPixelSkip = 1 Global $ScanWaitMS = 25 Global $BaseCoordX = 579 Global $BaseCoordY = 508 Global $BaseFOVX = 25 Global $BaseFOVY = 25 Global $FOVLeft = $BaseCoordX - $BaseFOVX Global $FOVRight = $BaseCoordX + $BaseFOVX Global $FOVTop = $BaseCoordY + $BaseFOVY Global $FOVBottom = $BaseCoordY - $BaseFOVY Opt("ColorMode", 0) Opt("MouseCoordMode", 1) Opt("PixelCoordMode", 1) Opt("MouseClickDelay", 0) Opt("MouseClickDownDelay", 0) ;Scan Loop While 1 sleep($ScanWaitMs) $Mouse = MouseGetPos() $Coord = PixelSearch($FOVLeft, $FOVTop, $FOVRight, $FOVBottom, $ScanColor, $ScanShadeVar, $ScanPixelSkip) If IsArray($Coord) = 1 Then MouseMove($Coord)[0], $Coord[1]) EndIf ToolTip($Mouse[0] & "," & $Mouse[1]) WEnd ;Pause Toggle @ Alt+Z Func _TimeOut() If Not IsDeclared("isPaused") Then Global $isPaused = False $isPaused = Not $isPaused While $isPaused Sleep(250) Wend EndFunc
AdmiralAlkex Posted August 18, 2009 Posted August 18, 2009 (edited) Start by installing the latest AutoIt and SciTE. Then run your script from SciTE. It will give you five errors. Fix the first two and your script will run.Edit: If you wonder why it's enough to fix the 2 first errors, it's because they are throwing off the checker so it gives a few false errors. Always work through your errors from the top for this reason. Edited August 18, 2009 by AdmiralAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
pixelfiend Posted August 18, 2009 Author Posted August 18, 2009 There was one error, I used the outdated opt(colormode). I removed this and the script still doesn't react to anything... I can even paint a green blob in the correct area in a paint program and the script ignores it.
acidfear Posted August 19, 2009 Posted August 19, 2009 (edited) It could be the possibility that the game you're trying to search on intercepts these types of calls, and returns different values than you'd expect. You could test this by using the PixelGetColor (I think that's it), on an area and use that color to test with your search. Edited August 19, 2009 by acidfear
pixelfiend Posted August 20, 2009 Author Posted August 20, 2009 PixelGetColor behaves as expected. There is a generic color aimbot (VALVE AIMBOT) that works in this game, but it is not ideal and the code for it is messy and uncommented, otherwise I would modify that base.
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