Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <File.au3>
- Global $Code
- $text = FileRead(@ScriptDir & '/EffBri.txt')
- $text = _ChangeText($text)
- For $i = 0 To 11
- $Code = StringSplit(FileReadLine(@ScriptDir & '/' & $i & '.txt', 1), ' ', 2)
- _SearchCrypt($i)
- Next
- Func _SearchCrypt($ActFile)
- Local $found = False
- Local $i = 0
- Local $stelle = 0
- Local $Buchstabe
- While $i < StringLen($text) And $found = False
- $stelle = $i
- For $j = 0 To UBound($Code) - 1
- $found = True
- $stelle += $Code[$j]
- $Buchstabe = StringMid($text, $stelle, 1)
- For $z = $stelle - $Code[$j] + 1 To $stelle - 1
- If StringMid($text, $z, 1) = $Buchstabe Then
- $found = False
- ExitLoop (2)
- EndIf
- Next
- Next
- If $found Then ConsoleWrite(@CRLF & 'String: ' & $ActFile + 1 & ' | Stelle: ' & $i & ' | String: ' & _GetResult($i))
- $i += 1
- WEnd
- EndFunc ;==>_SearchCrypt
- Func _ChangeText($text)
- $text = StringRegExpReplace($text, "[.,; -<>!?''""«»:]", '')
- $text = StringRegExpReplace($text, "\s", '')
- $text = StringUpper($text)
- Return $text
- EndFunc ;==>_ChangeText
- Func _GetResult($stelle)
- Local $Ergebnis
- Local $f
- For $f = 0 To UBound($Code) - 1
- $stelle += $Code[$f]
- $Ergebnis &= (StringMid($text, $stelle, 1))
- Next
- Return $Ergebnis
- EndFunc ;==>_GetResult
Add Comment
Please, Sign In to add comment