mạn phép MK cho mình post mã code cho anh em xài, mình đã làm ra rùi, anh em để đề thi vào F7 và để giao diện cửa sổ là 800x600 dạng của sổ nhé.
#include <NomadMemory.au3>
#include <GuiConstantsEx.au3>
#include <GuiComboBoxEx.au3>
HotKeySet ("^e","Exitall")
Local $hGUI
$hGUI = GUICreate("Mr.Tú", 200, 220, 800, 300)
$cb_GetChar=_GUICtrlComboBox_Create ($hGUI, "", 10, 10, 170, 50)
GUICtrlCreateLabel("Để đề thi vào ô F7",10, 50, 300, 20)
GUICtrlCreateLabel("Rồi chọn nhân vật và nhấn Bắt Đầu",10, 75, 300, 20)
GUICtrlCreateLabel("Nếu đã thay đổi vị trí thì nhấn Ctrl+F9",10, 95, 300, 20)
GUICtrlCreateLabel("Muốn thoát chương trình nhấn Ctrl+E",10, 115, 300, 20)
GUICtrlCreateLabel("Thiết kế MR.TÚ",2, 200, 300, 20)
$bt_start=GUICtrlCreateButton ("Bắt Đầu",20, 160, 80, 30)
GUISetState()
$AddNameChar = "0x011186E8" ;được tên nhân vật
$start = "0x013a179c" ; được cửa sổ trả lời đề thi
$answer = "0x013a1b7c" ; được cửa sổ chọn câu trả lời
$AddSoLuong = "0x0111A308" ;được số lượng đề thi có trong người
$AddExp="0x01959F40" ;được điểm kinh nghiệm
Global $return_selec
Global $pause = False
$title = Wingettitle("[Class:LineKongGame]") ;lấy tên cửa sổ game
Dim $ArrayPid[7]
Dim $Handle[7]
Dim $varCharName[7]
$ConstArrayPid=0
While WinExists($title)
$ArrayPid[$ConstArrayPid]=WinGetProcess($title)
$Handle[$ConstArrayPid]=_MemoryOpen($ArrayPid[$ConstArrayPid])
$varCharName[$ConstArrayPid]=_MemoryRead($AddNameChar,$handle[$ConstArrayPid],"wchar[32]")
WinSetTitle ($title,"","TDK"&$ConstArrayPid)
_GUICtrlComboBox_AddString($cb_GetChar,$varCharName[$ConstArrayPid])
$ConstArrayPid+=1
Sleep(10)
WEnd
While True
$iMsg = GUIGetMsg()
Select
Case $iMsg = $GUI_EVENT_CLOSE
$pause = not $pause
GUIDelete()
Exit
Case $iMsg = $bt_start
_GUICtrlButton_Show($bt_start, False)
$return_select=_GUICtrlComboBox_GetCurSel($cb_GetChar)
$vExpFirst= Expp ("TDK"&$return_select)
WinMove("TDK"&$return_select,"",0,0) ;chuyển cửa sổ game lên góc trên cùng bên phải
ReadNameChar("TDK"&$return_select)
If ReadNameChar("TDK"&$return_select) = 1 Then
$sl = soluong("TDK"&$return_select)
$printSL = $sl
While $sl > 0
TraLoi("TDK"&$return_select,"{F7}")
Sleep(500)
$sl = $sl -1
WEnd
_GUICtrlButton_Show($bt_start,True)
$vExpLast =(Expp ("TDK"&$return_select)) - $vExpFirst
Exit
EndIf
EndSelect
WEnd
Func soluong($Window)
$Pid=WinGetProcess($Window)
$Handle=_MemoryOpen($Pid)
Return _MemoryRead($AddSoLuong,$Handle)
EndFunc
Func Expp ($Window)
$Pid=WinGetProcess($Window)
$Handle=_MemoryOpen($Pid)
Return _MemoryRead($AddExp,$Handle)
EndFunc
Func TraLoi($Window,$Choose)
Sleep(100)
$Pid=WinGetProcess($Window)
$Handle=_MemoryOpen($Pid)
Do
ControlSend ($Window,"","",$Choose)
Sleep(500)
Until _MemoryRead($start,$Handle)=1 ;cửa sổ bắt đầu trả lời
Do
MouseMove (358,501,5)
Sleep(100)
ControlClick($Window,"","","left",1)
Sleep (500)
Until _MemoryRead($answer,$Handle)=1 ;cửa sổ chọn câu trả lời
Do
MouseMove (239,309,1) ;dòng 1
Sleep(20)
ControlClick($Window,"","","right",1)
Sleep(10)
If _MemoryRead($answer,$Handle)=0 Then
ExitLoop
EndIf
MouseMove (363,514,1)
Sleep(20)
ControlClick($Window,"","","left",1)
Sleep(10)
If _MemoryRead($answer,$Handle)=0 Then
ExitLoop
EndIf
MouseMove (240,339,1) ;dòng 2
Sleep(20)
ControlClick($Window,"","","right",1)
Sleep(10)
If _MemoryRead($answer,$Handle)=0 Then
ExitLoop
EndIf
MouseMove (363,514,1)
Sleep(20)
ControlClick($Window,"","","left",1)
Sleep(10)
If _MemoryRead($answer,$Handle)=0 Then
ExitLoop
EndIf
MouseMove (239,369,1);dòng 3
Sleep(20)
ControlClick($Window,"","","right",1)
Sleep(10)
If _MemoryRead($answer,$Handle)=0 Then
ExitLoop
EndIf
MouseMove (363,514,1)
Sleep(20)
ControlClick($Window,"","","left",1)
Sleep(10)
If _MemoryRead($answer,$Handle)=0 Then
ExitLoop
EndIf
MouseMove (240,389,1); dòng 4
Sleep(20)
ControlClick($Window,"","","right",1)
Sleep(10)
If _MemoryRead($answer,$Handle)=0 Then
ExitLoop
EndIf
MouseMove (363,514,1)
Sleep(20)
ControlClick($Window,"","","left",1)
Sleep(10)
If _MemoryRead($answer,$Handle)=0 Then
ExitLoop
EndIf
MouseMove (240,419,1); dòng 5
Sleep(20)
ControlClick($Window,"","","right",1)
Sleep(10)
If _MemoryRead($answer,$Handle)=0 Then
ExitLoop
EndIf
MouseMove (363,514,1)
Sleep(20)
ControlClick($Window,"","","left",1)
Sleep(10)
If _MemoryRead($answer,$Handle)=0 Then
ExitLoop
EndIf
Until _MemoryRead($answer,$Handle)=0
EndFunc
Func Exitall()
Exit
EndFunc
Func ReadNameChar($Window)
$Pid=WinGetProcess($Window)
$Handle=_MemoryOpen($Pid)
$InfoNameChar=_MemoryRead($AddNameChar,$Handle,"wchar[32]")
Dim $Name[4]
$auto=0
$array=4
$Name[0]="ABCDXYZ"; anh em thay tên nhân vật mình vô đây nhé
$Name[1]=""
$Name[2]=""
$Name[3]=""
While $auto <> $array
If $InfoNameChar == $Name[$auto] Then
Return 1
ExitLoop
EndIf
$auto+=1
WEnd
Return 0
EndFunc
---------- Post added at 11:50 ---------- Previous post was at 11:46 ----------
còn đây là file mình đã convert cho bạn nào ko có chương trình autoIT
http://www.mediafire.com/?ds9f4janjfpj0cj