d0n Posted July 19, 2009 Share Posted July 19, 2009 I am not sure why this doesn't work, when i run it the first msgbox shows me "Jon Jon" which means its a match but for some reason the IF statement wont pick it up. Here is the code $Log = @ScriptDir&"\Logger.ini" Dim $sStr = FileRead(@scriptdir & "\test.txt") Dim $sPatt = '(?i)\[[^]]*\]\s*(.*?)(?:hit|punche?|slashe?)s?.*?for\s*(\d+)' Dim $aLines = StringSplit($sStr, @CRLF, 1) Global $P1_Total = 0 For $i = 1 To $aLines[0] Local $aMatch = StringRegExp($aLines[$i], $sPatt, 1) If UBound($aMatch) = 2 Then $a = IniReadSection($Log, "Name") For $size=1 To $a[0][0] MsgBox("","",$a[$size][0]&" "&$aMatch[0]) If $a[$size][0] = $aMatch[0] Then MsgBox("","","Match") EndIf Next EndIf Next Here is the FileRead(@scriptdir & "\test.txt" [9:56:47 PM Jun 20 2009] Jon slash Dragon for 1252 points of damage. [9:56:47 PM Jun 20 2009] Jon slash Dragon for 3252 points of damage. [9:56:47 PM Jun 20 2009] jon2 slash Dragon for 21 points of damage. [9:56:47 PM Jun 20 2009] jon2 slash Dragon for 54 points of damage. Here is the ini (@ScriptDir&"\Logger.ini") [Name] Jon=3252 jon2=52 Link to comment Share on other sites More sharing options...
MDCT Posted July 19, 2009 Share Posted July 19, 2009 I think it's because in the $aMatch[0] has extra space, no? Try change MsgBox("","",$a[$size][0]&" "&$aMatch[0]) to MsgBox("","",$a[$size][0]&"' "&$aMatch[0]&"'") Link to comment Share on other sites More sharing options...
d0n Posted July 19, 2009 Author Share Posted July 19, 2009 oh, yea that was the problem, thanks for the help 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