Monky Posted March 25, 2010 Share Posted March 25, 2010 Hi Everybody, I'm facing a strange issue ( I guess it's a stupide mistake but can't found it). I'm reading parameter from an .ini file. And one of the value is the cause of the problem ($right) so I don't have my output picture. here is the code: #Include <ScreenCapture.au3> $iniFile="Win.ini" if not FileExists($iniFile) Then msgbox(0,"","The ini file could not be found at following location: " & $iniFile) exit EndIf $top = IniRead($iniFile, "Win", "win_top", "No_value") If $top = "No_value" Then msgbox(0,"Error","Problem reading $top") Exit 0 EndIf $bottom = IniRead($iniFile, "Win", "win_bottom", "No_value") If $bottom = "No_value" Then msgbox(0,"Error","Problem reading $bottom") Exit 0 EndIf $left = IniRead($iniFile, "Win", "win_left", "No_value") If $left = "No_value" Then msgbox(0,"Error","Problem reading $left") Exit 0 EndIf $right = IniRead($iniFile, "Win", "win_right", "No_value") If $right = "No_value" Then msgbox(0,"Error","Problem reading $right") Exit 0 EndIf $checksum = PixelChecksum($left, $top, $right, $bottom, 1) _ScreenCapture_Capture(@MyDocumentsDir & "\" & $checksum & ".bmp", $left, $top, $right, $bottom, False) here is the .ini file [Win] win_top=127 win_bottom=147 win_left=980 win_right=1040 Some investigations I did. if I put $right=1040 before the screencapture I have my picture. Just to be sure I put if $right <> 1040 then $right = 1050 same error no output as the iniread is working fine. second testif I reduce right and left by 100 (right became less than 1000) it's working fine too. If you can help me Thanks Monky Link to comment Share on other sites More sharing options...
Fulano Posted March 25, 2010 Share Posted March 25, 2010 Original Code:expandcollapse popup#Include <ScreenCapture.au3> $iniFile="Win.ini" if not FileExists($iniFile) Then msgbox(0,"","The ini file could not be found at following location: " & $iniFile) exit EndIf $top = IniRead($iniFile, "Win", "win_top", "No_value") If $top = "No_value" Then msgbox(0,"Error","Problem reading $top") Exit 0 EndIf $bottom = IniRead($iniFile, "Win", "win_bottom", "No_value") If $bottom = "No_value" Then msgbox(0,"Error","Problem reading $bottom") Exit 0 EndIf $left = IniRead($iniFile, "Win", "win_left", "No_value") If $left = "No_value" Then msgbox(0,"Error","Problem reading $left") Exit 0 EndIf $right = IniRead($iniFile, "Win", "win_right", "No_value") If $right = "No_value" Then msgbox(0,"Error","Problem reading $right") Exit 0 EndIf $checksum = PixelChecksum($left, $top, $right, $bottom, 1) _ScreenCapture_Capture(@MyDocumentsDir & "\" & $checksum & ".bmp", $left, $top, $right, $bottom, False) Ini File:[Win] win_top=127 win_bottom=147 win_left=980 win_right=1040 Reformated with code tags #fgpkerw4kcmnq2mns1ax7ilndopen (Q, $0); while ($l = <Q>){if ($l =~ m/^#.*/){$l =~ tr/a-z1-9#/Huh, Junketeer's Alternate Pro Ace /; print $l;}}close (Q);[code] tag ninja! Link to comment Share on other sites More sharing options...
JohnOne Posted March 25, 2010 Share Posted March 25, 2010 I had an odd similar issue once, heres what solved it. $right = Int(IniRead($iniFile, "Win", "win_right", "No_value")) Worth a pop. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
bogQ Posted March 25, 2010 Share Posted March 25, 2010 (edited) _ScreenCapture_Capture(@MyDocumentsDir & "\" & $checksum & ".bmp", Number($left), Number($top), Number($right), Number($bottom), True) John whas faster I think that Number is better than Int if you dont want to return integer of that number that is Edited March 25, 2010 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
Monky Posted March 26, 2010 Author Share Posted March 26, 2010 Perfect it's working fine now. What an easy one for you Thanks a lot Monky 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