ฟอรั่ม PSsix

Would you like to react to this message? Create an account in a few clicks or log in to continue.

ฟอรั่มของบล็อก http://pssix.blogspot.com


3 posters

    ช่วยดูโค้ดนี้หน่อยครับ

    avatar
    mepmep
    PSsix Member
    PSsix Member


    ช่วยดูโค้ดนี้หน่อยครับ Empty ช่วยดูโค้ดนี้หน่อยครับ Empty
    จำนวนข้อความ : 29
    ความนิยม : 0
    เข้าร่วมเมื่อ : 29/01/2012

    ช่วยดูโค้ดนี้หน่อยครับ Empty ช่วยดูโค้ดนี้หน่อยครับ

    ตั้งหัวข้อ by mepmep 19/06/12, 02:08 pm

    ทำไมตีตัวเดียว แล้วจบสคริปเลย ไม่วนตีอื่น
    คือถ้าเอา ExitLoop ออก
    มันก็จะวนตีตัวอื่นไปเรื่อย ม่อนยังไม่ทันตาย
    ผมควรต้องแก้ไขยังครับ


    Code:

    #include <Constants.au3>
    #include <WinAPI.au3>

    HotKeySet("{ESC}","_exit")
    HotKeySet("{F1}","_TogglePause")
    Global $Paused
    Global $GameHD, $GameHD2
    ;Global $monster[3] = [0xACEAE9,0xC7CB4E,0x617C45]
    Global $colormon1 = 0xACEAE9

    _TogglePause()

    Func _TogglePause()
       $Paused = NOT $Paused
       While $Paused
          sleep(100)
          ToolTip('Script is "Paused"',0,0)
       WEnd
       ToolTip('Script is "Working"',0,0)
       _StartBot()
    EndFunc

    Func _exit()
       Exit 0
    EndFunc

    Func _PSsixLoadH($gtitle)
      $GameHD = WinGetHandle($gtitle)
      $GameHD2 = _WinAPI_GetWindow($GameHD, $GW_CHILD)
      If @error Then
          MsgBox(4096, "Error", "ไม่พบหน้าต่างเกม")
      Else
          Return 1
      EndIf
    EndFunc

    Func _StartBot()
    While 1
       sleep(80)
       If _PSsixLoadH("xxxxx") Then WinActivate($GameHD)
       ;For $i = 0 To UBound($monster)-1
          $coord = PixelSearch(400,230, 1000, 580,$colormon1)
          ConsoleWrite('หาสี = ' &Hex($colormon1,6) & @error & @crlf)
          If IsArray($coord) Then
             ConsoleWrite(' เจอที่ = ' & $coord[0]&'x' & $coord[1] &' ' & @error &' '& @crlf)
             ToolTip(' Found monster at ' & $coord[0] & ' '& $coord[1],0,0)
             MouseClick("",$coord[0],$coord[1],1,0)
             ExitLoop
          EndIf
       ;Next
    WEnd
    EndFunc
    avatar
    Fast
    PSsix Member Super Class III
    PSsix Member Super Class III


    ช่วยดูโค้ดนี้หน่อยครับ Empty PSsix Program Coder
    จำนวนข้อความ : 217
    ความนิยม : 54
    เข้าร่วมเมื่อ : 19/06/2011

    ช่วยดูโค้ดนี้หน่อยครับ Empty Re: ช่วยดูโค้ดนี้หน่อยครับ

    ตั้งหัวข้อ by Fast 19/06/12, 09:08 pm

    ตอนตีมอนมีแถบเืลือดเปล่าครับ ใช้วิธีตรวจแถบเลือดเอานะ


    #include
    #include

    HotKeySet("{ESC}","_exit")
    HotKeySet("{F1}","_TogglePause")
    Global $Paused
    Global $GameHD, $GameHD2
    ;Global $monster[3] = [0xACEAE9,0xC7CB4E,0x617C45]
    Global $colormon1 = 0xACEAE9

    _TogglePause()

    Func _TogglePause()
    $Paused = NOT $Paused
    While $Paused
    sleep(100)
    ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip('Script is "Working"',0,0)
    _StartBot()
    EndFunc

    Func _exit()
    Exit 0
    EndFunc

    Func _PSsixLoadH($gtitle)
    $GameHD = WinGetHandle($gtitle)
    $GameHD2 = _WinAPI_GetWindow($GameHD, $GW_CHILD)
    If @error Then
    MsgBox(4096, "Error", "ไม่พบหน้าต่างเกม")
    Else
    Return 1
    EndIf
    EndFunc

    Func _StartBot()
    While 1
    sleep(80)
    If _PSsixLoadH("xxxxx") Then WinActivate($GameHD)
    ;For $i = 0 To UBound($monster)-1
    $coord = PixelSearch(400,230, 1000, 580,$colormon1)
    ConsoleWrite('หาสี = ' &Hex($colormon1,6) & @error & @crlf)
    If IsArray($coord) Then
    ConsoleWrite(' เจอที่ = ' & $coord[0]&'x' & $coord[1] &' ' & @error &' '& @crlf)
    ToolTip(' Found monster at ' & $coord[0] & ' '& $coord[1],0,0)
    MouseClick("",$coord[0],$coord[1],1,0)
    ;;;;;;;;;;;ตรวจแถบเลือด;;;;;;;;;;;;;;;;;;;
    While PixelGetColor(xx, xxx) = 0xaaaa ;รหัสสีเลือด
    Sleep(1000)

    WEnd
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    EndIf
    ;Next
    WEnd
    EndFunc
    avatar
    Gdolive
    PSsix Member
    PSsix Member


    ช่วยดูโค้ดนี้หน่อยครับ Empty ช่วยดูโค้ดนี้หน่อยครับ Empty
    จำนวนข้อความ : 28
    ความนิยม : 0
    เข้าร่วมเมื่อ : 10/02/2012

    ช่วยดูโค้ดนี้หน่อยครับ Empty Re: ช่วยดูโค้ดนี้หน่อยครับ

    ตั้งหัวข้อ by Gdolive 19/06/12, 11:20 pm

    เกมส์รัย
    avatar
    mepmep
    PSsix Member
    PSsix Member


    ช่วยดูโค้ดนี้หน่อยครับ Empty ช่วยดูโค้ดนี้หน่อยครับ Empty
    จำนวนข้อความ : 29
    ความนิยม : 0
    เข้าร่วมเมื่อ : 29/01/2012

    ช่วยดูโค้ดนี้หน่อยครับ Empty Re: ช่วยดูโค้ดนี้หน่อยครับ

    ตั้งหัวข้อ by mepmep 20/06/12, 01:11 am

    kaneland

    PixelGetColor(xx, xxx) = 0xaaaa ;รหัสสีเลือด

    xx ,yy

    นี้ต้อง หัวหลอดเลือด หรือปลายหลอดเลือดครับ
    avatar
    Fast
    PSsix Member Super Class III
    PSsix Member Super Class III


    ช่วยดูโค้ดนี้หน่อยครับ Empty PSsix Program Coder
    จำนวนข้อความ : 217
    ความนิยม : 54
    เข้าร่วมเมื่อ : 19/06/2011

    ช่วยดูโค้ดนี้หน่อยครับ Empty Re: ช่วยดูโค้ดนี้หน่อยครับ

    ตั้งหัวข้อ by Fast 20/06/12, 09:20 pm

    พิกัดที่เลือดสุดท้ายก่อนมอนตายนะครับ พอเลือดตรงนั้นหายจะได้ย้ายไปตีตัวใหม่

      เวลาขณะนี้ 19/04/24, 08:55 pm