- 註冊時間
- 2002-9-18
- 線上時間
- 1563 小時
- 閱讀權限
- 200
- 積分
- 1050
- 主題
- 151
- 精華
- 1
- 文章
- 921
該用戶從未簽到 - 文章
- 921
|
先貼一下 PHONE ON/OFF scripts: (現在無法用附檔的方式貼文,抱歉),要先安裝 Mortscript(http://www.sto-helit.de/index.ph ... on=view&menu=29)
安裝好 Mortscript 之後 .mscr 會自動關聯到 Mortscript 即可執行。
例如用檔案管理員直接開啟 PhoneOn.mscr 就會開啟電話功能,反之開啟 PhoneOff.mscr 就會關閉電話。
若狀態已經是On或Off,則發出訊息(等五秒鐘,訊息自動close)不動作。
放進 STK 的My Schedule,只要機器不 Lock,都是 OK 的。。
====#PhoneOn.mscr=====
Platform = MortScriptType()
AppDir = "\Windows"
App = "wrlsmgr.exe"
AppWindowName = "無線裝置管理員"
ThisScriptPath = SystemPath("ScriptPath")
ThisScriptName = SystemPath("ScriptName") & SystemPath("ScriptExt")
LastScriptCommand = ThisScriptPath &"\" & "Again.mscr"
Call SaveLastCommand
Call ReadPhoneStatus
If (PhoneState = 16)
SleepMessage (5, "Phone is already ON... script will abort.", ThisScriptName, 1)
Exit
EndIf
Run (AppDir \ App)
WaitForActive( AppWindowName, 10 )
MouseClick( AppWindowName, 180,180 )
Sleep (3000)
Close (AppWindowName)
Sub CheckPlatform
If (Platform eq "PC")
Message ("This App was created for PPC... script will abort.", ThisScriptName)
Exit
EndIf
EndSub
Sub ReadPhoneStatus
PhoneState = RegRead("HKLM", "System\State\Phone", "Cellular System Available")
EndSub
Sub SaveLastCommand
WriteLine = "CallScript (""" &ThisScriptPath &"\" &ThisScriptName & """)"
WriteFile (LastScriptCommand, WriteLine)
EndSub
Sub AbortScript
KillScript (ThisScriptName)
EndSub
=======
==== # PhoneOff.mscr =============
Platform = MortScriptType()
AppDir = "\Windows"
App = "wrlsmgr.exe"
AppWindowName = "無線裝置管理員"
ThisScriptPath = SystemPath("ScriptPath")
ThisScriptName = SystemPath("ScriptName") & SystemPath("ScriptExt")
LastScriptCommand = ThisScriptPath &"\" & "Again.mscr"
Call SaveLastCommand
Call ReadPhoneStatus
If (PhoneState = 0)
SleepMessage (5, "Phone is already OFF... script will abort.", ThisScriptName, 1)
Exit
EndIf
Run (AppDir \ App)
WaitForActive( AppWindowName, 10 )
MouseClick( AppWindowName, 180,50 )
Sleep (3000)
Close (AppWindowName)
Sub CheckPlatform
If (Platform eq "PC")
Message ("This App was created for PPC... script will abort.", ThisScriptName)
Exit
EndIf
EndSub
Sub ReadPhoneStatus
PhoneState = RegRead("HKLM", "System\State\Phone", "Cellular System Available")
EndSub
Sub SaveLastCommand
WriteLine = "CallScript (""" &ThisScriptPath &"\" &ThisScriptName & """)"
WriteFile (LastScriptCommand, WriteLine)
EndSub
Sub AbortScript
KillScript (ThisScriptName)
EndSub
===================== |
|