Welcome

code chat log เอาไว้บันทึกการสนทนาเวลาไม่อยู่จอ

ทุกสิ่งทุกอย่างที่เกี่ยวกับตัวเกม ระบบเกม

code chat log เอาไว้บันทึกการสนทนาเวลาไม่อยู่จอ

Postby ocensound » Tue Aug 20, 2013 10:50 pm

1.เข้า google พิม NomadMemoryPSsix.au3 download มาเก็บไว้ใน folder Include ของโปรแกรม autoit
2.โหลด cheat engine แสกนหา memory 3 ตัวเทคนิคการแสกนหาได้จาก google
$IdPointer = "0x00835818"
$WhisperMsgPointer = "0x00189B54"
$MsgPointer = "0x00189B40"

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

#include <NomadMemoryPSsix.au3>

Global $IdPointer = "0x00835818"
Global $WhisperMsgPointer = "0x00189B54"
Global $MsgPointer = "0x00189B40"

Global $CharId[5]
$CharId[0] = "yourcharid"
$CharId[1] = ""
$CharId[2] = ""
$CharId[3] = ""
$CharId[4] = ""

Global $LogDebug = 1
Global $botmsgdebug = ""
Global $memopen[5]
Global $pid[5]
$pid[0] = 0
$pid[1] = 0
$pid[2] = 0
$pid[3] = 0
$pid[4] = 0
Global $handle[5]
$handle[0] = 0
$handle[1] = 0
$handle[2] = 0
$handle[3] = 0
$handle[4] = 0
Global $file[5]
Global $debugfile

Global $whispermsg[5],$talkmsg[5],$lastestmsg[5]
Global $string[7]
$string[0] = "[System]"
$string[1] = "[Whisper]"
$string[2] = "[Party]"
$string[3] = "[Talk]"
$string[4] = "[Kingdom]"
$string[5] = "[Radio]"
$string[6] = "[Combat]"

InitProcess()

;$CharId[$x] = ""

While(True)
For $j = 0 To 4 Step 1
UpdateMsg($j )
Next
WEnd

Func UpdateMsg($m=0)
If $LogDebug = 1 Then
$lastestmsg[$m] = _MEMORYREAD($WhisperMsgPointer, $memopen[$m],"char[255]")
If $lastestmsg[$m] <> $whispermsg[$m] Then
Local $result = StringInStr($lastestmsg[$m],$string[1])
If $result>0 And StringInStr($lastestmsg[$m],"(S")<=0 Then
FileWrite($file[$m],"["&$CharId[$m]&"]"&" ["&GetTimestamp()&"] "&$lastestmsg[$m]&@CRLF)
$whispermsg[$m] = $lastestmsg[$m]
EndIf
Else
EndIf
$lastestmsg[$m] = _MEMORYREAD($MsgPointer, $memopen[$m],"char[255]")
If $lastestmsg[$m] <> $talkmsg[$m] Then
Local $systemresult = StringInStr($lastestmsg[$m],$string[0])
Local $partyresult = StringInStr($lastestmsg[$m],$string[2])
Local $talkresult = StringInStr($lastestmsg[$m],$string[3])
Local $kingdomresult = StringInStr($lastestmsg[$m],$string[4])
Local $radioresult = StringInStr($lastestmsg[$m],$string[5])
Local $battleresult = StringInStr($lastestmsg[$m],$string[6])
If ($systemresult>0) And (StringInStr($lastestmsg[$m],"(S")<=0) Then
FileWrite($file[$m],"["&$CharId[$m]&"]"&" ["&GetTimestamp()&"] "&$lastestmsg[$m]&@CRLF)
$talkmsg[$m] = $lastestmsg[$m]
ElseIf ($partyresult>0) And (StringInStr($lastestmsg[$m],"(S")<=0) Then
FileWrite($file[$m],"["&$CharId[$m]&"]"&" ["&GetTimestamp()&"] "&$lastestmsg[$m]&@CRLF)
$talkmsg[$m] = $lastestmsg[$m]
ElseIf ($talkresult>0) And (StringInStr($lastestmsg[$m],"(S")<=0) Then
FileWrite($file[$m],"["&$CharId[$m]&"]"&" ["&GetTimestamp()&"] "&$lastestmsg[$m]&@CRLF)
$talkmsg[$m] = $lastestmsg[$m]
ElseIf ($kingdomresult>0) And (StringInStr($lastestmsg[$m],"(S")<=0) Then
FileWrite($file[$m],"["&$CharId[$m]&"]"&" ["&GetTimestamp()&"] "&$lastestmsg[$m]&@CRLF)
$talkmsg[$m] = $lastestmsg[$m]
ElseIf ($radioresult>0) And (StringInStr($lastestmsg[$m],"(S")<=0) Then
FileWrite($file[$m],"["&$CharId[$m]&"]"&" ["&GetTimestamp()&"] "&$lastestmsg[$m]&@CRLF)
$talkmsg[$m] = $lastestmsg[$m]
ElseIf ($battleresult>0) Then
FileWrite($file[$m],"["&$CharId[$m]&"]"&" ["&GetTimestamp()&"] "&$lastestmsg[$m]&@CRLF)
$talkmsg[$m] = $lastestmsg[$m]
Else
EndIf
Else
EndIf
EndIf
EndFunc

Func InitProcess()
$debugfile = FileOpen("debug.txt", 1)
Local $CountProcess = 0
$ProcessList = ProcessList("Fairyland.exe")
For $i = 1 To $ProcessList[0][0]
Local $TmpPid = $ProcessList[$i][1]
Local $TmpMemoryOpen = _MEMORYOPEN($TmpPid)
If $TmpMemoryOpen = 0 Then
Exit
EndIf
Local $TmpCharId = _MEMORYREAD($IdPointer, $TmpMemoryOpen ,"char[32]")
For $j = 0 To 4 Step 1
If $TmpCharId = "" Then
WinActivate(_GetHwndFromPID($TmpPid))
Exit
EndIf
If $CharId[$j] = $TmpCharId Then
$memopen[$j] = $TmpMemoryOpen
If $memopen[$j] = 0 Then
Exit
EndIf
$file[$j] = FileOpen($CharId[$j]&".txt", 1)
If $file = -1 Then
FileCreateNTFSLink($CharId[$j]&".txt","\",0)
$file[$j] = FileOpen($CharId[$j]&".txt", 1)
EndIf
$pid[$j] = $TmpPid
$handle[$j] = _GetHwndFromPID($pid[$j])
FileWrite($file[$j],@CRLF&"############################################## Start "&GetTimestamp()&@CRLF)
ExitLoop
EndIf
Next
$CountProcess = $CountProcess+1
Next
EndFunc

Func _GetHwndFromPID($PID)
$hWnd = 0
$stPID = DllStructCreate("int")
Do
$winlist2 = WinList()
For $i = 1 To $winlist2[0][0]
If $winlist2[$i][0] <> "" Then
DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $winlist2[$i][1], "ptr", DllStructGetPtr($stPID))
If DllStructGetData($stPID, 1) = $PID Then
$hWnd = $winlist2[$i][1]
ExitLoop
EndIf
EndIf
Next
Sleep(100)
Until $hWnd <> 0
Return $hWnd
EndFunc

Func GetTimestamp()
Return @HOUR & ":" & @MIN & ":" & @SEC
EndFunc
ocensound
Apprentice
Apprentice
 
Posts: 140
Joined: Thu Dec 18, 2008 11:16 am
Has thanked: 0 time
Have thanks: 5 time

 

Return to Ol 'bout Technic

Who is online

Users browsing this forum: No registered users and 0 guests

cron
suspicion-preferred