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


4 posters

    AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที

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


    AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที Empty AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที Empty
    จำนวนข้อความ : 1
    ความนิยม : 0
    เข้าร่วมเมื่อ : 10/05/2014

    AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที Empty AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที

    ตั้งหัวข้อ by kensurakit9 10/05/14, 08:26 pm

    เราจะทำค่าใน Input1 ไปใส่ใน Sleep ได้ยังไงครับ ลองหลายรอบแล้วไม่ได้ซักที รบกวนหน่อยครับ

    $Input1 = GUICtrlCreateInput("2000", 10, 65, 50, 20)

    ControlClick ($GameHD, "", "","left",1,709,597)
    Sleep($Input1)

     em229 
    tomakung
    tomakung
    PSsix Member Class II
    PSsix Member Class II


    AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที Empty AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที Empty
    จำนวนข้อความ : 38
    ความนิยม : 11
    เข้าร่วมเมื่อ : 24/02/2012

    AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที Empty Re: AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที

    ตั้งหัวข้อ by tomakung 14/05/14, 04:27 am

    Code:
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("TEST", 200, 100, -1, -1)
    $Label1 = GUICtrlCreateLabel("Time 1 = 1 sec", 20, 10, 100, 17)
    $Button1 = GUICtrlCreateButton("Send", 100, 30, 60, 21)
     $Time = GUICtrlCreateInput("1", 20, 32, 50, 20)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
          Case $GUI_EVENT_CLOSE
             Exit
          Case $Button1
             timeout()
       EndSwitch
    WEnd
    func timeout()
       GUIDelete($Form1)
       ToolTip("Test time run",0,0)
    Sleep($Time*1000)
       exit
    EndFunc
    Arm
    Arm
    PSsix Member Super Class III
    PSsix Member Super Class III


    PSsix Master PSsix Program Coder
    จำนวนข้อความ : 268
    ความนิยม : 54
    เข้าร่วมเมื่อ : 31/03/2011
    อายุ : 26

    AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที Empty Re: AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที

    ตั้งหัวข้อ by Arm 14/05/14, 09:15 am

    GUICtrlRead(ตัวแปรของ Input) ครับ
    Code:
    $Input1 = GUICtrlCreateInput("2000", 10, 65, 50, 20)
    ControlClick($GameHD, "", "","left",1,709,597)
    Sleep(GUICtrlRead($Input1))
     em219 

    tomakung พิมพ์ว่า:
    Code:
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("TEST", 200, 100, -1, -1)
    $Label1 = GUICtrlCreateLabel("Time 1 = 1 sec", 20, 10, 100, 17)
    $Button1 = GUICtrlCreateButton("Send", 100, 30, 60, 21)
     $Time = GUICtrlCreateInput("1", 20, 32, 50, 20)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
     $nMsg = GUIGetMsg()
     Switch $nMsg
     Case $GUI_EVENT_CLOSE
     Exit
     Case $Button1
     timeout()
     EndSwitch
    WEnd
    func timeout()
     GUIDelete($Form1)
     ToolTip("Test time run",0,0)
    Sleep($Time*1000)
     exit
    EndFunc

    โค้ดของคุณ tomakung มันไม่ sleep นะครับเพราะ
    1. ใส่ GUIDelete($Form1) ไว้พอมันลบ GUI ทิ้งมันก็ออกจากลูปเลย
    2. จะอ่านค่าจากคอนโทรลใดๆก็ตามต้องใช้ GUICtrlRead ครับ แก้เป็น Sleep(GUICtrlRead($Time)*1000)
     em230 
    tomakung
    tomakung
    PSsix Member Class II
    PSsix Member Class II


    AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที Empty AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที Empty
    จำนวนข้อความ : 38
    ความนิยม : 11
    เข้าร่วมเมื่อ : 24/02/2012

    AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที Empty Re: AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที

    ตั้งหัวข้อ by tomakung 14/05/14, 06:15 pm

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


    AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที Empty AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที Empty
    จำนวนข้อความ : 5
    ความนิยม : 0
    เข้าร่วมเมื่อ : 12/10/2012

    AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที Empty Re: AutoIt มือใหม่หัดเขียนรับกวนผู้รู้ ตอบที

    ตั้งหัวข้อ by kensurakit 07/07/14, 10:17 am

    ขอบคุณครับ em218 

      เวลาขณะนี้ 28/03/24, 10:47 pm