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


2 posters

    สอบถามเรื่อง พิกัดxy,สี ช่วยดูให้ทีคับ

    dieip
    dieip
    PSsix Member
    PSsix Member


    สอบถามเรื่อง พิกัดxy,สี ช่วยดูให้ทีคับ Empty สอบถามเรื่อง พิกัดxy,สี ช่วยดูให้ทีคับ Empty
    จำนวนข้อความ : 29
    ความนิยม : 0
    เข้าร่วมเมื่อ : 10/10/2013

    สอบถามเรื่อง พิกัดxy,สี ช่วยดูให้ทีคับ Empty สอบถามเรื่อง พิกัดxy,สี ช่วยดูให้ทีคับ

    ตั้งหัวข้อ by dieip 28/10/13, 01:32 pm

    ที่เขียนอยู่ช่วงบันทัดที่ 155-168
    อยากให้มันเปลี่ยนไปตามเม้าตลอดเวลาต้องทำไงเหรอคับ



    Code:
    $var = DriveGetSerial( "c:\" )

    HotKeySet("{ESC}", "stop")
    Func stop()
    ToolTip('หยุดการทำงาน', 0, 0)
    Sleep(500)
    Exit
    EndFunc

    $avMouse = MouseGetPos()
    $iPixel = PixelGetColor($avMouse[0], $avMouse[1])






    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=c:\users\user\documents\dieip.kxf
    $Dieip = GUICreate("Dieip - โปรแกรมออโต้เมาส์ตามเงือนไข 1.0 BT", 672, 296, 187, 185)
    GUISetBkColor(0xB9D1EA)
    $Group1 = GUICtrlCreateGroup("ป้อนรหัสเพื่อใช้งาน", 8, 16, 137, 73)
    $Label1 = GUICtrlCreateLabel("ไอดี :", 16, 40, 29, 17)
    $Label2 = GUICtrlCreateLabel("รหัส :", 16, 64, 29, 17)
    $ip01 = GUICtrlCreateInput($var, 48, 37, 89, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip02 = GUICtrlCreateInput("", 48, 61, 89, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group2 = GUICtrlCreateGroup("ป้อนเงือนไขต่างๆ", 8, 96, 657, 161)
    $Checkbox1 = GUICtrlCreateCheckbox("เลือก 1", 16, 120, 49, 17)
    $Checkbox2 = GUICtrlCreateCheckbox("เลือก 2", 16, 144, 49, 17)
    $Checkbox3 = GUICtrlCreateCheckbox("เลือก 3", 16, 168, 49, 17)
    $Checkbox4 = GUICtrlCreateCheckbox("เลือก 4", 16, 192, 49, 17)
    $Checkbox5 = GUICtrlCreateCheckbox("เลือก 5", 16, 216, 49, 17)
    $ip06 = GUICtrlCreateInput("", 90, 120, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip07 = GUICtrlCreateInput("", 146, 120, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip13 = GUICtrlCreateInput("", 90, 144, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip14 = GUICtrlCreateInput("", 146, 144, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip20 = GUICtrlCreateInput("", 90, 168, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip21 = GUICtrlCreateInput("", 146, 168, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip27 = GUICtrlCreateInput("", 90, 192, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip28 = GUICtrlCreateInput("", 146, 192, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip34 = GUICtrlCreateInput("", 90, 216, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip35 = GUICtrlCreateInput("", 146, 216, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $Label3 = GUICtrlCreateLabel("X", 80, 123, 11, 17)
    $Label4 = GUICtrlCreateLabel("X", 80, 147, 11, 17)
    $Label5 = GUICtrlCreateLabel("X", 80, 171, 11, 17)
    $Label6 = GUICtrlCreateLabel("X", 80, 195, 11, 17)
    $Label7 = GUICtrlCreateLabel("X", 80, 219, 11, 17)
    $Label9 = GUICtrlCreateLabel("Y", 136, 123, 11, 17)
    $Label10 = GUICtrlCreateLabel("Y", 136, 147, 11, 17)
    $Label11 = GUICtrlCreateLabel("Y", 136, 171, 11, 17)
    $Label12 = GUICtrlCreateLabel("Y", 136, 195, 11, 17)
    $Label13 = GUICtrlCreateLabel("Y", 136, 219, 11, 17)
    $Label15 = GUICtrlCreateLabel("ค่าสี", 192, 123, 22, 17)
    $Label16 = GUICtrlCreateLabel("ค่าสี", 192, 147, 22, 17)
    $Label17 = GUICtrlCreateLabel("ค่าสี", 192, 171, 22, 17)
    $Label18 = GUICtrlCreateLabel("ค่าสี", 192, 195, 22, 17)
    $Label19 = GUICtrlCreateLabel("ค่าสี", 192, 219, 22, 17)
    $ip08 = GUICtrlCreateInput("", 213, 120, 57, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip15 = GUICtrlCreateInput("", 213, 144, 57, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip22 = GUICtrlCreateInput("", 213, 168, 57, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip29 = GUICtrlCreateInput("", 213, 192, 57, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip36 = GUICtrlCreateInput("", 213, 216, 57, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $Combo1 = GUICtrlCreateCombo("คลิก..?", 320, 120, 57, 25)
    GUICtrlSetData(-1, "ซ้าย|ขวา")
    $Combo2 = GUICtrlCreateCombo("คลิก..?", 320, 144, 57, 25)
    GUICtrlSetData(-1, "ซ้าย|ขวา")
    $Combo3 = GUICtrlCreateCombo("คลิก..?", 320, 168, 57, 25)
    GUICtrlSetData(-1, "ซ้าย|ขวา")
    $Combo4 = GUICtrlCreateCombo("คลิก..?", 320, 192, 57, 25)
    GUICtrlSetData(-1, "ซ้าย|ขวา")
    $Combo5 = GUICtrlCreateCombo("คลิก..?", 320, 216, 57, 25)
    GUICtrlSetData(-1, "ซ้าย|ขวา")
    $Group4 = GUICtrlCreateGroup("ถ้าใช่คลิก (x,y)", 392, 104, 128, 145)
    $ip09 = GUICtrlCreateInput("", 400, 120, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip16 = GUICtrlCreateInput("", 400, 144, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip10 = GUICtrlCreateInput("", 440, 120, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip17 = GUICtrlCreateInput("", 440, 144, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip23 = GUICtrlCreateInput("", 400, 168, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip24 = GUICtrlCreateInput("", 440, 168, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip30 = GUICtrlCreateInput("", 400, 192, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip31 = GUICtrlCreateInput("", 440, 192, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip37 = GUICtrlCreateInput("", 400, 216, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip38 = GUICtrlCreateInput("", 440, 216, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $bt05 = GUICtrlCreateButton("เลือก", 480, 120, 33, 25, $WS_GROUP)
    GUICtrlSetCursor (-1, 2)
    $bt08 = GUICtrlCreateButton("เลือก", 480, 144, 33, 25, $WS_GROUP)
    $bt11 = GUICtrlCreateButton("เลือก", 480, 168, 33, 25, $WS_GROUP)
    $bt14 = GUICtrlCreateButton("เลือก", 480, 192, 33, 25, $WS_GROUP)
    $bt17 = GUICtrlCreateButton("เลือก", 480, 216, 33, 25, $WS_GROUP)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $bt04 = GUICtrlCreateButton("เลือก", 280, 120, 33, 25, $WS_GROUP)
    $bt07 = GUICtrlCreateButton("เลือก", 280, 144, 33, 25, $WS_GROUP)
    $bt13 = GUICtrlCreateButton("เลือก", 280, 192, 33, 25, $WS_GROUP)
    $bt10 = GUICtrlCreateButton("เลือก", 280, 168, 33, 25, $WS_GROUP)
    $bt16 = GUICtrlCreateButton("เลือก", 280, 216, 33, 25, $WS_GROUP)
    $Group5 = GUICtrlCreateGroup("ไม่ใช่คลิก (x,y)", 528, 104, 129, 145)
    $ip11 = GUICtrlCreateInput("", 536, 120, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip18 = GUICtrlCreateInput("", 536, 144, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip25 = GUICtrlCreateInput("", 536, 168, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip32 = GUICtrlCreateInput("", 536, 192, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip39 = GUICtrlCreateInput("", 536, 216, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip12 = GUICtrlCreateInput("", 576, 120, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip19 = GUICtrlCreateInput("", 576, 144, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip26 = GUICtrlCreateInput("", 576, 168, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip33 = GUICtrlCreateInput("", 576, 192, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip40 = GUICtrlCreateInput("", 576, 216, 36, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $bt06 = GUICtrlCreateButton("เลือก", 616, 120, 33, 25, $WS_GROUP)
    $bt12 = GUICtrlCreateButton("เลือก", 616, 168, 33, 25, $WS_GROUP)
    $bt09 = GUICtrlCreateButton("เลือก", 616, 144, 33, 25, $WS_GROUP)
    $bt15 = GUICtrlCreateButton("เลือก", 616, 192, 33, 25, $WS_GROUP)
    $bt18 = GUICtrlCreateButton("เลือก", 616, 216, 33, 25, $WS_GROUP)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group3 = GUICtrlCreateGroup("แสดงพิกัดและสี", 152, 16, 129, 73)
    $diec="0x"&Hex($iPixel, 6)
    $ip05 = GUICtrlCreateInput($diec, 182, 64, 93, 21)
    GUICtrlSetBkColor(-1, $diec)
    $ip04 = GUICtrlCreateInput($avMouse[1], 234, 40, 41, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip03 = GUICtrlCreateInput($avMouse[0], 171, 40, 41, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $X = GUICtrlCreateLabel("X", 160, 43, 11, 17)
    $Y = GUICtrlCreateLabel("Y", 224, 43, 11, 17)
    GUICtrlCreateLabel("ค่าสี", 160, 67, 22, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $bt03 = GUICtrlCreateButton("เริ่มการทำงาน!", 528, 24, 129, 65, $WS_GROUP)
    GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
    $Group6 = GUICtrlCreateGroup("บันทึกข้อมูล", 424, 16, 97, 73)
    $bt01 = GUICtrlCreateButton("บันทึกไฟล์", 432, 32, 81, 23, $WS_GROUP)
    GUICtrlSetCursor (-1, 7)
    $bt02 = GUICtrlCreateButton("โหลดไฟล์", 432, 56, 81, 23, $WS_GROUP)
    GUICtrlSetCursor (-1, 7)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Group7 = GUICtrlCreateGroup("รอบและหน่วงเวลา", 288, 16, 129, 73)
    $ip99 = GUICtrlCreateInput("1000", 360, 40, 49, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $ip98 = GUICtrlCreateInput("1", 360, 64, 49, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    $Label8 = GUICtrlCreateLabel("รอบ/ครั้ง", 296, 43, 50, 17)
    $Label14 = GUICtrlCreateLabel("หน่วง/วินาที", 296, 67, 60, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Input1 = GUICtrlCreateInput("ปล. กดปุ่ม ESC เพื่อออกโปรแกรม...", 8, 264, 257, 21)
    GUICtrlSetBkColor(-1, 0xA6CAF0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
          Case $GUI_EVENT_CLOSE

          Case $Dieip
          Case $Dieip
          Case $Dieip
          Case $Dieip
          Case $Label1
          Case $Label2
          Case $ip01
          Case $ip02
          Case $Checkbox1
          Case $Checkbox2
          Case $Checkbox3
          Case $Checkbox4
          Case $Checkbox5
          Case $ip06
          Case $ip07
          Case $ip13
          Case $ip14
          Case $ip20
          Case $ip21
          Case $ip27
          Case $ip28
          Case $ip34
          Case $ip35
          Case $ip08
          Case $ip15
          Case $ip22
          Case $ip29
          Case $ip36
          Case $Combo1
          Case $Combo2
          Case $Combo3
          Case $Combo4
          Case $Combo5
          Case $ip09
          Case $ip16
          Case $ip10
          Case $ip17
          Case $ip23
          Case $ip24
          Case $ip30
          Case $ip31
          Case $ip37
          Case $ip38
          Case $bt05
          Case $bt08
          Case $bt11
          Case $bt14
          Case $bt17
          Case $bt04
             bt01()

          Case $bt07
          Case $bt13
          Case $bt10
          Case $bt16
          Case $ip11
          Case $ip18
          Case $ip25
          Case $ip32
          Case $ip39
          Case $ip12
          Case $ip19
          Case $ip26
          Case $ip33
          Case $ip40
          Case $bt06
          Case $bt12
          Case $bt09
          Case $bt15
          Case $bt18
          Case $ip05
          Case $ip04
          Case $ip03
          Case $bt03
          Case $bt01
          Case $bt02
          Case $ip99
       EndSwitch
    WEnd

    Func pass()
    $var = DriveGetSerial( "c:\" )
    $dieip=($var/12345)
    $dieip2=Round($dieip, 0)
    $dieip3=GUICtrlRead($Input1)
    if $dieip3 = $dieip2 then
       msgbox(64, "Dieip-ออโต้คลิก", "รหัสผ่านถูกต้อง")
    Else
        msgbox(64, "Dieip-ออโต้คลิก", "รหัส Pin ไม่ถูกต้อง")
        Exit
    EndIf
    EndFunc

    Func bt01()
    $bttt01=ControlSend("", "", "", "1")
    Sleep(1010)
       If $bttt01 Then
          $avMousebt01 = MouseGetPos()
          $iPixelbt01 = PixelGetColor($avMouse[0], $avMouse[1])
          $btt01="0x"&Hex($iPixelbt01, 6)
          $bt04 = GUICtrlCreateButton("เลือก", 280, 120, 33, 25, $WS_GROUP)
          $ip06 = GUICtrlCreateInput($avMousebt01[0], 90, 120, 36, 21)
          GUICtrlSetBkColor(-1, 0xA6CAF0)
          $ip07 = GUICtrlCreateInput($avMousebt01[1], 146, 120, 36, 21)
          GUICtrlSetBkColor(-1, 0xA6CAF0)
          $ip08 = GUICtrlCreateInput($btt01, 213, 120, 57, 21)
          GUICtrlSetBkColor(-1, $btt01)
       Else
          Exit
       EndIf
    EndFunc

    POS
    POS
    PSsix
    PSsix


    สอบถามเรื่อง พิกัดxy,สี ช่วยดูให้ทีคับ Empty สอบถามเรื่อง พิกัดxy,สี ช่วยดูให้ทีคับ Empty สอบถามเรื่อง พิกัดxy,สี ช่วยดูให้ทีคับ Empty
    จำนวนข้อความ : 1152
    ความนิยม : 326
    เข้าร่วมเมื่อ : 19/07/2010

    สอบถามเรื่อง พิกัดxy,สี ช่วยดูให้ทีคับ Empty Re: สอบถามเรื่อง พิกัดxy,สี ช่วยดูให้ทีคับ

    ตั้งหัวข้อ by POS 29/10/13, 02:58 am

    ใส่คำสั่ง ด้านล่างนี้ หลังบรรทัด While 1 จากนั้นเวลาจะกำหนดให้เก็บตัวเลือกไหนก็ตั้งฮอตคีย์ให้เซฟลงข้อมูลลงช่องนั้นๆ โดยใช้คำสั่ง GUICtrlSetData(ชื่อตัวแปรของช่อง,ข้อมูลที่จะใส่เข้าไปในช่อง)

    Code:
    Sleep(10)
    $pos = MouseGetPos()
    GUICtrlSetData($ip03,$pos[0] )
    GUICtrlSetData($ip04,$pos[1] )
    GUICtrlSetData($ip05,Hex(PixelGetColor($pos[0],$pos[1]),6))
    dieip
    dieip
    PSsix Member
    PSsix Member


    สอบถามเรื่อง พิกัดxy,สี ช่วยดูให้ทีคับ Empty สอบถามเรื่อง พิกัดxy,สี ช่วยดูให้ทีคับ Empty
    จำนวนข้อความ : 29
    ความนิยม : 0
    เข้าร่วมเมื่อ : 10/10/2013

    สอบถามเรื่อง พิกัดxy,สี ช่วยดูให้ทีคับ Empty Re: สอบถามเรื่อง พิกัดxy,สี ช่วยดูให้ทีคับ

    ตั้งหัวข้อ by dieip 29/10/13, 10:37 am

    ขอบคุณมากครับ ทำได้แล้ว ได้คำสั่งใช้งานเพิ่มอีก 1
    GUICtrlSetData ^^ พอลองพิมGUICtrlSe ก็จะได้เพิ่มสีตัวอักษร และแบ๊กกราว ขอบคุณจิงๆครับ

    Code:
    Sleep(10)
    $pos = MouseGetPos()
    GUICtrlSetData($ip03,$pos[0] )
    GUICtrlSetData($ip04,$pos[1] )
    GUICtrlSetData($ip05,"0x"&Hex(PixelGetColor($pos[0],$pos[1]),6))
    $diec="0x"&Hex(PixelGetColor($pos[0],$pos[1]),6)
    GUICtrlSetBkColor($ip05,$diec)

      เวลาขณะนี้ 07/05/24, 12:58 pm