小弟不才,學生時三角函數沒學好...
剛剛研究了一下 定點打怪教學 或 圈形漸開找怪示例。(進階教學)
想要展開大約30步的距離移動.. 有高手可以幫忙加入腳本中嗎
這是我想要加入陽春版的腳本,可是真的看不懂-.-!
(有詳細教學更好,例如改哪邊改哪邊,可以給更多人學到)
一、星型
# 在此定義總體變數
function main
# 在此添加由嚮導創建或錄製的代碼
pi = 4 * Atn(1)
MouseMove(500,300 )
Wait(200)
GetMouseID(InitCursorID)
found = false
do
for dist = 0 to 300 step 30
steps = Int(2 * pi * dist / 30)
dAngle = 2 * pi / (steps + 1)
angle = 0
for i = 0 to steps
dx = dist * cos(angle)*cos(angle)*cos(angle)
dy = -dist * sin(angle)* sin(angle)* sin(angle)
mx = 500 + dx
my = 300 + dy
MouseMove(mx, my)
Wait(50)
MouseLeftClick(300)
angle = angle + dAngle
next
next
exit do
loop
//在此加入相應的代碼。變數found代表是否在限定距離內發生滑鼠指標變化
//如果found=true,那麼產生變化時滑鼠所在的螢幕座標保存在mx,my中
end function
# 在此添加子函數
以下修改自
ezxy2005大大地陽春版腳本
#[HOTKEY][EXT]HOME
//==========================================//
//*****************可以白吃白喝白打*********//
//*****************外加反擊,不爽還會休息****//
//*****************詳細設定看圖*************//
//==========================================//
Dim WinID
//=================================================================================進程
function Main
SetInputMode(3) //驅動模式,很多遊戲會阻擋SP的部份功能,可以套用此函數
while true //循環開始
HP()//休息迴圈
Find()//尋找怪物迴圈
At()//攻擊迴圈,DP()反擊迴圈下在HP()所以不用寫在進程
wend //返回while開始循環
end function
//=================================================================================程序迴圈
//============================= 休息 ============================================
function HP()//休息攻擊+喝水
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
print("血量檢查點,如果不足就休息回血")
if not CheckColor(WinX0+215, WinY0+646, Color(219, 42, 80), 15) then
KeyPress("x")
Wait(1000)
Do
//循環
DP()//如果有主動怪或是支援怪就反擊
Wait(6000)//反擊結束後如果血量還沒滿就休息
loop until CheckColor(WinX0+242, WinY0+645, Color(134, 25, 49), 10)
end if
end Function
//==============================================================================搜尋怪物
Function Find()
FindWindow("未來啟示錄",WinID)
ActiveWindow(WinID)
Wait(100)
GetActiveWindowSize(w,h)
Print(w ","& h)
//--------------------------NPC判斷式---------------------------------------------
GetActiveWindowXY(WinX0, WinY0)
if not CheckColor(WinX0+429, WinY0+11, Color(105, 103, 58), 10) then //npc特定圖形判斷
do
print("判斷是否為npc")
Keypress("tab")
Wait(100)
Wait(300)
loop until CheckColor(WinX0+429, WinY0+11, Color(105, 103, 58), 10)//如果符合怪的圖行及執行下一行
end if
//--------------------------目標不在視野範圍內,無法攻擊---------------------------------------------
if FindImageEx("目標不在視野範圍內.sel", Color(20, 20, 20), 183, 41, 760, 272, true, x, y) then //npc特定圖形判斷
print("目標不在視野範圍內,無法攻擊")
Keypress("tab")
Wait(100)
Wait(300)
else
end if
//----------------------------npc判斷迴圈------------------------------------------
print("不為npc")
if not CheckColor(WinX0+581, WinY0+31, Color(134, 36, 60), 10) then//怪物血條判斷前端防止強怪
do
Print("尋找目標")
keyPress("tab")
Wait(100)
Keypress("a")//必免讀取顏色錯誤
Wait(300)
loop Until CheckColor(WinX0+589, WinY0+31, Color(91, 29, 40), 10)//怪物血條前端符合及跳離執行下一段
end if
end Function
//======================================================================攻擊迴圈
Function At() //攻擊開始
GetActiveWindowXY(WinX0, WinY0)
stt=GetTime()
do
Print("AT")
Keypress("1",600)
KeyPress("2",600)
Keypress("3",600)
KeyPress("7",600)
Keypress("8",800)
Keypress("f",500)
Wait(900)
if not CheckColor(WinX0+145, WinY0+644, Color(163, 13, 38), 15) then
Print("檢查人物血量.如果不足就補血")
KeyPress("4")
Wait(500)
end if
if not CheckColor(WinX0+135, WinY0+644, Color(121, 9, 30), 15) then
Print("檢查人物血量.如果不足就補血")
KeyPress("0")
Wait(500)
end if
if not CheckColor(WinX0+22, WinY0+12, Color(255, 255, 177), 10) then
Wait(500)
keypress("5")
Wait(500)
end if
if not CheckColor(WinX0+42, WinY0+14, Color(252, 252, 249), 10) then
keypress("6")
Wait(500)
end if
//------------------------------Timer這裡算是亂寫的只供參考-----------------------
/*
if gettime()-stt>13*1000 then
CheckColor(WinX0+589, WinY0+30, Color(118, 19, 38), 10)=CheckColor(WinX0+589, WinY0+30, Color(118, 19, 38), 10)
if CheckColor(WinX0+589, WinY0+30, Color(118, 19, 38), 10)=CheckColor(WinX0+589, WinY0+30, Color(118, 19, 38), 10) then
print("卡怪!!!Tab換怪")
keypress("Tab")
exit do
end if
end if
*/
loop until CheckColor(WinX0+451, WinY0+30, Color(24, 26, 29), 20)
print("第一次攻擊結束,檢查怪物血量")
print("怪物死亡")
Keypress("1",600)
KeyPress("2",600)
Keypress("F",600)
Keypress("F",600)
Keypress("5")//輔助技能直接按下不管有沒有狀態
Wait(500)
keypress("esc")//這裡的ESC是因為檢完物品後還會出現框框
Wait(6000)
end function
//==================================================================反擊迴圈
Function Dp()
GetActiveWindowXY(WinX0, WinY0)
if CheckColor(WinX0+447, WinY0+31, Color(102, 35, 48), 10) then//怪血條後端如果顏色正確就反擊
do
Print("主動怪反擊迴圈")
Keypress("1",600)
KeyPress("2",600)
if not CheckColor(WinX0+145, WinY0+644, Color(163, 13, 38), 15) then//人物血條判斷
Print("檢查人物血量.如果不足就按下5鍵補血")
KeyPress("4")
Wait(500)
end if
if not CheckColor(WinX0+135, WinY0+644, Color(121, 9, 30), 15) then
Print("檢查人物血量.如果不足就補血")
KeyPress("0")
Wait(500)
end if
Keypress("3",600)
KeyPress("7",600)
Keypress("8",600)
KeyPress("2",700)
loop until CheckColor(WinX0+447, WinY0+31, Color(21, 22, 27), 10)//直到血條為0及跳出
KeyPress("F")
Wait(500)
Keypress("ESC")
Wait(1000)
HP()
end if
end function |