| 本帖最後由 whatthefxck 於 2009-11-9 09:49 編輯 
 前言:
 修改至http://bbs.wgun.net/thread-306991-1-1.html ,kelvin_mo大大的腳本
 呃,不知道改到什麼,出現錯誤了-.-
 懇請各位大大指點迷津!!
 加入了Naisite 大大反擊之後的腳本:(紅字=出錯地方)
 #[HOTKEY][EXT]HOME
 function main
 SetInputMode(3) //驅動模式,很多遊戲會阻擋SP的部份功能,可以套用此函數
 while true    //循環開始
 State() //子函數狀態
 wend        //返回while開始循環
 end function
 function State//休息攻擊+喝水
 //取窗口原點坐標
 GetActiveWindowXY(WinX0, WinY0)
 print("休息")
 if not CheckColor(WinX0+229, WinY0+643, Color(203, 39, 59), 10) then//人物血量剩餘多少以下休息
 Wait(100)
 KeyPress("F")
 Wait(300)
 KeyDown("x")
 Wait(1000)
 KeyUp("x")
 do  //循環
 Wait(500)
 loop until CheckColor(WinX0+247, WinY0+645, Color(111, 21, 42), 10)//直到血量到達
 end if
 GetActiveWindowXY(WinX0, WinY0)
 if not CheckColor(WinX0+154, WinY0+647, Color(198, 36, 74), 10) then //血剩多少以下喝水(不會喝水)
 Print("補血")
 KeyDown("4")
 Wait(500)
 KeyUp("4")
 wait(300)
 end if
 GetActiveWindowXY(WinX0, WinY0)
 if not CheckColor(WinX0+21, WinY0+8, Color(255, 251, 147), 10) then //當左上第一個技能消失後按5(抓顏色)
 Print("輔助")
 KeyDown("5")
 Wait(1000)
 KeyUp("5")
 end if
 GetActiveWindowXY(WinX0, WinY0)
 if not CheckColor(WinX0+41, WinY0+16, Color(253, 254, 254), 10) then //當左上第二個技能消失後按6(抓顏色)
 Print("輔助")
 KeyDown("6")
 Wait(1000)
 KeyUp("6")
 end if
 
 GetActiveWindowXY(WinX0, WinY0)
 if NOT CheckColor(WinX0+503, WinY0+13, Color(255, 255, 255), 10) then//NPC名字顏色(點到NPC不會換目標)
 do
 Print("Npc")
 KeyDown("Tab")
 Wait(100)
 KeyUp("Tab")
 Wait(500)
 loop until CheckColor(WinX0+586, WinY0+33, Color(113, 31, 50), 10)//怪物滿血的位置
 GetActiveWindowXY(WinX0, WinY0)
 
 else //找到的話…
 do //循環
 keypress("3")     //這是我的攻擊鍵
 wait(7*1000)      //因為我是殺手~技能沒辦法一直按~所以我延遲時間需要比較久
 keypress("2")     //這也是我的攻擊鍵~因為殺手是遠距離打怪~
 //我需要一個技能或攻擊讓我可以靠近怪
 wait(100)
 keypress("Esc")   //為什麼要按ESC~因為視窗一樣是停留在死掉的怪的目標
 wait(2*1000)      //只要你有設ESC~目標取消了~
 //有怪打你~你的目標會變成另外一隻怪身上
 loop while CheckColor(WinX0+453, WinY0+30, Color(115, 19, 37), 10)
 //上面這一個是判斷怪物是否有死亡~沒有程式會跳回"do  //循環"那邊
 
 GetActiveWindowXY(WinX0, WinY0)
 if CheckColor(WinX0+522, WinY0+139, Color(250, 210, 0), 10) then //碰障礙物無法攻擊的字體顏色
 Print("無法攻擊")
 KeyDown("2")
 Wait(3000)
 KeyUp("2")
 Wait(3000)
 KeyDown("Tab")
 Wait(100)
 KeyUp("Tab")
 Wait(500)
 end if
 next (錯誤訊息:沒有找到FOR)
 loop while CheckColor(WinX0+450, WinY0+32, Color(118, 31, 52), 10) //怪物血量到達0如果還有血會跳回去(錯誤訊息:沒有找到DO)
 Print("死亡")
 KeyDown("2")
 Wait(1000)
 KeyUp("2")
 Wait(100)
 KeyPress("ESC")
 Wait(500)
 KeyPress("F")
 Wait(500)
 end if
 end function
 
 **********************************************************************
 
 無反擊腳本(原來沒加反擊的腳本)的問題(無法喝水、點到npc不會換取目標)(我點到npc是設定假設出現npc小框框,發現白色字體就按tab)
 #[HOTKEY][EXT]HOME
 function main
 SetInputMode(3) //驅動模式,很多遊戲會阻擋SP的部份功能,可以套用此函數
 while true    //循環開始
 State() //子函數狀態
 wend        //返回while開始循環
 end function
 function State//休息攻擊+喝水
 //取窗口原點坐標
 GetActiveWindowXY(WinX0, WinY0)
 print("休息")
 if not CheckColor(WinX0+229, WinY0+643, Color(203, 39, 59), 10) then//人物血量剩餘多少以下休息
 Wait(100)
 KeyPress("F")
 Wait(300)
 KeyDown("x")
 Wait(1000)
 KeyUp("x")
 do  //循環
 Wait(500)
 loop until CheckColor(WinX0+247, WinY0+645, Color(111, 21, 42), 10)//直到血量到達
 end if
 GetActiveWindowXY(WinX0, WinY0)
 if not CheckColor(WinX0+154, WinY0+647, Color(198, 36, 74), 10) then //血剩多少以下喝水(不會喝水)
 Print("補血")
 KeyDown("4")
 Wait(500)
 KeyUp("4")
 wait(300)
 end if
 GetActiveWindowXY(WinX0, WinY0)
 if not CheckColor(WinX0+21, WinY0+8, Color(255, 251, 147), 10) then //當左上第一個技能消失後按5(抓顏色)
 Print("輔助")
 KeyDown("5")
 Wait(1000)
 KeyUp("5")
 end if
 GetActiveWindowXY(WinX0, WinY0)
 if not CheckColor(WinX0+41, WinY0+16, Color(253, 254, 254), 10) then //當左上第二個技能消失後按6(抓顏色)
 Print("輔助")
 KeyDown("6")
 Wait(1000)
 KeyUp("6")
 end if
 
 GetActiveWindowXY(WinX0, WinY0)
 if NOT CheckColor(WinX0+503, WinY0+13, Color(255, 255, 255), 10) then//NPC名字顏色(點到NPC不會換目標)
 do
 Print("Npc")
 KeyDown("Tab")
 Wait(100)
 KeyUp("Tab")
 Wait(500)
 loop until CheckColor(WinX0+586, WinY0+33, Color(113, 31, 50), 10)//怪物滿血的位置
 else //找到的話…
 do //執行攻擊(按鍵 1、2、3)
 for ForCount = 1 to 1
 Print("攻擊")
 KeyDown("1")
 Wait(2500)
 KeyUp("1")
 KeyDown("2")
 Wait(1600)
 KeyUp("2")
 KeyDown("3")
 Wait(1600)
 KeyUp("3")
 KeyDown("7")
 Wait(1600)
 KeyUp("7")
 KeyDown("8")
 Wait(1600)
 KeyUp("8")
 Wait(500)
 KeyPress("F")
 Wait(300)
 KeyDown("ESC")
 Wait(1600)
 KeyUp("ESC")
 Wait(1000)
 
 
 if CheckColor(WinX0+433, WinY0+14, Color(241, 235, 132), 10) then //這裡是防止坐下的時候有怪在打
 KeyPress("1")
 Wait(300)
 KeyPress("1")
 Wait(300)
 
 do
 keyPress("1",1000)   //打怪
 loop while CheckColor(WinX0+441, WinY0+27, Color(38, 34, 28), 10)   //直到怪物框框上的點沒有出現
 end if
 
 GetActiveWindowXY(WinX0, WinY0)
 if CheckColor(WinX0+522, WinY0+139, Color(250, 210, 0), 10) then //碰障礙物無法攻擊的字體顏色
 Print("無法攻擊")
 KeyDown("2")
 Wait(3000)
 KeyUp("2")
 Wait(3000)
 KeyDown("Tab")
 Wait(100)
 KeyUp("Tab")
 Wait(500)
 end if
 next
 loop while CheckColor(WinX0+450, WinY0+32, Color(118, 31, 52), 10) //怪物血量到達0如果還有血會跳回去
 Print("死亡")
 KeyDown("2")
 Wait(1000)
 KeyUp("2")
 Wait(100)
 KeyPress("ESC")
 Wait(500)
 KeyPress("F")
 Wait(500)
 end if
 end function
 |