mercessb Posted January 18, 2011 Share Posted January 18, 2011 Hi, I need help in comparing the results obtained from pixelchecksum function against a list of checksums recorded/saved earlier in text file. Pls Help Link to comment Share on other sites More sharing options...
Andreik Posted January 18, 2011 Share Posted January 18, 2011 (edited) An exmple: expandcollapse popup#include <Misc.au3> Global Const $CHECKSUM_PATH = @ScriptDir & "\PixCheckSum.txt" Global $INIT_TIME While True If _IsPressed('20') Then ;Press SPACEBAR for search PixelChecksum in file $POS = MouseGetPos() $CHECKSUM = PixelChecksum($POS[0]-10,$POS[1]-10,$POS[0]+10,$POS[1]+10) TrayTip("Check result",PixCheckSum($CHECKSUM),1) ElseIf _IsPressed('12') And ((TimerDiff($INIT_TIME)/1000) >= 3) Then ;Press ALT for write current PixelChecksum in file $INIT_TIME = TimerInit() $POS = MouseGetPos() $CHECKSUM = PixelChecksum($POS[0]-10,$POS[1]-10,$POS[0]+10,$POS[1]+10) WriteCheckSum($CHECKSUM) EndIf Sleep(10) WEnd Func PixCheckSum($CHECKSUM) Local $FILE = FileOpen($CHECKSUM_PATH,0) Local $LINE, $COUNT = 1, $RESULT = False While True $LINE = FileReadLine($FILE,$COUNT) If @error Then ExitLoop $COUNT += 1 If $CHECKSUM = $LINE Then $RESULT = True ExitLoop EndIf WEnd FileClose($FILE) Return $RESULT EndFunc Func WriteCheckSum($CHECKSUM) Local $FILE = FileOpen($CHECKSUM_PATH,1) FileWriteLine($FILE,$CHECKSUM) FileClose($FILE) EndFunc Edited January 18, 2011 by Andreik When the words fail... music speaks. 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