Guest User

Untitled

a guest
Feb 21st, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.26 KB | None | 0 0
  1. #include <File.au3>
  2.  
  3. Global $Code
  4. $text = FileRead(@ScriptDir & '/EffBri.txt')
  5. $text = _ChangeText($text)
  6.  
  7. For $i = 0 To 11
  8.     $Code = StringSplit(FileReadLine(@ScriptDir & '/' & $i & '.txt', 1), ' ', 2)
  9.     _SearchCrypt($i)
  10. Next
  11.  
  12. Func _SearchCrypt($ActFile)
  13.     Local $found = False
  14.     Local $i = 0
  15.     Local $stelle = 0
  16.     Local $Buchstabe
  17.     While $i < StringLen($text) And $found = False
  18.         $stelle = $i
  19.         For $j = 0 To UBound($Code) - 1
  20.             $found = True
  21.             $stelle += $Code[$j]
  22.             $Buchstabe = StringMid($text, $stelle, 1)
  23.             For $z = $stelle - $Code[$j] + 1 To $stelle - 1
  24.                 If StringMid($text, $z, 1) = $Buchstabe Then
  25.                     $found = False
  26.                     ExitLoop (2)
  27.                 EndIf
  28.             Next
  29.         Next
  30.         If $found Then ConsoleWrite(@CRLF & 'String: ' & $ActFile + 1 & ' | Stelle: ' & $i & ' | String: ' & _GetResult($i))
  31.         $i += 1
  32.     WEnd
  33. EndFunc   ;==>_SearchCrypt
  34.  
  35. Func _ChangeText($text)
  36.     $text = StringRegExpReplace($text, "[.,; -<>!?''""«»:]", '')
  37.     $text = StringRegExpReplace($text, "\s", '')
  38.     $text = StringUpper($text)
  39.     Return $text
  40. EndFunc   ;==>_ChangeText
  41.  
  42. Func _GetResult($stelle)
  43.     Local $Ergebnis
  44.     Local $f
  45.     For $f = 0 To UBound($Code) - 1
  46.         $stelle += $Code[$f]
  47.         $Ergebnis &= (StringMid($text, $stelle, 1))
  48.     Next
  49.     Return $Ergebnis
  50. EndFunc   ;==>_GetResult
Add Comment
Please, Sign In to add comment