版上的各位高手你們好
小弟我前些日子因緣際會認知到AHK的妙用
能以極小的資源,達到驚人的效果
所以我入門自學了,用SciTE4寫
而今日卡在抓色的問題,故到此請求指證
實在想不透,懇請指點,感激不盡
腳本如下
================================
#MaxThreadsPerHotkey 3
^D::
#MaxThreadsPerHotkey 1
if KeepWinZRunning
{
KeepWinZRunning := false
return
}
KeepWinZRunning := true
Loop
{
PixelGetColor,HP, 161,37
PixelGetColor,MP, 163,48
if (HP= "181818")
{
Send {R Down}
Sleep 30
send {R Up}
Sleep 130
}
else if (MP = "181818")
{
Send {T Down}
Sleep 30
send {T Up}
Sleep 130
}
if not KeepWinZRunning
break
}
KeepWinZRunning := false
return
=================================
我的理論是偵測到HP或MP的點變成灰色,色碼為181818
就按下R鍵恢復血量,或T鍵補充魔力
啟動熱鍵則為ctrl+D