Jump to content

Recommended Posts

Guest rathore
Posted

i've never coded an autoit script for games... but just to know how this all works, i tried the simplest way i cud think of.

AutoItSetOption("PixelCoordMode", 0) ;i've tried commenting this option too
While 1
sleep (10)
$pix=PixelGetColor(317,99) ;running in 640*480
if $pix = 60160 then Send("{ins}") 
WEnd

this does nothing but in NFSUnderground Drag mode presses gear up button when there's a green light for that. but this doesn't work... & i don't know why!... i've taken the values from a screenshot.

my concern here is mainly getting an idea of the working of these scripts... i've no plans to make any complex use of this...

can somebody enlighten me plz?!

Posted

try this:

AutoItSetOption("PixelCoordMode", 0);i've tried commenting this option too
While 1
sleep (10)
$pix=PixelGetColor(317,99);running in 640*480
if $pix = 60160 then Send("{ins}")
tooltip($pix,0,0); this will show you what color it sees constantly.
WEnd

Your pixel value might be a bit off due to gamma in the game as well,

AutoIt3, the MACGYVER Pocket Knife for computers.

Guest rathore
Posted

Your pixel value might be a bit off due to gamma

thanx for telling this to me, didn't know that it'd matter... now i've changed the script to..

AutoItSetOption("PixelCoordMode", 0)
While 1
sleep (10)
$pix=PixelGetColor(317,99)
if $pix > 40000 AND $pix < 65000 then
   Send("{ins}")
   sleep (750); so that it doesn't change gear twice
endif
WEnd

it works... but not always... rather bout 25% of the times only!.. i even raised the priority of au3 but that didn't help either! what cud b the cause?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...