黃易群俠傳M脫機外掛應用程式黃易神行
3419
2

[發問] 固定範圍打怪的腳本.. 看不懂∼求助!

whatthefxck 發表於 2009-11-11 12:22:40 | 只看該作者 回帖獎勵 |倒序瀏覽 |
小弟不才,學生時三角函數沒學好...
剛剛研究了一下 定點打怪教學 或 圈形漸開找怪示例。(進階教學)
想要展開大約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
收藏收藏 分享分享 讚 幹 分享分享 FB分享
回覆

使用道具 舉報


chanyau123 當前離線
UID
1353349
熱心
42 值
嘉獎
0 次
違規
0 次
在線時間
9 小時
經驗
42 點
積分
42
精華
0
最後登錄
2009-12-30
閱讀權限
20
註冊時間
2009-11-16
論壇幣
359 幣
聯合幣
0 枚
幸運鑽
0 顆
招待卷
0 點
查看詳細資料
Rank: 2Rank: 2
chanyau123 2009-11-16 20:47:50
我都唔係好明白呀-.-!!!!!!!!!!!!!!!!!!!!!!!!
回覆

使用道具 舉報

go0985165043 當前離線
UID
1592563
熱心
79 值
嘉獎
0 次
違規
0 次
在線時間
11 小時
經驗
84 點
積分
84
精華
0
最後登錄
2011-10-19
閱讀權限
20
註冊時間
2011-1-1
論壇幣
26 幣
聯合幣
0 枚
幸運鑽
0 顆
招待卷
0 點
查看詳細資料
Rank: 2Rank: 2
go0985165043 2011-1-8 17:27:46
天哪 上帝呀 我的媽呀
這個好高深
小弟也看不懂 愛莫能助
XD
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 註冊


手機版 | Archiver | 外掛聯合國

GMT+8, 2024-4-27 14:30 , Processed in 0.062195 second(s), 19 queries , Memcache On.

版權說明:
  本站不會製作、經銷、代理外掛程式。僅免費提供外掛程式下載前之掃毒及掃木馬等安全檢測驗證,協助會員遠離盜號危險程式。本站所有資料均來自網際網路收集整理,說明文字暨下載連結轉載自原程 式開發站。站上出現之公司名稱、遊戲名稱、程式等,商標及著作權,均歸各公司及程式原創所有,本站程式所有權歸外掛聯合國所有。本程式所有權歸外掛聯合國所有.......

回頂部
第二步?
第三步?