Jump to content

PixelCheckSum Issues


Recommended Posts

Ok, I've been developing and tweaking a bot for more than a year now, and it functions by rapidly taking many, many checksums and crunching data to perform a particular task.

Well, before I downloaded the most recent compiler and moved up to Vista, I was able to take approximately 26,000 checksums in the span of only seven seconds ( this is on an old 1.2 gigahertz machine with 512 ram running XP).

Now, on vista, with my new 2.5 ghz dual core 3 gig of ram machine running Vista, I just clocked 300 checksums in 10 seconds, using the same code =/ Which, for my purposes, is fairly useless.

I just wanted to see if anyone else had noticed this problem and/or had some magical solution to make it faster. If not, theoretically someone on the development team will take notice and perhaps improve this feature for the next version of autoit.

For the sake of not missing anything, I'll post code here even though it won't make all that much sense. I added the timer and $numberofcycs to help me clock the checksum speed, which after 300 sums came out to almost exactly 10 seconds (10045.6 ms)

Sorry for my cryptic variables, but what they stand for doesn't really matter anyway.

For $y = 1 to 9

For $x = 1 to 9

$sblarg = 0

$numberofcycs = 0

$cycle = TimerInit ( )

For $tempy = 5 To 23

For $tempx = 8 To 26

$numberofcycs = $numberofcycs + 1

$qx = $zx0 + $tempx + ($step * ($x - 1))

$qy = $zy0 + $tempy + ($step * ($y - 1))

$tempsum = Pixelchecksum ( $qx + $xref, $qy + $yref, $qx + $xref + 10, $qy + $yref + 10,2 )

If $numberofcycs = 300 Then

MsgBox ( 0, "", TimerDiff ( $cycle))

EndIf

ToolTip ( $y & "," & $x & " - " & $numberofcycs,0,0)

;; this For loop just checks the numbers against stored reference values, which don't exist on the first program execution so it will not kick out the for loops in this scenario

For $temp = 1 To 9

If $tempsum = $gsum[$temp] Then

$state[$y][$x][$temp] = $temp

$state[$y][$x][42] = "Original"

$sblarg = 1

$total = $total + 1

ExitLoop

EndIf

Next

If $sblarg = 1 Then ExitLoop ;Used to kick out the loops once a data value has been obtained, but like I said won't execute in this scenario

Next

If $sblarg = 1 Then ExitLoop

Next

Next

Next

Eww, the formatter automatically takes out all of the tabs, making this code even harder to read.......Sorry.

for the old

EDIT:

I just tried compiling the same code with a backup of the old compiler with identical results, gotta be the Vista.

Edited by Combustible
Link to comment
Share on other sites

PixelCheckSum is slow in ALL languages when running Vista with Aero on since that forces GDI to be run in software and not hardware like previous operating systems. HERE is a short wikipedia article explaining it, if you need it in more detail search on Google.....

Link to comment
Share on other sites

See? I knew someone had a magical solution somewhere. With Aero off now I'm back to about 12 checksums a milisecond, making me happy again =D.

Thanks.

i had the problem too before

make a script option.

Opt("WinVistaVisualDesings", 0) ; - 1 On, 0 Off

since u only have to disable vistas Visual desing to make all pixel funcs work properly again...

rightclick on "AutoIt3.exe"(run script) in c:\progra~1\autoit3\ then select options\compatibility ?(in german "eigenschften\Kompatiblität") then check deactivate visual desings.... with this done all au3 files / in-scite scripts run

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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