ผมเอา code มารวมๆ กันครับ จะทำไปใช้งานแค่มันกด key เองไล่ตามวินาทีวนทำงานไปเรื่อยๆ
เริ่มทำงาน >> กด key A >> 3 วิ แล้วค่อยกด key B >> 5 วิ แล้วค่อยกด key C >> วนไปถึง key J แล้วกลับมา key A
เหมือนมันไม่ไล่ Check ที่ละอันครับ ที่ติกไว้มันกดพร้อมกันเองหมดเลย บ้างครั้งก็ไม่กด งง มากครับ
เริ่มทำงาน >> กด key A >> 3 วิ แล้วค่อยกด key B >> 5 วิ แล้วค่อยกด key C >> วนไปถึง key J แล้วกลับมา key A
เหมือนมันไม่ไล่ Check ที่ละอันครับ ที่ติกไว้มันกดพร้อมกันเองหมดเลย บ้างครั้งก็ไม่กด งง มากครับ
- Code:
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Global $times = TimerInit()
$Form1 = GUICreate("ขอบคุณ Code จาก คุณ POS, Fast, aut และ Hiewsound", 360, 380, 192, 124)
;============================================================Check=
$Checkbox1 = GUICtrlCreateCheckbox("", 5, 9, 15, 17)
$Checkbox2 = GUICtrlCreateCheckbox("", 5, 41, 15, 17)
$Checkbox3 = GUICtrlCreateCheckbox("", 5, 73, 15, 17)
$Checkbox4 = GUICtrlCreateCheckbox("", 5, 105, 15, 17)
$Checkbox5 = GUICtrlCreateCheckbox("", 5, 137, 15, 17)
$Checkbox6 = GUICtrlCreateCheckbox("", 5, 169, 15, 17)
$Checkbox7 = GUICtrlCreateCheckbox("", 5, 201, 15, 17)
$Checkbox8 = GUICtrlCreateCheckbox("", 5, 233, 15, 17)
$Checkbox9 = GUICtrlCreateCheckbox("", 5, 265, 15, 17)
$Checkbox10 = GUICtrlCreateCheckbox("", 5, 297, 15, 17)
;==============================================================KEY=
$Combo1 = GUICtrlCreateCombo("A", 28, 8, 35, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "B|C|D|E|F|G|H|I|J")
$Combo2 = GUICtrlCreateCombo("B", 28, 40, 35, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "A|C|D|E|F|G|H|I|J")
$Combo3 = GUICtrlCreateCombo("C", 28, 72, 35, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "A|B|D|E|F|G|H|I|J")
$Combo4 = GUICtrlCreateCombo("D", 28, 104, 35, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "A|B|C|E|F|G|H|I|J")
$Combo5 = GUICtrlCreateCombo("E", 28, 136, 35, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "A|B|C|D|F|G|H|I|J")
$Combo6 = GUICtrlCreateCombo("F", 28, 168, 35, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "A|B|C|D|E|G|H|I|J")
$Combo7 = GUICtrlCreateCombo("G", 28, 200, 35, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "A|B|C|D|E|F|H|I|J")
$Combo8 = GUICtrlCreateCombo("H", 28, 232, 35, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "A|B|C|D|E|F|G|I|J")
$Combo9 = GUICtrlCreateCombo("I", 28, 264, 35, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "A|B|C|D|E|F|G|H|J")
$Combo10 = GUICtrlCreateCombo("J", 28, 296, 35, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUICtrlSetData(-1, "A|B|C|D|E|F|G|H|I")
;===============================================================Deley=
GUICtrlCreateLabel("Deley Key >", 70, 10, 62, 17)
$Input1 = GUICtrlCreateInput("1", 135, 8, 73, 21)
GUICtrlCreateLabel("Deley Key >", 70, 42, 62, 17)
$Input2 = GUICtrlCreateInput("2", 135, 40, 73, 21)
GUICtrlCreateLabel("Deley Key >", 70, 74, 62, 17)
$Input3 = GUICtrlCreateInput("3", 135, 72, 73, 21)
GUICtrlCreateLabel("Deley Key >", 70, 106, 62, 17)
$Input4 = GUICtrlCreateInput("4", 135, 104, 73, 21)
GUICtrlCreateLabel("Deley Key >", 70, 138, 62, 17)
$Input5 = GUICtrlCreateInput("5", 135, 136, 73, 21)
GUICtrlCreateLabel("Deley Key >", 70, 170, 62, 17)
$Input6 = GUICtrlCreateInput("6", 135, 168, 73, 21)
GUICtrlCreateLabel("Deley Key >", 70, 202, 62, 17)
$Input7 = GUICtrlCreateInput("7", 135, 200, 73, 21)
GUICtrlCreateLabel("Deley Key >", 70, 234, 62, 17)
$Input8 = GUICtrlCreateInput("8", 135, 232, 73, 21)
GUICtrlCreateLabel("Deley Key >", 70, 266, 62, 17)
$Input9 = GUICtrlCreateInput("9", 135, 264, 73, 21)
GUICtrlCreateLabel("Deley Key >", 70, 298, 62, 17)
$Input10 = GUICtrlCreateInput("10", 135, 296, 73, 21)
;===============================================================User=
GUICtrlCreateLabel("สั่งโปรแกรมทำงาน/หยุดทำงาน = ปุ่ม F5", 16, 328, 230, 30)
GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
GUICtrlCreateLabel("ออกจากโปรแกรม = ปุ่ม F6", 16, 350, 150, 30)
GUICtrlSetFont(-1, 10, 400, 0, "Tahoma")
GUISetState(@SW_SHOW)
;===============================================================Command=
Global $Paused
Global $times = TimerInit()
HotKeySet("{F5}", "TogglePause")
HotKeySet("{F6}", "Terminate")
;=================================================================Check=
Sleep(500)
;===============================================================Run&Stop=
TogglePause()
Func TogglePause()
$Paused = NOT $Paused
While $Paused
Sleep(100)
ToolTip(">> หยุดทำงาน >> กด F5 ทำงาน <<",226,39)
WEnd
ToolTip(">> กำลังทำงาน >> กด F6 หยุดทำงาน <<",226,39)
Sleep(100)
EndFunc
Func Terminate()
Exit 0
EndFunc
;=================================================================Run=
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Paused
Global $times = TimerInit()
While Sleep(100)
If GUIGetMsg() = -4 Then Exit
$Diff = Int(TimerDiff($times)/1000)
If Mod($Diff, GUICtrlRead($Input1)/1) = 0 and GUICtrlRead($Checkbox1)=1 Then send ("{"& GUICtrlRead($Combo1 )&"}")
If Mod($Diff, GUICtrlRead($Input2)/1) = 0 and GUICtrlRead($Checkbox2)=1 Then send ("{"& GUICtrlRead($Combo2 )&"}")
If Mod($Diff, GUICtrlRead($Input3)/1) = 0 and GUICtrlRead($Checkbox3)=1 Then send ("{"& GUICtrlRead($Combo3 )&"}")
If Mod($Diff, GUICtrlRead($Input4)/1) = 0 and GUICtrlRead($Checkbox4)=1 Then send ("{"& GUICtrlRead($Combo4 )&"}")
If Mod($Diff, GUICtrlRead($Input5)/1) = 0 and GUICtrlRead($Checkbox5)=1 Then send ("{"& GUICtrlRead($Combo5 )&"}")
If Mod($Diff, GUICtrlRead($Input6)/1) = 0 and GUICtrlRead($Checkbox6)=1 Then send ("{"& GUICtrlRead($Combo6 )&"}")
If Mod($Diff, GUICtrlRead($Input7)/1) = 0 and GUICtrlRead($Checkbox7)=1 Then send ("{"& GUICtrlRead($Combo7 )&"}")
If Mod($Diff, GUICtrlRead($Input8)/1) = 0 and GUICtrlRead($Checkbox8)=1 Then send ("{"& GUICtrlRead($Combo8 )&"}")
If Mod($Diff, GUICtrlRead($Input9)/1) = 0 and GUICtrlRead($Checkbox9)=1 Then send ("{"& GUICtrlRead($Combo9 )&"}")
If Mod($Diff, GUICtrlRead($Input10)/1) = 0 and GUICtrlRead($Checkbox10)=1 Then send ("{"& GUICtrlRead($Combo10 )&"}")
WEnd
EndSwitch
WEnd
;=================================================================End=