參考了眾多的文章後
總算讓我找到方法
把按鍵精靈中所有支援的VBS語法
抓出來
以下是按鍵精靈5.50中所有支援的VBS語法
不過怎麻使用就要再研究了= =
function RunApp(AppPath) '這個函數用來運行一個外部程序
dim obj
set obj = createobject("WScript.Shell")
obj.Run(AppPath)
end function
function MessageBox(Prompt) '這個函數用來彈出一個對話框(可以隨時查看你的變量的值)
dim obj
set obj = createobject("WScript.Shell")
call obj.Popup(Prompt,0,"QMacro")
end function
function SayString(Prompt) '這個函數用來輸入文本
dim obj
set obj = createobject("WScript.Shell")
call obj.SendKeys(Prompt)
end function
function InputBox(Prompt) '這個函數用來彈出輸入對話框
dim obj
set obj = createobject("QMDispatch.QMFunction")
dim OutString
OutString = obj.InputBox(Prompt)
InputBox = OutString
end function
function GetCursorPos(ByRef CursorX,ByRef CursorY) '這個函數用來得到鼠標當前位置
dim obj
set obj = createobject("QMDispatch.QMFunction")
CursorPos = obj.GetCursorPos()
CursorY = CursorPos Mod 8192
CursorX = CInt(CursorPos / 8192)
end function
function SetCursorPos(CursorX,CursorY) '這個函數用來設置鼠標當前位置
dim obj
set obj = createobject("QMDispatch.QMFunction")
Call obj.SetCursorPos(CursorX,CursorY)
end function
function GetPixelColor(PosX,PosY) '這個函數得到某個指定點的顏色(用字符串表示)
dim obj
set obj = createobject("QMDispatch.QMFunction")
GetPixelColor = obj.GetPixelColor(PosX,PosY)
end function
function FindColor(iLeft,iTop,iRight,iBOTtom,szColor,ByRef FoundX,ByRef FoundY) '這個函數用來從某個矩形範圍內查找指定的顏色,按從左到右,從上到下的順序查找
dim obj
set obj = createobject("QMDispatch.QMFunction")
FoundPixel = obj.FindColor(iLeft,iTop,iRight,iBottom,szColor,0)
FoundX = CInt(FoundPixel / 8192)
FoundY = FoundPixel Mod 8192
end function
function FindCenterColor(iLeft,iTop,iRight,iBottom,szColor,ByRef FoundX,ByRef FoundY) '這個函數用來從某個矩形範圍內查找指定的顏色,按從中間到四周的順序查找
dim obj
set obj = createobject("QMDispatch.QMFunction")
FoundPixel = obj.FindColor(iLeft,iTop,iRight,iBottom,szColor,1)
FoundX = CInt(FoundPixel / 8192)
FoundY = FoundPixel Mod 8192
end function
function GetScreenResolution(ByRef ScreenX, ByRef ScreenY) '這個函數用於得到當前屏幕分辨率
dim obj
set obj = createobject("QMDispatch.QMFunction")
Resolution = obj.GetScreenResolution()
ScreenX = CInt(Resolution / 8192)
ScreenY = Resolution Mod 8192
end function
function ReadMemory(dwAddress, iType, ByRef ReadValue) '這個函數用於讀取當前進程的內存地址
dim obj
set obj = createobject("QMDispatch.QMFunction")
If iType=0 Then
ReadValue = CByte(obj.ReadMemory(dwAddress, iType))
Else
ReadValue = CLng(obj.ReadMemory(dwAddress, iType))
End If
end function
function FindPic(iLeft,iTop,iRight,iBottom,szFileName,fSimilar,ByRef FoundX,ByRef FoundY)
'這個函數用於在屏幕範圍內查找圖片
dim obj
set obj = createobject("QMDispatch.QMFunction")
FoundPixel = obj.FindPic(iLeft,iTop,iRight,iBottom,szFileName,fSimilar)
FoundX = CInt(FoundPixel / 8192)
FoundY = FoundPixel Mod 8192
end function
function Delay(iMilliSecond) '這個函數可以延時,單位是毫秒,支持表達式
dim obj
set obj = createobject("QMDispatch.QMFunction")
obj.SleepMS(iMilliSecond)
end function
function FindColorEx(iLeft,iTop,iRight,iBottom,szColor,iType,fSimilar,ByRef FoundX,ByRef FoundY) '這個函數用來從某個矩形範圍內模糊查找指定的顏色
dim obj
set obj = createobject("QMDispatch.QMFunction")
FoundPixel = obj.FindColor(iLeft,iTop,iRight,iBottom,szColor,iType,fSimilar)
FoundX = CInt(FoundPixel / 8192)
FoundY = FoundPixel Mod 8192
end function |