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

    ช่วยเขียนคำสั่งทีครับ

    avatar
    wutkarbpom
    PSsix Member
    PSsix Member


    ช่วยเขียนคำสั่งทีครับ Empty ช่วยเขียนคำสั่งทีครับ Empty
    จำนวนข้อความ : 26
    ความนิยม : 0
    เข้าร่วมเมื่อ : 24/07/2011

    ช่วยเขียนคำสั่งทีครับ Empty ช่วยเขียนคำสั่งทีครับ

    ตั้งหัวข้อ by wutkarbpom 17/08/11, 10:00 am

    คือเวลาต่อเน็ตจะมีหน้าต่าง("Winamp Installer","Install Nitro PDF Reader") ขึ้นมา ถ้าไม่ต่อเน็ตก็จะไม่มีหน้าต่างขึ้นมา ผมควรทำยังไงดีครับ
    1.
    WinWait("Winamp Installer","Get the Most Out of Winamp")
    ControlSend("Winamp Installer","Get the Most Out of Winamp","[CLASS:Button; INSTANCE:4]" ,"{SPACE}")
    ControlSend("Winamp Installer","Get the Most Out of Winamp","[CLASS:Button; INSTANCE:5]" ,"{SPACE}")
    ControlSend("Winamp Installer","Get the Most Out of Winamp","[CLASS:Button; INSTANCE:6]" ,"{SPACE}")
    ControlSend("Winamp Installer","Get the Most Out of Winamp","[CLASS:Button; INSTANCE:2]" ,"{SPACE}")
    2.
    WinWait("Winamp Installer","Install Nitro PDF Reader")
    Send("{TAB}{TAB}{DOWN}")
    ControlSend("Winamp Installer","Install Nitro PDF Reader","[CLASS:Button; INSTANCE:2]" ,"{SPACE}")
    3.
    WinWait("Winamp Installer","Installation Complete")
    ControlSend("Winamp Installer","Installation Complete","[CLASS:Button; INSTANCE:4]" ,"{SPACE}")
    ControlSend("Winamp Installer","Installation Complete","[CLASS:Button; INSTANCE:2]" ,"{SPACE}")

    em228
    avatar
    wutkarbpom
    PSsix Member
    PSsix Member


    ช่วยเขียนคำสั่งทีครับ Empty ช่วยเขียนคำสั่งทีครับ Empty
    จำนวนข้อความ : 26
    ความนิยม : 0
    เข้าร่วมเมื่อ : 24/07/2011

    ช่วยเขียนคำสั่งทีครับ Empty Re: ช่วยเขียนคำสั่งทีครับ

    ตั้งหัวข้อ by wutkarbpom 17/08/11, 01:11 pm

    ตอนนี้ผมกำลังลองคำสั่ง if else แต่ยังทำให้เลือก title ที่เราต้องการไม่ได้

    If WinGetHandle("Winamp Installer","Install Nitro PDF Reader") Then
    Send("{TAB}{TAB}{DOWN}")
    ControlSend("Winamp Installer","Install Nitro PDF Reader","[CLASS:Button; INSTANCE:2]" ,"{SPACE}")
    ElseIf WinGetHandle("Winamp Installer","Installation Complete") Then
    ControlSend("Winamp Installer","Installation Complete","[CLASS:Button; INSTANCE:4]" ,"{SPACE}")
    ControlSend("Winamp Installer","Installation Complete","[CLASS:Button; INSTANCE:2]" ,"{SPACE}")
    EndIf
    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 17/08/11, 04:51 pm

    เออ...หาหน้าต่างลองใช้คำสั่ง

    If WinExists("Winamp Installer") Then
    Send("{TAB}{TAB}{DOWN}")
    endif
    avatar
    wutkarbpom
    PSsix Member
    PSsix Member


    ช่วยเขียนคำสั่งทีครับ Empty ช่วยเขียนคำสั่งทีครับ Empty
    จำนวนข้อความ : 26
    ความนิยม : 0
    เข้าร่วมเมื่อ : 24/07/2011

    ช่วยเขียนคำสั่งทีครับ Empty Re: ช่วยเขียนคำสั่งทีครับ

    ตั้งหัวข้อ by wutkarbpom 19/08/11, 04:01 pm

    คือผมจะให้มันเลือกระหว่างคำสั่งที่ 2และ3 ถ้าเจอคำสั่งที่ 2 ก็จะทำคำสั่งที่ 2 และตามด้วยคำสั่งที่3
    ถ้าไม่เจอคำสั่งที่2 ก็ให้ทำเฉพาะคำสั่งที่ 3
    aut
    aut
    PSsix Powerful Scripting Class
    PSsix Powerful Scripting Class


    PSsix Game Coder
    จำนวนข้อความ : 472
    ความนิยม : 126
    เข้าร่วมเมื่อ : 24/07/2010

    ช่วยเขียนคำสั่งทีครับ Empty Re: ช่วยเขียนคำสั่งทีครับ

    ตั้งหัวข้อ by aut 19/08/11, 07:11 pm

    ถามรัยนายเอาคำสังมาด้วยดิจาใส่ifหลายอันก้อได้นะเปี่ยนxxxxเป็นWinExists("Winamp Installer")ก้อได้


    if xxxxx Then
    ;ยัดคำสั่ง 1
    ElseIf xxxxx Then
    ;ยัดคำสั่ง 2
    ElseIf xxxx Then
    ;ยัดคำสั่ง 3
    EndIf
    POS
    POS
    PSsix
    PSsix


    ช่วยเขียนคำสั่งทีครับ Empty ช่วยเขียนคำสั่งทีครับ Empty ช่วยเขียนคำสั่งทีครับ Empty
    จำนวนข้อความ : 1152
    ความนิยม : 326
    เข้าร่วมเมื่อ : 19/07/2010

    ช่วยเขียนคำสั่งทีครับ Empty Re: ช่วยเขียนคำสั่งทีครับ

    ตั้งหัวข้อ by POS 19/08/11, 08:11 pm

    ผมเสริมให้อีกนิด คุณสามารถใช้ if ซ้อนในตัวคำสั่ง if ได้ครับ ช่วยในการแตกแขนงการทำงานของคำสั่ง ตัวอย่างเช่นสคริปต์ด้านล่างนี้

    ลองเปลี่ยนค่าตัวแปร $a และ $b เป็นเลขอื่นดูครับจะได้เข้าใจยิ่งขึ้น


    Code:
    $a =1
    $b=2

    if $a =1 Then
       MsgBox(0,"a","เท่ากับ   1")
       if $b=2 then
          MsgBox(0,"b","เท่ากับ2")
          Else
          MsgBox(0,"b","ไม่เท่ากับ2")
          EndIf
    Else
       MsgBox(0,"a","ไม่เท่ากับ1")
       EndIf
    avatar
    wutkarbpom
    PSsix Member
    PSsix Member


    ช่วยเขียนคำสั่งทีครับ Empty ช่วยเขียนคำสั่งทีครับ Empty
    จำนวนข้อความ : 26
    ความนิยม : 0
    เข้าร่วมเมื่อ : 24/07/2011

    ช่วยเขียนคำสั่งทีครับ Empty Re: ช่วยเขียนคำสั่งทีครับ

    ตั้งหัวข้อ by wutkarbpom 19/08/11, 08:29 pm

    aut พิมพ์ว่า:ถามรัยนายเอาคำสังมาด้วยดิจาใส่ifหลายอันก้อได้นะเปี่ยนxxxxเป็นWinExists("Winamp Installer")ก้อได้


    if xxxxx Then
    ;ยัดคำสั่ง 1
    ElseIf xxxxx Then
    ;ยัดคำสั่ง 2
    ElseIf xxxx Then
    ;ยัดคำสั่ง 3
    EndIf
    ผมลองแล้วครับ
    If WinExists("Winamp Installer","Install Nitro PDF Reader") Then
    Sleep(1000)
    Send("{TAB}{TAB}{DOWN}")
    ControlSend("Winamp Installer","Install Nitro PDF Reader","[CLASS:Button; INSTANCE:2]" ,"{SPACE}")
    ElseIf WinExists("Winamp Installer","Installation Complete") Then
    ControlSend("Winamp Installer","Installation Complete","[CLASS:Button; INSTANCE:4]" ,"{SPACE}")
    ControlSend("Winamp Installer","Installation Complete","[CLASS:Button; INSTANCE:2]" ,"{SPACE}")
    EndIf

    ไม่เวิร์คครับ
    POS
    POS
    PSsix
    PSsix


    ช่วยเขียนคำสั่งทีครับ Empty ช่วยเขียนคำสั่งทีครับ Empty ช่วยเขียนคำสั่งทีครับ Empty
    จำนวนข้อความ : 1152
    ความนิยม : 326
    เข้าร่วมเมื่อ : 19/07/2010

    ช่วยเขียนคำสั่งทีครับ Empty Re: ช่วยเขียนคำสั่งทีครับ

    ตั้งหัวข้อ by POS 20/08/11, 08:16 am

    ทำคำสั่งแบบนี้หน้าไม่เปิดหน้าต่างที่มีข้อความ Winamp Installer คำสั่งก็จะไม่ทำงานครับ ต้องใส่ลูป While ให้ทำงานตลอดเวลา (ในกรณีที่เขียนคำสั่งเพื่อดักจับหน้าต่างดังกล่าว)

      เวลาขณะนี้ 17/05/24, 09:08 am