Anantapolk Posted June 23, 2017 Posted June 23, 2017 (edited) expandcollapse popupHotKeySet("{ESC}", "stop") Global $var = DriveGetSerial("c:\") ;~ $color = "0x4A224D,0x201029,0x381D34,0x1D112A,0x2F5669,0x281329,0x33262D,0x8CC00C,0xACEC0E" ;ฑูตทัพทหารตั้งโต๊ะ $color = "0x103257,0x082040,0x1B70AE,0x326C9B,0x214F79,0x185284" ;ทหารธนูใจ $mon = StringSplit($color, ",") Global $TS5 Global $Round = 0 Global $Sum = 0 Global $pssix = 0 Global $X = 0 Global $Y = 0 Global $ButtonStart = 0 #include <ButtonConstants.au3> #include <EditConstants.au3> #include <Date.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ImageSearch.au3> Opt("GUIOnEventMode", 2) Opt("MouseCoordMode", 2) Opt("PixelCoordMode", 2) Opt("CaretCoordMode", 2) Func _PSsixLoadH($gtitle) $TS5 = WinGetHandle($gtitle) If @error Then MsgBox(4096, "Error", "กรุณาเปิดเกม TS5 Legend ก่อนครับ") Exit EndIf EndFunc ;==>_PSsixLoadH If _PSsixLoadH("TS5 Legend") Then WinActivate($TS5) $pos = WinGetPos("TS5 Legend") #Region ### START Koda GUI section ### Form=C:\BotTs5\Form1.kxf $Form1 = GUICreate("BotTs5 by 9___POP V5", 301, 341, 790, 183) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize") GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize") GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore") $Pic1 = GUICtrlCreatePic("C:\BotTs5\headnews.jpg", 8, 8, 284, 100) GUICtrlSetOnEvent(-1, "Pic1Click") $List1 = GUICtrlCreateList("", 8, 117, 284, 110) GUICtrlSetOnEvent(-1, "List1Click") $Input1 = GUICtrlCreateInput("", 8, 312, 121, 21) GUICtrlSetOnEvent(-1, "Input1Change") $Input2 = GUICtrlCreateInput("", 8, 280, 41, 21) GUICtrlSetOnEvent(-1, "Input2Change") $Button1 = GUICtrlCreateButton("เริ่มใช้งาน", 8, 232, 91, 41) GUICtrlSetOnEvent(-1, "Button1Click") $Button2 = GUICtrlCreateButton("ปิด", 104, 232, 92, 41) GUICtrlSetOnEvent(-1, "Button2Click") $Button3 = GUICtrlCreateButton("ลงทะเบียน", 200, 232, 93, 41) GUICtrlSetOnEvent(-1, "Button3Click") $Label1 = GUICtrlCreateLabel("จำนวนรอบเข้าสู้ เมื่อครบกำหนดจะไปหลอมอุปกรณ์", 56, 284, 235, 17) GUICtrlSetOnEvent(-1, "Label1Click") $Label2 = GUICtrlCreateLabel("เลขลงทะเบียนผู้ทดลองใช้", 136, 315, 156, 17) GUICtrlSetOnEvent(-1, "Label2Click") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) Select Case $pssix = 1 $pssix = 0 Case $ButtonStart = 1 $ButtonStart = 0 Start() Case $ButtonStart = 2 $ButtonStart = 0 EndSelect WEnd Func Start() While 1 If $ButtonStart <> 0 then ExitLoop WinActivate($TS5) If PixelGetColor(512, 385) = 0x093F3B Then ; หลุดเข้าใหม่ MouseClick("left", 512, 385, 1, 5) EndIf If PixelGetColor(510, 514) = 0x6A4C38 Then ; กดปุ่ม รู้แล้ว MouseClick("left", 510, 514, 1, 5) EndIf If PixelGetColor(620, 483) = 0x439377 Then ; กดปุ่ม เข้าเกมส์ MouseClick("left", 620, 483, 1, 5) EndIf If PixelGetColor(950, 62) = 0xFDF6DF Then ; กดปุ่มปิดโฆษณา MouseClick("left", 950, 62, 1, 5) EndIf Sleep(100) For $i = 1 To $mon[0] Do $aCoord = PixelSearch($pos[0], $pos[1], $pos[0] + $pos[2], $pos[1] + $pos[3], $mon[$i]) If Not @error Then MouseClick("", $aCoord[0], $aCoord[1]) Sleep(100) EndIf Until Not IsArray($aCoord) Next If PixelGetColor(256, 24) = 0xFCD300 Then ; คลิ๊กที่ตัวเอง GUICtrlSetData($List1, "[1] กำลังค้นหามอนสเตอร์") MouseClick("left", 515, 301,2,5) Sleep(1000) EndIf If PixelGetColor(997, 158) = 0xCFBB88 Then ; กดปุ่ม Auto MouseClick("left", 997, 158, 1, 5) Sleep(500) MouseClick("left", 999, 100, 1, 5) ; กด x1 Sleep(500) MouseClick("left", 999, 100, 1, 5) ; กด x2 EndIf If PixelGetColor(997, 159) = 0xE6CC5E Then ; สีตอนกดปุ่ม Auto GUICtrlSetData($List1, "[2] กำลังต่อสู้") $Round += 1 ; กด auto ไว้ให้นับ +1 $Sum +=1 ; แสดงการต่อสู้ทั้งหมด Sleep(1000) GUICtrlSetData($Label1, $Round) ; แสดงเลขที่นับไว้ GUICtrlSetData($Label2, $Sum) ; แสดงผลการต่อสู้ทั้งหมด Checkinput() ; ตรวจสอบ input1 Else If PixelGetColor(256, 24) = 0xFCD300 Then ; คลิ๊กที่ตัวเอง GUICtrlSetData($List1, "[1] กำลังค้นหามอนสเตอร์") MouseClick("left", 515, 301,2,5) Sleep(100) EndIf If PixelGetColor(256, 24) = 0xFCD300 Then ; คลิ๊กที่ตัวเอง GUICtrlSetData($List1, "[1] กำลังค้นหามอนสเตอร์") MouseClick("left", 515, 301,2,5) Sleep(1000) EndIf Start() EndIf WEnd EndFunc ;==>Start Func Checkinput() While 1 If $Round = GUICtrlRead($Input2) Then Beep(500, 1000) ; เตือนด้วยเสียงนาน 1 วิ GUICtrlSetData($List1, "[3] รอสู้เสร็จ แล้วไปหลอมอุปกรณ์") Do ; เริ่มการวนซ้ำ Sleep(100) Until PixelGetColor(256, 24) = 0xFCD300 ; เมื่อเจอสีนี้ให้เลิกวนแล้วทำคำสั่งต่อไป Item() Else Do Sleep(100) If PixelGetColor(512, 385) = 0x093F3B Then ; หลุดเข้าใหม่ MouseClick("left", 512, 385, 1, 5) EndIf If PixelGetColor(510, 514) = 0x6A4C38 Then ; กดปุ่ม รู้แล้ว MouseClick("left", 510, 514, 1, 5) EndIf If PixelGetColor(620, 483) = 0x439376 Then ; กดปุ่ม เข้าเกมส์ MouseClick("left", 620, 483, 1, 5) EndIf If PixelGetColor(950, 62) = 0xFDF6DF Then ; กดปุ่มปิดโฆษณา MouseClick("left", 950, 62, 1, 5) EndIf Until PixelGetColor(256, 24) = 0xFCD300 Start() EndIf WEnd EndFunc ;==>Checkinput Func Item() While 1 If PixelGetColor(968, 201) = 0xDEC76B Then ; คลิ๊กลูกศร MouseClick("left", 968, 201, 1, 10) Sleep(1000) EndIf If PixelGetColor(908, 440) = 0xB13F03 Then ; คลิ๊กเตาหลอม GUICtrlSetData($List1, "[4] เลือกเมนูเตาหลอม") MouseClick("left", 908, 440, 1, 10) Sleep(1000) EndIf If PixelGetColor(376, 35) = 0x928F8E Then ; คลิ๊กอุปกรณ์ MouseClick("left", 376, 35, 1, 10) Sleep(1000) EndIf If PixelGetColor(342, 24) = 0xCC7427 Then ; คลิ๊กใส่ทันที MouseClick("left", 559, 508, 1, 10) GUICtrlSetData($List1, "[5] กำลังค้นหาอุปกรณ์สีม่วงและสีทอง ถ้าพบให้เอาออกไม่ต้องหลอม") Sleep(3000) EndIf If PixelGetColor(486, 221) = 0xBC6C18 Then ; ตรวจสอบของทองช่อง 1 ชิ้นที่ 1 MouseClick("left", 486, 221, 1, 10) Sleep(100) EndIf If PixelGetColor(486, 221) = 0xBC6C18 Then ; ตรวจสอบของทองช่อง 1 ชิ้นที่ 1 MouseClick("left", 486, 221, 1, 10) Sleep(100) EndIf If PixelGetColor(587, 221) = 0xBF6F18 Then ; ตรวจสอบของทองช่อง 2 ชิ้นที่ 2 MouseClick("left", 587, 221, 1, 10) Sleep(100) EndIf If PixelGetColor(587, 221) = 0xBF6F18 Then ; ตรวจสอบของทองช่อง 2 ชิ้นที่ 2 MouseClick("left", 587, 221, 1, 10) Sleep(100) EndIf If PixelGetColor(687, 222) = 0xDCA933 Then ; ตรวจสอบของทองช่อง3 ชิ้นที่ 3 MouseClick("left", 687, 222, 1, 10) Sleep(100) EndIf If PixelGetColor(687, 222) = 0xDCA933 Then ; ตรวจสอบของทองช่อง3 ชิ้นที่ 3 MouseClick("left", 687, 222, 1, 10) Sleep(100) EndIf If PixelGetColor(787, 222) = 0xD59C2B Then ; ตรวจสอบของทองช่อง4 ชิ้นที่ 4 MouseClick("left", 787, 222, 1, 10) Sleep(100) EndIf If PixelGetColor(787, 222) = 0xD59C2B Then ; ตรวจสอบของทองช่อง4 ชิ้นที่ 4 MouseClick("left", 787, 222, 1, 10) Sleep(100) EndIf If PixelGetColor(885, 222) = 0xD79E2D Then ; ตรวจสอบของทองช่อง 5 ชิ้นที่ 5 MouseClick("left", 885, 222, 1, 10) Sleep(100) EndIf If PixelGetColor(885, 222) = 0xD79E2D Then ; ตรวจสอบของทองช่อง 5 ชิ้นที่ 5 MouseClick("left", 885, 222, 1, 10) Sleep(100) EndIf If PixelGetColor(484, 318) = 0xDDAC34 Then ; ตรวจสอบของทองช่อง6 ชิ้นที่ 6 MouseClick("left", 484, 318, 1, 10) Sleep(100) EndIf If PixelGetColor(484, 318) = 0xDDAC34 Then ; ตรวจสอบของทองช่อง6 ชิ้นที่ 6 MouseClick("left", 484, 318, 1, 10) Sleep(100) EndIf If PixelGetColor(587, 319) = 0xDCAA33 Then ; ตรวจสอบของทองช่อง7 ชิ้นที่ 7 MouseClick("left", 587, 319, 1, 10) Sleep(100) EndIf If PixelGetColor(587, 319) = 0xDCAA33 Then ; ตรวจสอบของทองช่อง7 ชิ้นที่ 7 MouseClick("left", 587, 319, 1, 10) Sleep(100) EndIf If PixelGetColor(688, 319) = 0xDEAE35 Then ; ตรวจสอบของทองช่อง8 ชิ้นที่ 8 MouseClick("left", 688, 319, 1, 10) Sleep(100) EndIf If PixelGetColor(688, 319) = 0xDEAE35 Then ; ตรวจสอบของทองช่อง8 ชิ้นที่ 8 MouseClick("left", 688, 319, 1, 10) Sleep(100) EndIf If PixelGetColor(787, 319) = 0xDFAF36 Then ; ตรวจสอบของทองช่อง9 ชิ้นที่ 9 MouseClick("left", 787, 319, 1, 10) Sleep(100) EndIf If PixelGetColor(787, 319) = 0xDFAF36 Then ; ตรวจสอบของทองช่อง9 ชิ้นที่ 9 MouseClick("left", 787, 319, 1, 10) Sleep(100) EndIf If PixelGetColor(885, 319) = 0xDFB036 Then ; ตรวจสอบของทองช่อง10 ชิ้นที่ 10 MouseClick("left", 885, 319, 1, 10) Sleep(100) EndIf If PixelGetColor(885, 319) = 0xDFB036 Then ; ตรวจสอบของทองช่อง10 ชิ้นที่ 10 MouseClick("left", 885, 319, 1, 10) Sleep(100) EndIf If PixelGetColor(486, 221) = 0x6F349E Then ; ตรวจสอบของม่วงช่อง 1 ชิ้นที่ 1 MouseClick("left", 486, 221, 1, 10) Sleep(100) EndIf If PixelGetColor(486, 221) = 0x6F349E Then ; ตรวจสอบของม่วงช่อง 1 ชิ้นที่ 1 MouseClick("left", 486, 221, 1, 10) Sleep(100) EndIf If PixelGetColor(587, 221) = 0x7234A2 Then ; ตรวจสอบของม่วงช่อง 2 ชิ้นที่ 2 MouseClick("left", 587, 221, 1, 10) Sleep(100) EndIf If PixelGetColor(587, 221) = 0x7234A2 Then ; ตรวจสอบของม่วงช่อง 2 ชิ้นที่ 2 MouseClick("left", 587, 221, 1, 10) Sleep(100) EndIf If PixelGetColor(687, 222) = 0xB064CB Then ; ตรวจสอบของม่วงช่อง 3 ชิ้นที่ 3 MouseClick("left", 687, 222, 1, 10) Sleep(100) EndIf If PixelGetColor(687, 222) = 0xB064CB Then ; ตรวจสอบของม่วงช่อง 3 ชิ้นที่ 3 MouseClick("left", 687, 222, 1, 10) Sleep(100) EndIf If PixelGetColor(787, 222) = 0xA156C2 Then ; ตรวจสอบของม่วงช่อง 4 ชิ้นที่ 4 MouseClick("left", 787, 222, 1, 10) Sleep(100) EndIf If PixelGetColor(787, 222) = 0xA156C2 Then ; ตรวจสอบของม่วงช่อง 4 ชิ้นที่ 4 MouseClick("left", 787, 222, 1, 10) Sleep(100) EndIf If PixelGetColor(885, 222) = 0xA459C4 Then ; ตรวจสอบของม่วงช่อง 5 ชิ้นที่ 5 MouseClick("left", 885, 222, 1, 10) Sleep(100) EndIf If PixelGetColor(885, 222) = 0xA459C4 Then ; ตรวจสอบของม่วงช่อง 5 ชิ้นที่ 5 MouseClick("left", 885, 222, 1, 10) Sleep(100) EndIf If PixelGetColor(484, 318) = 0xB466CC Then ; ตรวจสอบของม่วงช่อง 6 ชิ้นที่ 6 MouseClick("left", 484, 318, 1, 10) Sleep(100) EndIf If PixelGetColor(484, 318) = 0xB466CC Then ; ตรวจสอบของม่วงช่อง 6 ชิ้นที่ 6 MouseClick("left", 484, 318, 1, 10) Sleep(100) EndIf If PixelGetColor(587, 319) = 0xB164CB Then ; ตรวจสอบของม่วงช่อง 7 ชิ้นที่ 7 MouseClick("left", 587, 319, 1, 10) Sleep(100) EndIf If PixelGetColor(587, 319) = 0xB164CB Then ; ตรวจสอบของม่วงช่อง 7 ชิ้นที่ 7 MouseClick("left", 587, 319, 1, 10) Sleep(100) EndIf If PixelGetColor(688, 319) = 0xB568CD Then ; ตรวจสอบของม่วงช่อง 8 ชิ้นที่ 8 MouseClick("left", 688, 319, 1, 10) Sleep(100) EndIf If PixelGetColor(688, 319) = 0xB568CD Then ; ตรวจสอบของม่วงช่อง 8 ชิ้นที่ 8 MouseClick("left", 688, 319, 1, 10) Sleep(100) EndIf If PixelGetColor(787, 319) = 0xB669CE Then ; ตรวจสอบของม่วงช่อง 9 ชิ้นที่ 9 MouseClick("left", 787, 319, 1, 10) Sleep(100) EndIf If PixelGetColor(787, 319) = 0xB669CE Then ; ตรวจสอบของม่วงช่อง 9 ชิ้นที่ 9 MouseClick("left", 787, 319, 1, 10) Sleep(100) EndIf If PixelGetColor(885, 319) = 0xB769CF Then ; ตรวจสอบของม่วงช่อง 10 ชิ้นที่ 10 MouseClick("left", 885, 319, 1, 10) Sleep(100) EndIf If PixelGetColor(885, 319) = 0xB769CF Then ; ตรวจสอบของม่วงช่อง 10 ชิ้นที่ 10 MouseClick("left", 885, 319, 1, 10) Sleep(100) Closeitem() EndIf If PixelGetColor(521, 191) = 0x473825 Then ; ไม่มีไอเทมให้หลอมและปิดหน้าเตาหลอม Sleep(3000) GUICtrlSetData($List1, "[6] ไม่มีไอเทมให้หลอม") Closeitem() Else GUICtrlSetData($List1, "[7] หลอมอุปกรณ์") If PixelGetColor(342, 24) = 0xCC7427 Then MouseClick("left", 888, 512, 1, 10) Sleep(100) MouseClick("left", 509, 376, 1, 10) Sleep(100) Closeitem() EndIf EndIf WEnd EndFunc ;==>Item Func Closeitem() While 1 If PixelGetColor(987, 34) = 0xFCF5DF Then ; ปิดหน้าเตาหลอม GUICtrlSetData($List1, "[8] ออกจากเมนูหลอมอุปกรณ์") Sleep(100) $Round = 0 ; ลบค่าการนับทั้งหมดให้เป็น 0 MouseClick("left", 987, 34, 1, 10) Sleep(100) Start() EndIf WEnd EndFunc ;==>Closeitem Func CloseChat() While 1 If PixelGetColor(888, 15) = 0xF7E0BA Then ; กดปุ่มช่องพูดคุย GUICtrlSetData($List1, "[10] ปิดปุ่มช่องพูดคุย") MouseClick("left", 888,15, 1, 5) Sleep(100) Start() EndIf WEnd EndFunc Func Button1Click() $ButtonStart = 1 GUICtrlSetData($Input1,$var) Start() EndFunc ;==>Button1Click Func Button2Click() Exit EndFunc ;==>Button2Click Func Button3Click() $var = DriveGetSerial("c:\") GUICtrlSetData($Input1, $var) EndFunc ;==>Button3Click Func Form1Close() Exit EndFunc ;==>Form1_1Close Func Form1Maximize() EndFunc ;==>Form1_1Maximize Func Form1Minimize() EndFunc ;==>Form1_1Minimize Func Form1Restore() EndFunc ;==>Form1_1Restore Func Input1Change() EndFunc ;==>Input1Change Func Input2Change() EndFunc ;==>Input2Change Func Label1Click() EndFunc ;==>Label1Click Func Label2Click() EndFunc ;==>Label2Click Func Label3Click() EndFunc ;==>Label3Click Func List1Click() EndFunc ;==>List1Click Func Pic1Click() EndFunc ;==>Pic1Click Func Stop() Exit EndFunc ;==>Stop what is this error? and how do i fix it? Edited June 23, 2017 by Anantapolk
Developers Jos Posted June 23, 2017 Developers Posted June 23, 2017 Seems you haven't done what was stated the previous time: You will get 2 days posting ban to read them this time! Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Recommended Posts