#include <NomadMemory.au3>Quote:
I don't have the script any more.. if you would be so nice to post it here again, then i could update it for you
#include <_MemoryReadUnicodeString.au3>
#include <Date.au3>
Global $title = "Atlantica Online"
Opt("WinTitleMatchMode", 3)
Global $hWnd = WinGetHandle($title) ;handle of the "title" window
Global $Process1 = WinGetProcess($title) ;the window to get PID
Global $Mem_Open = _MemoryOpen($Process1) ;must open before you can read address
HotKeySet("{ESC}", "_exit")
Func _exit()
Exit 0
EndFunc ;==>_exit
HotKeySet("^p", "_printTip")
Global $printTip
Func _printTip()
$printTip = Not $printTip
EndFunc ;==>_printTip
Global $VulcanusResults = @ScriptDir & "\VULCANUS_results.txt"
Global $VulcanusStatistics = @ScriptDir & "\VULCANUS_statistics.txt"
Global $chatMem = 0x25D19158
Func _readChat($tempMem)
Return _MemoryReadUnicodeString(9999, $tempMem, $Mem_Open)
EndFunc ;==>_readChat
Global $Last_text_split[30]
Global $text_changed
Global $change_at = 0
Func _checkTextChanged($text_split)
local $j = UBound($Last_text_split)-1
For $i=UBound($text_split) - 1 To 1 Step -1
if $j=0 Then
ExitLoop
EndIf
If $Last_text_split[$j] <> "" And $text_split[$i] <> "" Then
If $text_split[$i] <> $Last_text_split[$j] Then
$change_at = $i
Return True
EndIf
EndIf
$j = $j-1
Next
Return False
EndFunc ;==>_checkTextChanged
Global $count_success = IniRead($VulcanusResults, "Vulcanus", "count_success", 0)
Global $count_fail = IniRead($VulcanusResults, "Vulcanus", "count_fail", 0)
Global $Count_Succes_Row
Global $Count_Fail_Row
Global $NumberOfResults = 10 ;Higher number increases the number of results to create a pattern from
Global $last_result_array[$NumberOfResults]
for $i=0 to UBound($last_result_array)-1
$last_result_array[$i] = "X"
Next
Global $tip_last_result
Func _extractVulcanusResult($text)
Local $text_split = StringSplit($text, @LF)
Local $tip
If $printTip Then
For $i = 1 To UBound($text_split) - 1
$tip = $tip & "$text_split[" & $i & "] : " & $text_split[$i]
Next
$tip = $tip & @CRLF & @CRLF
EndIf
ToolTip("^p toggle chat out"&@CRLF&@CRLF& $tip & "$count_success = " & $count_success & @CRLF & "$count_fail = " & $count_fail _
& @CRLF & "$Count_Succes_Row = " & $Count_Succes_Row & @CRLF & "$Count_Fail_Row = " & $Count_Fail_Row _
& @CRLF & "" _
& @CRLF & "Display last "&$NumberOfResults&" results : " _
& @CRLF & $tip_last_result, 0, 0)
$text_changed = _checkTextChanged($text_split)
$Last_text_split = $text_split
If Not $text_changed Then
Return False
EndIf
Local $result = -1
If StringInStr($text_split[$change_at], "] war erfolgreich.") Then
$Count_Succes_Row = $Count_Succes_Row + 1
if IniRead($VulcanusResults, "Vulcanus", "MAX_succes_row", 0) < $Count_Succes_Row Then
IniWrite($VulcanusResults, "Vulcanus", "MAX_succes_row", $Count_Succes_Row)
EndIf
$Count_Fail_Row = 0
$count_success = $count_success + 1
IniWrite($VulcanusStatistics, "Vulcanus", "count_success", IniRead($VulcanusStatistics, "Vulcanus", "count_success", 0) + 1)
$result = 1
ElseIf StringInStr($text_split[$change_at], "] ist fehlgeschlagen.") Then
$Count_Fail_Row = $Count_Fail_Row + 1
if IniRead($VulcanusResults, "Vulcanus", "MAX_fail_row", 0) < $Count_Fail_Row Then
IniWrite($VulcanusResults, "Vulcanus", "MAX_fail_row", $Count_Fail_Row)
EndIf
$Count_Succes_Row = 0
$count_fail = $count_fail + 1
IniWrite($VulcanusStatistics, "Vulcanus", "count_fail", IniRead($VulcanusStatistics, "Vulcanus", "count_fail", 0) + 1)
$result = 0
EndIf
If $result <> -1 Then
Local $Date = _Date_Time_GetLocalTime()
Local $DateString = _Date_Time_SystemTimeToDateTimeStr($Date)
FileWrite($VulcanusResults, $DateString & " :: " & $result &@CRLF)
_get_last_results($result)
$tip_last_result = _getPattern(UBound($last_result_array)-1)
local $pattern
for $i=0 to UBound($last_result_array)-1
$pattern = _get_Test_Pattern($i)
if $pattern <> "" AND NOT StringInStr($pattern, "X") Then
local $tab = ""
for $_i=1 to $NumberOfResults-StringLen($pattern)
$tab = $tab & " "
Next
$tab = $tab & " :"
IniWrite($VulcanusStatistics, "Pattern_count", $pattern&$tab, IniRead($VulcanusStatistics, "Pattern_count", $pattern&$tab, 0)+1 )
EndIf
Next
EndIf
$Last_text_split = StringSplit(_readChat($chatMem), @LF)
Return True
EndFunc ;==>_extractVulcanusResult
Func _getPattern($NumberOfValues)
local $_pattern
for $i=0 to $NumberOfValues
$_pattern = $_pattern &$last_result_array[$i]
Next
return $_pattern
EndFunc
Func _get_Test_Pattern($NumberOfValues)
local $_pattern
for $i=UBound($last_result_array)-1 to UBound($last_result_array)-1-$NumberOfValues Step -1
$_pattern = $_pattern &$last_result_array[$i]
Next
$_pattern = _StringReverse($_pattern)
return $_pattern
EndFunc
Func _get_last_results($result)
for $i=0 to UBound($last_result_array)-2
$last_result_array[$i] = $last_result_array[$i+1]
Next
$last_result_array[UBound($last_result_array)-1] = $result
EndFunc
HotKeySet("^t", "_toggleHotkeys")
Global $Hotkey = false
Func _toggleHotkeys()
$Hotkey = NOT $Hotkey
EndFunc
HotKeySet("1", "_send_1")
Func _send_1()
if $Hotkey Then
_send(1)
Else
HotKeySet("1")
Send("1")
HotKeySet("1", "_send_1")
EndIf
EndFunc
HotKeySet("0", "_send_0")
Func _send_0()
if $Hotkey Then
_send(0)
Else
HotKeySet("0")
Send("0")
HotKeySet("0", "_send_0")
EndIf
EndFunc
Func _send($send)
local $result = $send
_get_last_results($result)
$tip_last_result = _getPattern(UBound($last_result_array)-1)
local $pattern
for $i=0 to UBound($last_result_array)-1
$pattern = _get_Test_Pattern($i)
if $pattern <> "" AND NOT StringInStr($pattern, "X") Then
IniWrite($VulcanusStatistics, "Pattern_count", $pattern, IniRead($VulcanusStatistics, "Pattern_count", $pattern, 0)+1 )
EndIf
Next
EndFunc
While True
_extractVulcanusResult(_readChat($chatMem))
WEnd