close
來源:http://www.nisan.us/modules/newbb/viewtopic.php?topic_id=10000

; AutoIt Version: 3.0
; Language: English
; Platform: Win9x/NT
; autoDanB66 ~~日上發發發-浮雲~~ 有問題請聯絡aircop001@gmail.com, http://www.nisan.us , 或至討論區討論
; autoDanB673 ~~日上發發發~KCA~~ 此版本新增 HTS 斷線重連機制
;若要解除請按 Ctrl-Alt-Del 解除按鍵鎖住,並 del AutoIt.exe 處理程緒

;; config setup
$YOUR_HTS_PASSWORD = "your_hts_password" ;; 字串內 your_hts_password 請改成您 HTS 的密碼
$HTS_PATH = "C:\JihSun\HTS2\JSCOM.EXE" ;;記得把快易點的路徑檔名修改
;;$HTS_PATH = "C:\Program Files\日盛HTS快易點 2.0\JSCOM.EXE"
$dan_PATH = "C:\danB\danB.exe" ;;記得把下單機的路徑和檔名修改一下,注意大小寫有區分
$dan_name = "danB.exe"
$dan_WIN = "日上發發發下單機 Beta 0.71" ;;下單機版本也要修改哦!

AutoItSetOption("TrayAutoPause",0)
AutoItSetOption("TrayIconHide",0)

If ProcessExists("JSCOM.EXE") Then
ProcessClose("JSCOM.EXE")
ProcessClose("JSHTSMain.exe")
Sleep(3000)
EndIf

BlockInput(1) ;;鎖定鼠標和鍵盤! 取消按鍵 Ctrl+Alt+Del
Run($HTS_PATH)
Sleep(5000)
WinActivate("Connetor", "")
ControlSend( "Connetor", "", "[CLASS:TEdit; INSTANCE:1]", $YOUR_HTS_PASSWORD) ;;快易點的登入密碼
ControlSend( "Connetor", "", "[CLASS:TEdit; INSTANCE:1]", "{Enter}")
BlockInput(0) ;;釋放鼠標和鍵盤! 取消按鍵 Ctrl+Alt+Del

Sleep(100000) ;;如果系統交易資料的筆數多的話,建議暫停久一點,

If ProcessExists($dan_name) Then
ProcessClose($dan_name)
Sleep(2000)
EndIf

Sleep(5000)

BlockInput (1) ;;鎖定鼠標和鍵盤! 取消按鍵 Ctrl+Alt+Del
Run($dan_PATH)
Sleep(20000)
WinActivate($dan_WIN, "")
Sleep(5000)
BlockInput (0) ;;釋放鼠標和鍵盤! 取消按鍵 Ctrl+Alt+Del

;;HTS斷線重連
For $yy = 1 to 160
;;BlockInput (1) ;;鎖定鼠標和鍵盤! 取消按鍵 Ctrl+Alt+Del
IF not WinExists("JIHSUN HTS", "") then
IF ProcessExists("JSCOM.EXE") Then
ProcessClose("JSCOM.EXE")
ProcessClose("JSHTSMain.exe")
Sleep(3000)
EndIf
EndIf
Sleep(3000)

If WinExists("Information", "") Then
WinActivate("Information", "")
ControlClick("Information", "","[Class:TButton; Instance:1; ClassnameNN:TButton1]", "left")

Sleep(10000)
IF ProcessExists("JSCOM.EXE") Then
ProcessClose("JSCOM.EXE")
ProcessClose("JSHTSMain.exe")
Sleep(3000)
EndIf
EndIf
Sleep(3000)

IF not ProcessExists("JSCOM.EXE") Then
Run($HTS_PATH)
Sleep(5000)
WinActivate("Connetor", "")
ControlSend( "Connetor", "", "[CLASS:TEdit; INSTANCE:1]", $YOUR_HTS_PASSWORD) ;;快易點的登入密碼
ControlSend( "Connetor", "", "[CLASS:TEdit; INSTANCE:1]", "{Enter}")
Sleep(30000)
EndIf
Sleep(3000)
sleep(120000)
;;BlockInput (0) ;;鎖定鼠標和鍵盤! 取消按鍵 Ctrl+Alt+Del
Next
Sleep(3000)

; Finished!
arrow
arrow
    全站熱搜
    創作者介紹
    創作者 curtischang 的頭像
    curtischang

    大掌櫃的帳本

    curtischang 發表在 痞客邦 留言(0) 人氣()