ฟอรั่ม 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

    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button

    avatar
    tanaboodee
    มือใหม่เพิ่งสมัคร
    มือใหม่เพิ่งสมัคร


    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty
    จำนวนข้อความ : 9
    ความนิยม : 0
    เข้าร่วมเมื่อ : 01/12/2013

    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button

    ตั้งหัวข้อ by tanaboodee 02/12/13, 06:54 pm

    คือตอนนี้ผมเขียนให้เมื่อกด Checkbox1 โปรแกรมจะกด F10 กับ 2 ผมอยากให้
    1. ให้เลือก Checkbox ก่อนแล้วกด Button1 โปรแกรมถึงเริ่มทำงาน
    2. อยากจะไห้โปรแกรมหยุดการทำงานโดยกด Button2
    มือใหม่จริง ๆ ครับอยากรู้การทำงานของ Checkbox กับ Button

    Thank you เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button 2432060446 

    Code:
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=c:\users\administrator\desktop\koda_1.7.3.0\forms\test1.kxf
    $Form1 = GUICreate("Test1", 320, 145, 192, 124)
    $Checkbox1 = GUICtrlCreateCheckbox("BUFF Hp", 24, 40, 129, 25)
    $Checkbox2 = GUICtrlCreateCheckbox("กดยา Auto", 24, 72, 81, 25)
    $Button1 = GUICtrlCreateButton("Start", 160, 32, 129, 33)
    $Button2 = GUICtrlCreateButton("Stop", 160, 80, 129, 33)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    Global $GameHD

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

    If _PSsixLoadH("Mu") Then WinActivate($GameHD)
    While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
          Case $GUI_EVENT_CLOSE
             Exit
          Case $Checkbox1
             While 1
        ControlSend($GameHD, "", "", "{F10}")
        Sleep(1000)
        ControlSend($GameHD, "", "", "2")
        Sleep(1000)
      
        WEnd

       EndSwitch
    WEnd
    dieip
    dieip
    PSsix Member
    PSsix Member


    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty
    จำนวนข้อความ : 29
    ความนิยม : 0
    เข้าร่วมเมื่อ : 10/10/2013

    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty Re: เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button

    ตั้งหัวข้อ by dieip 03/12/13, 12:16 pm

    $bit01=BitAND(GUICtrlRead($Checkbox1),$GUI_CHECKED)
    if $bit01 then
    ก็จะให้ทำไรก็แทนไป ข้างบนเป็นเกี่ยวกะ Checkbox
    avatar
    tanaboodee
    มือใหม่เพิ่งสมัคร
    มือใหม่เพิ่งสมัคร


    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty
    จำนวนข้อความ : 9
    ความนิยม : 0
    เข้าร่วมเมื่อ : 01/12/2013

    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty Re: เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button

    ตั้งหัวข้อ by tanaboodee 03/12/13, 06:27 pm

    อธิบายการทำงานได้ไหมครับ อยากรู้แบบลึก ๆ
    dieip
    dieip
    PSsix Member
    PSsix Member


    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty
    จำนวนข้อความ : 29
    ความนิยม : 0
    เข้าร่วมเมื่อ : 10/10/2013

    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty Re: เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button

    ตั้งหัวข้อ by dieip 04/12/13, 12:10 pm

    $bit01=BitAND(GUICtrlRead($Checkbox1),$GUI_CHECKED) ///อ่านค่าเช็คถูกของ$Checkbox1แล้วเก็บไว้ในตัวแปล $bit01

    if $bit01 then ////ถ้า $Checkbox1 มีการเช็คถูก จริง

    "ใส่สูตรอะไรก็ได้ของนายที่อยากให้ทำ"
    "ใส่สูตรอะไรก็ได้ของนายที่อยากให้ทำ"
    dieip
    dieip
    PSsix Member
    PSsix Member


    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty
    จำนวนข้อความ : 29
    ความนิยม : 0
    เข้าร่วมเมื่อ : 10/10/2013

    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty Re: เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button

    ตั้งหัวข้อ by dieip 04/12/13, 12:11 pm

    ไม่ก็ลองดูนะคนอื่นอาจมีวิธีที่ดีกว่าเรา เราก็มั่วไปมา เหมือนกันจนมันได้ (เราใช้สูตรเปลือง คนอื่นอาจทำจบใน 10 บันทัด แต่เรา อาจจะจบที่ 20-30) แต่ไม่เปงไรขอให้มันเป็นการเริ่มต้น!
    avatar
    tanaboodee
    มือใหม่เพิ่งสมัคร
    มือใหม่เพิ่งสมัคร


    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty
    จำนวนข้อความ : 9
    ความนิยม : 0
    เข้าร่วมเมื่อ : 01/12/2013

    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty Re: เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button

    ตั้งหัวข้อ by tanaboodee 04/12/13, 09:25 pm

    ขอบคณครับ เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button 2432060446 เข้าใจเยอะขึ้นแล้ว
    avatar
    tanaboodee
    มือใหม่เพิ่งสมัคร
    มือใหม่เพิ่งสมัคร


    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty
    จำนวนข้อความ : 9
    ความนิยม : 0
    เข้าร่วมเมื่อ : 01/12/2013

    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty Re: เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button

    ตั้งหัวข้อ by tanaboodee 06/12/13, 07:09 pm

    ลองทำดูแล้วโปรแกรมไม่ทำงานครับ
    dieip
    dieip
    PSsix Member
    PSsix Member


    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty
    จำนวนข้อความ : 29
    ความนิยม : 0
    เข้าร่วมเมื่อ : 10/10/2013

    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty Re: เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button

    ตั้งหัวข้อ by dieip 06/12/13, 07:19 pm

    ผมขอดูโคดทีนะคับ
    avatar
    tanaboodee
    มือใหม่เพิ่งสมัคร
    มือใหม่เพิ่งสมัคร


    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty
    จำนวนข้อความ : 9
    ความนิยม : 0
    เข้าร่วมเมื่อ : 01/12/2013

    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty Re: เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button

    ตั้งหัวข้อ by tanaboodee 06/12/13, 08:07 pm

    Code:
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=C:\Users\Administrator\Desktop\koda_1.7.3.0\Forms\Asurabot.kxf
    $Form1 = GUICreate("Asura bot", 172, 160, 192, 124)
    $Checkbox1 = GUICtrlCreateCheckbox("ค้นหามอสเตอร์", 16, 16, 137, 25)
    $Checkbox2 = GUICtrlCreateCheckbox("บัพเลือด บัพเวท", 16, 48, 153, 25)
    $Checkbox3 = GUICtrlCreateCheckbox("กดสกิว สำหรับพระ", 16, 80, 137, 25)
    $Button1 = GUICtrlCreateButton("เริ่ม/หยุด", 16, 112, 105, 25)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    Global $GameHD

    Func _PSsixLoadH($gtitle)
    $GameHD = WinGetHandle($gtitle) ;
    If @error Then
    MsgBox(4096, "Error", "ไม่ได้เชื่อมต่อ")
    Else
    Return 1
    EndIf
    EndFunc

    If _PSsixLoadH("xxxx") Then WinActivate($GameHD)

    While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
          Case $GUI_EVENT_CLOSE
             Exit
          Case $Checkbox1
          Case $Checkbox2
          Case $Checkbox3
                
       $bit01=BitAND(GUICtrlRead($Checkbox1),$GUI_CHECKED)
    if $bit01 then
    While 1
    $coord = PixelSearch(301,224,1066,562,0x08416B)
    If Not @error Then
    MouseClick("",$coord[0] ,$coord[1],1,0)
    EndIf
        Sleep(100)
    WEnd
    EndIf
       
             EndSwitch
          WEnd
          


       



    ผมใส่ตรงไหนผิดหลอครับ เพราะผมใช่ If สองตัวเลย
    dieip
    dieip
    PSsix Member
    PSsix Member


    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty
    จำนวนข้อความ : 29
    ความนิยม : 0
    เข้าร่วมเมื่อ : 10/10/2013

    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty Re: เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button

    ตั้งหัวข้อ by dieip 06/12/13, 08:50 pm

    เอาเข้าหลัง while 1 สิ
    avatar
    tanaboodee
    มือใหม่เพิ่งสมัคร
    มือใหม่เพิ่งสมัคร


    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty
    จำนวนข้อความ : 9
    ความนิยม : 0
    เข้าร่วมเมื่อ : 01/12/2013

    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty Re: เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button

    ตั้งหัวข้อ by tanaboodee 06/12/13, 09:28 pm

    ก็ยังไม่ได้อยู่ดีครับ พอเลือก Checkbox1 โปรแกรมก็ไม่ทำงาน
    avatar
    tanaboodee
    มือใหม่เพิ่งสมัคร
    มือใหม่เพิ่งสมัคร


    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty
    จำนวนข้อความ : 9
    ความนิยม : 0
    เข้าร่วมเมื่อ : 01/12/2013

    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty Re: เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button

    ตั้งหัวข้อ by tanaboodee 06/12/13, 09:50 pm

    หมายถึง While $bit01=BitAND(GUICtrlRead($Checkbox1),$GUI_CHECKED)
    if $bit01 then

    ใช่ไหมครับ
    avatar
    Gdolive
    PSsix Member
    PSsix Member


    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty
    จำนวนข้อความ : 28
    ความนิยม : 0
    เข้าร่วมเมื่อ : 10/02/2012

    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty Re: เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button

    ตั้งหัวข้อ by Gdolive 10/12/13, 11:36 am

    ผมทำประมานนี้

    Code:
    #include <ButtonConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 299, 146, 192, 124)
    $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 48, 32, 97, 17)
    $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 48, 62, 97, 17)
    $Label1 = GUICtrlCreateLabel("Label1", 48, 104, 219, 17)
    $Label2 = GUICtrlCreateLabel("Label2", 48, 124, 229, 17)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
          Case $GUI_EVENT_CLOSE
             Exit
          Case $Form1
          Case $Checkbox1
          Case $Checkbox2
          Case $Label1
       EndSwitch

       if BitAND(GUICtrlRead($Checkbox1),$GUI_CHECKED) Then
          GUICtrlSetData($Label1,"1 เช็คบ็อก")
       Else
          GUICtrlSetData($Label1,"1 ไม่เช็คบ็อก")
       EndIf

       if BitAND(GUICtrlRead($Checkbox2),$GUI_CHECKED) Then
          GUICtrlSetData($Label2,"2 เช็คบ็อก")
       Else
          GUICtrlSetData($Label2,"2 ไม่เช็คบ็อก")
       EndIf
       Sleep(100)

    WEnd
    dieip
    dieip
    PSsix Member
    PSsix Member


    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty
    จำนวนข้อความ : 29
    ความนิยม : 0
    เข้าร่วมเมื่อ : 10/10/2013

    เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button Empty Re: เกี่ยวกับการเขียนคำสั่ง Checkbox กับ Button

    ตั้งหัวข้อ by dieip 10/12/13, 11:39 am

    ก็ได้แล้วนี่ครับ ^^ ดีใจด้วยที่เหลือก็ดัดแปลงเอาเน้อออ

      เวลาขณะนี้ 28/04/24, 09:40 pm