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

[發問] 反應"山下秀貴"大大所發布的腳本~~

mcsnake 發表於 2009-12-9 17:06:28 | 只看該作者 回帖獎勵 |倒序瀏覽 |
本帖最後由 mcsnake 於 2009-12-9 17:09 編輯

#[HOTKEY]HOME
function main
SetInputMode(3) //驅動模式,很多遊戲會阻擋SP的部份功能,可以套用此函數
while true    //循環開始
  State()//子函數狀態
wend        //返回while開始循環
end function
function State//休息攻擊+喝水
//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)

print("執行攻擊")
if not CheckColor(WinX0+248, WinY0+645, Color(107, 21, 40), 10) then
  Wait(500)
  KeyDown("x")
  Wait(500)
  KeyUp("x")
  Wait(300)
  KeyDown("6")
  Wait(500)
  KeyUp("6")
  KeyDown("F1")
  Wait(500)
  KeyUp("F1")
  KeyDown("7")
  Wait(500)
  KeyUp("7")
  KeyDown("8")
  Wait(500)
  KeyUp("8")
  GetActiveWindowXY(WinX0, WinY0)
  if CheckColor(WinX0+587, WinY0+30, Color(109, 17, 35), 10) then//怪血條後端如果顏色正確就反擊
   
   do
    Print("主動怪反擊迴圈")
    KeyDown("1")
    Wait(300)
    KeyDown("2")
    Wait(300)
    KeyUp("2")
    Wait(300)
    KeyDown("3")
    Wait(300)
    KeyUp("3")
    Wait(100)
    //取窗口原點坐標
    GetActiveWindowXY(WinX0, WinY0)
    //補血技能,沒有就放紅水
    //如果窗口坐標(176, 674)的顏色不等於(219, 18, 13) 那麼
    if not CheckColor(WinX0+185, WinY0+674, Color(222, 17, 50), 10) then
     KeyDown("6")
     Wait(300)
     KeyUp("6")
    end if
   
   loop while CheckColor(WinX0+447, WinY0+29, Color(108, 49, 54), 10)//怪物血量底部,如果還有血就跳回去出
   KeyDown("1")
   Wait(300)
   KeyPress("F")
   Wait(300)
   KeyPress("F")
   Wait(300)
   Keypress("ESC")
   Wait(100)
   KeyDown("x")
   Wait(500)
   KeyUp("x")
   Wait(2000)
   
  end if
  GetActiveWindowXY(WinX0, WinY0)
  if CheckColor(WinX0+587, WinY0+30, Color(109, 17, 35), 10) then//怪血條後端如果顏色正確就反擊
   
   do
    Print("主動怪反擊迴圈")
    KeyDown("1")
    Wait(300)
    KeyDown("2")
    Wait(300)
    KeyUp("2")
    Wait(300)
    KeyDown("3")
    Wait(300)
    KeyUp("3")
    Wait(100)
    //取窗口原點坐標
    GetActiveWindowXY(WinX0, WinY0)
    //補血技能,沒有就放紅水
    //如果窗口坐標(176, 674)的顏色不等於(219, 18, 13) 那麼
    if not CheckColor(WinX0+185, WinY0+674, Color(222, 17, 50), 10) then
     KeyDown("6")
     Wait(300)
     KeyUp("6")
    end if
   
   loop while CheckColor(WinX0+447, WinY0+29, Color(108, 49, 54), 10)//怪物血量底部,如果還有血就跳回去出
   KeyDown("1")
   Wait(300)
   KeyPress("F")
   Wait(300)
   KeyPress("F")
   Wait(300)
   Keypress("ESC")
   Wait(100)
   KeyDown("x")
   Wait(500)
   KeyUp("x")
   Wait(2000)
   
  end if
  GetActiveWindowXY(WinX0, WinY0)
  if CheckColor(WinX0+587, WinY0+30, Color(109, 17, 35), 10) then//怪血條後端如果顏色正確就反擊
   
   do
    Print("主動怪反擊迴圈")
    KeyDown("1")
    Wait(300)
    KeyDown("2")
    Wait(300)
    KeyUp("2")
    Wait(300)
    KeyDown("3")
    Wait(300)
    KeyUp("3")
    Wait(100)
    //取窗口原點坐標
    GetActiveWindowXY(WinX0, WinY0)
    //補血技能,沒有就放紅水
    //如果窗口坐標(176, 674)的顏色不等於(219, 18, 13) 那麼
    if not CheckColor(WinX0+185, WinY0+674, Color(222, 17, 50), 10) then
     KeyDown("-")
     Wait(300)
     KeyUp("-")
    end if
   
   loop while CheckColor(WinX0+447, WinY0+29, Color(108, 49, 54), 10)//怪物血量底部,如果還有血就跳回去出
   KeyDown("1")
   Wait(300)
   KeyPress("F")
   Wait(300)
   KeyPress("F")
   Wait(300)
   Keypress("ESC")
   Wait(100)
   KeyDown("x")
   Wait(500)
   KeyUp("x")
   
  end if
  
  
  do  //循環
   //等待2000毫秒                                                                                                                                                                                                                                
   Wait(2000)
   //直到窗口坐標(188, 42)的顏色等於(166, 60, 23)
  loop until CheckColor(WinX0+253, WinY0+674, Color(103, 9, 25), 10)
  
end if

//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)

//如果窗口坐標(86, 50)的顏色不等於(57, 121, 132) 那麼


//如果怪物狀態條的滿血位置找不到?
if not CheckColor(WinX0+592, WinY0+30, Color(104, 17, 33), 10) then
  
  //執行段內語句,當運行至LOOP時,如果表達式為false則跳回DO進行下一次執行,
  //直至LOOP後的表達式為true(真)時運行完畢。
  do  
   
   KeyPress("TAB")
   Wait(600)
  loop until CheckColor(WinX0+587, WinY0+30, Color(109, 17, 35), 10)//怪物滿血的位置
  
  
  GetActiveWindowXY(WinX0, WinY0)
  if not CheckColor(WinX0+585, WinY0+9, Color(164, 164, 163), 10) then//npc特定圖形判斷
   do
    print("判斷是否為npc")
    Keypress("tab")
    Wait(100)
    Wait(300)
   
   loop until CheckColor(WinX0+585, WinY0+9, Color(164, 164, 163), 10)//如果符合怪的圖行及執行下一行
  end if
  
else //找到的話…
  do//執行攻擊
  for ForCount = 1 to 3
   KeyDown("1")
   Wait(300)
   KeyDown("2")
   Wait(300)
   KeyUp("2")
   Wait(300)
   KeyDown("3")
   Wait(300)
   KeyUp("3")
   Wait(100)
   //取窗口原點坐標
   GetActiveWindowXY(WinX0, WinY0)
   //補血技能,沒有就放紅水
   //如果窗口坐標(176, 674)的顏色不等於(219, 18, 13) 那麼
   if not CheckColor(WinX0+185, WinY0+674, Color(222, 17, 50), 10) then
    KeyDown("6")
    Wait(300)
    KeyUp("6")
   end if
   
  next
  
loop while CheckColor(WinX0+447, WinY0+29, Color(108, 49, 54), 10)//怪物血量底部,如果還有血就跳回去
//等待500毫秒
Print("死亡")
KeyDown("1")//補打一下免的誤判
Wait(300)
KeyPress("F")
Wait(300)
KeyDown("w")
Wait(1600)
KeyUp("w")
KeyPress("F")
Wait(300)
KeyPress("F")
Wait(300)
Keypress("ESC")
Wait(2000)

//取窗口原點坐標
GetActiveWindowXY(WinX0, WinY0)
//補血技能,沒有就放紅水
//如果窗口坐標(176, 674)的顏色不等於(219, 18, 13) 那麼
if not CheckColor(WinX0+185, WinY0+674, Color(222, 17, 50), 10) then
  KeyDown("6")
  Wait(300)
  KeyUp("6")
end if

GetActiveWindowXY(WinX0, WinY0)
if CheckColor(WinX0+451, WinY0+30, Color(109, 37, 47), 10) then//怪血條後端如果顏色正確就反擊
  
  do
   Print("主動怪反擊迴圈")
   KeyDown("1")
   Wait(300)
   KeyDown("2")
   Wait(300)
   KeyUp("2")
   Wait(300)
   KeyDown("3")
   Wait(300)
   KeyUp("3")
   Wait(100)
   //取窗口原點坐標
   GetActiveWindowXY(WinX0, WinY0)
   //補血技能,沒有就放紅水
   //如果窗口坐標(176, 674)的顏色不等於(219, 18, 13) 那麼
   if not CheckColor(WinX0+185, WinY0+674, Color(222, 17, 50), 10) then
    KeyDown("6")
    Wait(300)
    KeyUp("6")
   end if
   
   
  loop while CheckColor(WinX0+447, WinY0+29, Color(108, 49, 54), 10)//怪物血量底部,如果還有血就跳回去出
  KeyDown("1")
  Wait(300)
  KeyPress("F")
  Wait(300)
  KeyPress("F")
  Wait(300)
  Keypress("ESC")
  
  
end if


end if
end function

以上是目前在研究的腳本之ㄧ...本人有研究過如果何抓點
抓色應該是一樣的東西!
我先說明一下我自己怎麼抓點的好了我是抓左下角的人物HP點~
怪物的滿血及死亡我都有抓~~~目前我會的是這樣~~~
但是有個很奇怪的問題~~~一開始會稍微打幾隻~~~但是一但人物休息以後~~~
就去了!!!!!!!!!怪物打也不反擊什麼也不做~~~好像停止了一樣~~~
為什麼會這樣請懂這腳本已經掛的很順的大大指導我~~~如果我用成功了將會幫大家
做非常詳細的解說~~~畢竟~我也是這幾天剛會一點點~~~在那之前已只會複製貼上
然後乾著急的人~~~希望各位能夠幫幫我感謝各位大大
補充一句~本人是玩戰神~~~會的大大請指導~~我不是伸手要~~~我想要自己會~
希望能跟還在學習的各位互相交流~~~
收藏收藏 分享分享 讚 幹 分享分享 FB分享
回覆

使用道具 舉報


leada123 當前離線
UID
7965
熱心
20 值
嘉獎
0 次
違規
0 次
在線時間
60 小時
經驗
24 點
積分
24
精華
0
最後登錄
2011-3-27
閱讀權限
20
註冊時間
2006-7-18
論壇幣
42 幣
聯合幣
0 枚
幸運鑽
0 顆
招待卷
0 點
查看詳細資料
Rank: 2Rank: 2
leada123 2009-12-10 00:59:08
1# mcsnake

我一直在試 靠文字下去抓哪個點出包  所以現在整個程式碼 拉拉長....
最近也是被do while  loop 這幾個碼快搞瘋了  邏輯一整個打結
樓主裡面 有幾個程式碼就寫的很棒

小弟覺得樓主因該是

回圈判斷結束後/被怪打, 沒有下指令, 要回去攻擊碼
取其中部分
    print("檢查HP")
    if not CheckColor(WinX0+199, WinY0+682, Color(232, 44, 72), 5) then
        //↑人物血量剩餘多少以下休息,自行抓色,這邊抓約血條50%
        print("HP過低準備回血")
        Wait(500)
        Keypress("-" , 300)
        print("開始回血")
        do
        Wait(1000)
        //回血判斷圖 看是否被怪偷打
        if FindImageEx("人物.Sel", Color(50, 50, 50), WinX0+627, WinY0+45, WinX0+663, WinY0+56, true, foundx, foundy) then
            state()//跳去攻擊碼
        end if
//直到 血滿的顏色成立  
    loop until CheckColor(WinX0+251, WinY0+683, Color(112, 8, 24), 5)
    Wait(500)
    Keypress("-" , 300) //這裡的- 放的是休息按鍵
    end if
回覆

使用道具 舉報

mcsnake 當前離線
UID
1082999
熱心
73 值
嘉獎
0 次
違規
0 次
在線時間
14 小時
經驗
64 點
積分
151
精華
0
最後登錄
2015-4-8
閱讀權限
20
註冊時間
2008-12-1
論壇幣
99 幣
聯合幣
4 枚
幸運鑽
0 顆
招待卷
0 點
查看詳細資料
Rank: 2Rank: 2
mcsnake 2009-12-10 01:25:12
##FOR leada123##
感謝我在嘗試看看~~~非常感謝您
回覆

使用道具 舉報

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


手機版 | Archiver | 外掛聯合國

GMT+8, 2024-5-9 01:37 , Processed in 0.042152 second(s), 19 queries , Memcache On.

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

回頂部
第二步?
第三步?