本帖最後由 fuhaoshih7 於 2010-8-24 02:00 編輯
各位安 之前發布過G大 Po 的自動航行腳本
下面這是小弟自用的陸戰腳本
可以跟販售的陸戰腳本 搶怪
強度可想而知 請自行參考
技巧模式 需要配合 個人寫的小號陸戰腳本
做到 快速升級技巧 不過這邊就不放出來了
不然真的 大家都陸戰 畢業了 哈哈
個人是 台服 戰列艦 黑色劍士(雙奧義) 原 鷹之團團長
[General]
Description=陸戰
BeginHotkey=122
BeginHotkeyMod=0
PauseHotkey=0
PauseHotkeyMod=0
StopHotkey=123
StopHotkeyMod=0
RunOnce=0
EnableWindow=
Enable=0
AutoRun=0
[Repeat]
Type=0
Number=1
[Relative]
SetupOCXFile=
[Comment]
Content=
[Script]
UserVar weak_pe=20 吃料理疲勞度
UserVar eat_s=2 料理位置
VBS Dim bu_s(3)
VBS Dim bu_pe(3)
UserVar bu_s(0)=3 補品1位置
UserVar bu_pe(0)=40 補品1百分比
UserVar bu_s(1)=4 補品2位置
UserVar bu_pe(1)=60 補品2百分比
UserVar bu_s(2)=1 補品3位置
UserVar bu_pe(2)=60 補品3百分比
UserVar bu_s(3)=1 補品4位置
UserVar bu_pe(3)=60 補品4百分比
UserVar direct_lv=40 等級以下怪快速攻擊
UserVar sword_mode=DropList{一般模式:0|劍術模式:1|技巧模式:2|綜合模式:3}=0 攻擊模式
UserVar sword_mode_skill=DropList{力量:1|速度:2|佯攻:3}=0 技巧模式施放技能
UserVar skill_number=3 等待技巧數
UserVar fllow_npc=DropList{是:1|否:0}=1 自動跟隨NPC
UserVar go_head=DropList{是:1|否:0}=1 向前引怪
UserVar turn_view=DropList{是:1|否:0}=1 旋轉找怪
//自動跟隨NPC 開啟後施放技能速度有影響,打怪點有需求再開
//----------------------------------------------------------
VBS Dim act(3)
VBS act(1)="力量.bmp"
VBS act(2)="速度.bmp"
VBS act(3)="佯攻.bmp"
VBS tabAddr=&H00BFD7B8
VBS tabTypeAddr=tabAddr+&H2
VBS pcIDAddr=&H00C02D44
VBS Dim npcIDAddr(4)
VBS npcIDAddr(0)=pcIDAddr+&H370
VBS nextNPCDiff=&H58
VBS i=1
For 4
VBS npcIDAddr(i)=npcIDAddr(0)+nextNPCDiff*i
VBS i=i+1
EndFor
VBS npcHpDiff=&H10
VBS npcMaxHpDiff=&H8
VBS npcLvDiff=&H28
VBS npcActDiff=&H34
VBS pchpAddr=pcIDAddr+npcHpDiff
VBS pcmaxhpAddr=pcIDAddr+npcMaxHpDiff
VBS pcactAddr=pcIDAddr+&H50
VBS pcmaxactAddr=pcIDAddr+&H4C
VBS stateAddr=&H00C01D34
VBS weakAddr=stateAddr+&HD0
VBS is_f_fight=1
Gosub check_w
VBS skill_x=689-800+scrW+nx
VBS skill_y=79+ny
VBS skill_x1=58
VBS skill_y1=54
VBS Dim att_color(5)
VBS old_skill_mode=sword_mode
While 1
Plugin maxhp=Memory.Read16Bit(hwn,pcmaxhpAddr)
If maxhp>0
If is_f_fight=0
VBS is_f_fight=1
VBS skill_time=●嚴禁張貼廣告●
If sword_mode=2 or sword_mode=3
VBS fllow_npc=0
VBS skill_hold=1
Plugin npclv=Memory.Read16Bit(hwn,npcIDAddr(0)+npcLvDiff)
If CInt(npclv)>direct_lv
If go_head=1
Plugin Bkgnd.KeyPress(hwn,116)
Delay 2000
Plugin Bkgnd.RightClick(hwn,100,100)
Delay 1000
If npclv=55
KeyDown 38 1
Delay 1300
//Delay 800
KeyUp 38 1
EndIf
EndIf
EndIf
EndIf
If sword_mode<>2
KeyPress 13 1
EndIf
EndIf
VBS time_s=DateDiff("s",heal_t,●嚴禁張貼廣告●)
If time_s>0
Gosub 判斷行動力
EndIf
If fllow_npc=1
VBS time_s=DateDiff("s",att_t,●嚴禁張貼廣告●)
If time_s>4
VBS att_t=●嚴禁張貼廣告●
KeyPress 13 1
EndIf
EndIf
If sword_mode<>1
Gosub 判斷攻擊
EndIf
Gosub 目標判斷
Else
VBS sword_mode=old_skill_mode
VBS att_t=●嚴禁張貼廣告●
VBS heal_t=●嚴禁張貼廣告●
VBS npc_old_id=0
If is_f_fight=1
VBS is_f_fight=0
VBS f_combo=0
EndIf
Gosub 確認疲勞度
Plugin Window.Active(hwn)
Gosub 找怪
EndIf
Delay 1000
EndWhile
EndScript
//-------------------------------------------------------------------------------------------------------
Sub 判斷攻擊
Plugin tab=Memory.Read16Bit(hwn,tabAddr)
VBS i=0
For 5
Plugin npcid=Memory.Read16Bit(hwn,npcIDAddr(i))
If npcid=tab
Plugin npclv=Memory.Read16Bit(hwn,npcIDAddr(i)+npcLvDiff)
Plugin npchp=Memory.Read16Bit(hwn,npcIDAddr(i)+npcHpDiff)
Plugin npcmaxhp=Memory.Read16Bit(hwn,npcIDAddr(i)+npcMaxHpDiff)
Plugin npcact=Memory.Read16Bit(hwn,npcIDAddr(i)+npcActDiff)
If npc_old_id<>npcid
VBS npc_old_id=npcid
If sword_mode<>2
KeyPress 13 1
EndIf
EndIf
//回擊
If npcact>0 and npcact<10
VBS t=((npcact+2) mod 3)+1
EndIf
If npcact>0 and npcact<10 and (sword_mode<>2 and sword_mode<>3)
// and (sword_mode=2 and t<>sword_mode_skill) and (sword_mode=2 and skill_hold=1)
VBSCall FindPic(633-800+scrW+nx,472-600+scrH+ny,770-800+scrW+nx,490-600+scrH+ny,act(t),0.9,x,y)
If x>0
Plugin Bkgnd.LeftClick(hwn,x-5-nx,y-31-ny)
EndIf
EndIf
//自動攻擊
//一般模式
If (sword_mode=2 or sword_mode=3) and CInt(npclv)<=direct_lv
VBS sword_mode=0
VBS fllow_npc=1
EndIf
If sword_mode=0 or CInt(npclv)<=direct_lv
If CInt(npclv)<=direct_lv or npchp*100/npcmaxhp<40
VBS skill_s=1
Gosub 施放技巧
VBS skill_s=2
Gosub 施放技巧
VBS skill_s=3
Gosub 施放技巧
Else
If f_combo=0
// If skill_number>=3
VBS skill_s=3
// Else
// VBS skill_s=2
// EndIf
Gosub 施放技巧
If skill_b=1
VBS f_combo=1
EndIf
Else
VBS skill_s=1
Gosub 施放技巧
VBS skill_s=2
Gosub 施放技巧
VBS skill_s=3
Gosub 施放技巧
EndIf
EndIf
//技巧模式
ElseIf sword_mode=2 or sword_mode=3
VBS time_s=DateDiff("s",skill_time,●嚴禁張貼廣告●)
If time_s>(skill_number-1)*20+(skill_number-1)
VBS skill_hold=0
Gosub 選擇技巧
If no_skill_count=3
VBS sword_mode=0
VBS fllow_npc=1
EndIf
EndIf
EndIf
EndIf
VBS i=i+1
EndFor
Return
Sub 選擇技巧
VBS no_skill_count=0
VBS j=0
For 3
VBS jj=0
IfColor 633+j*56-800+scrW+nx 472-600+scrH+ny b3b3b3 0
VBS jj=1
VBSCall FindPic(633+j*56-800+scrW+nx,472-600+scrH+ny,655+j*56-800+scrW+nx,490-600+scrH+ny,act(sword_mode_skill),0.9,x,y)
If x>0
Plugin Bkgnd.KeyPress(hwn,112+j)
Plugin Bkgnd.KeyPress(hwn,112+j)
Goto endskill
Else
VBS no_skill_count=no_skill_count+1
EndIf
EndIf
IfColor 633+j*56-800+scrW+nx 472-600+scrH+ny 656565 0
VBS jj=1
EndIf
If jj=0
VBS no_skill_count=no_skill_count+1
EndIf
VBS j=j+1
EndFor
Rem endskill
Return
Sub 施放技巧
VBS skill_b=0
IfColor 633+(skill_s-1)*56-800+scrW+nx 443-600+scrH+ny b3b3b3 0
Plugin Bkgnd.KeyPress(hwn,111+skill_s)
Plugin Bkgnd.KeyPress(hwn,111+skill_s)
VBS skill_b=1
EndIf
Return
Sub 目標判斷
Rem rechecknpc
Plugin tab=Memory.Read16Bit(hwn,tabAddr)
Plugin tabType=Memory.Read16Bit(hwn,tabTypeAddr)
Plugin maxhp=Memory.Read16Bit(hwn,pcmaxhpAddr)
If maxhp>0 and (tab=0 or tabType<256)
KeyPress 9 1
Delay 5
VBS is_f_fight=0
VBS f_combo=0
If sword_mode<>2
Delay 100
KeyPress 13 1
EndIf
Goto rechecknpc
EndIf
Return
Sub 判斷行動力
Plugin hp=Memory.Read16Bit(hwn,pchpAddr)
Plugin maxhp=Memory.Read16Bit(hwn,pcmaxhpAddr)
VBS i=0
For 4
If maxhp>0 and hp*100/maxhp<bu_pe(i)
VBS bx=((bu_s(i)-1) mod 2)*56
VBS by=int((bu_s(i)-1)/2)*54
IfColor 633+bx-800+scrW+nx 499+by-600+scrH+ny b3b3b3 0
Plugin Bkgnd.KeyPress(hwn,bu_s(i)+115)
VBS heal_t=DateAdd("s",5,●嚴禁張貼廣告●)
EndIf
EndIf
VBS i=i+1
EndFor
Return
Sub 找怪
Rem refind
KeyPress 9 1
Delay 5
Plugin tab=Memory.Read16Bit(hwn,tabAddr)
Plugin tabType=Memory.Read16Bit(hwn,tabTypeAddr)
If tab>0 and tabType>256
Plugin maxhp=Memory.Read16Bit(hwn,pcmaxhpAddr)
If maxhp>0
Goto endfind
EndIf
VBS b=0
Rem c1
KeyPress 13 1
KeyPress 13 1
Gosub mousedelay
IfColor 760-800+scrW+nx 408-600+scrH+ny ffffff 1
VBS b=b+1
If b>=15
Goto refind
EndIf
Goto c1
Else
V●禁私人部落格●etPixelColor(640-800+scrW+nx,384-600+scrH+ny)
Plugin Color.ColorToRGB(color,cR,cG,cB)
If cR>246 and cB>246 and cG>246
Plugin Bkgnd.LeftDoubleClick(hwn,640-800+scrW-5,384-600+scrH-31)
Goto endfind
EndIf
EndIf
Else
If turn_view=1
KeyDown 39 1
EndIf
EndIf
Plugin maxhp=Memory.Read16Bit(hwn,pcmaxhpAddr)
If maxhp=0
Goto refind
EndIf
Rem endfind
Delay 500
If turn_view=1
KeyUp 39 1
EndIf
Return
Sub 確認疲勞度
Rem recheckweak
Plugin weak=Memory.Read16Bit(hwn,weakAddr)
If weak/10>weak_pe
VBS keyval=eat_s
Gosub 開技能
Delay 2000
Goto recheckweak
EndIf
Return
Sub 開技能
VBS skill_b=0
Gosub OpenZ
VBS x=int((keyval-1)/4)*skill_x1+skill_x
VBS y=((keyval-1) mod 4)*skill_y1+skill_y
VBS b=0
IfColor x y b3b3b3 0
VBS b=1
EndIf
IfColor x y bbbbbb 0
VBS b=1
EndIf
If b=1
Plugin Bkgnd.KeyPress(hwn,111+keyval)
VBS skill_b=1
Else
Gosub closeZ
VBS skill_b=0
EndIf
Gosub su_chk
Return
Sub mousedelay
Delay 300
Rem delaymouse
VBSCall var=GetCursorShape(0)
If var=2012885647
Delay 50
Goto delaymouse
EndIf
Return
Sub su_chk
VBS b=0
Rem resu_chk
IfColor 788-800+scrW+nx 104+ny ffffff 1
VBS b=b+1
If b>60
Goto end_resu_chk
EndIf
Delay 50
Goto resu_chk
EndIf
Rem end_resu_chk
Return
Sub OpenZ
VBS b=0
Gosub closeWin
//IfColor 662-800+scrW+nx 104+ny ffffff 1
Gosub ctrlZ
// EndIf
Rem reopenz
IfColor 662-800+scrW+nx 104+ny ffffff 1
Delay 50
VBS b=b+1
If b>60
Goto end_fopenz
EndIf
Goto reopenz
EndIf
Rem end_fopenz
Return
Sub closeWin
IfColor 662-800+scrW+nx 104+ny ffffff 0
Gosub closeZ
EndIf
Gosub su_chk
Return
Sub closeZ
Plugin Bkgnd.LeftClick(hwn,662-800+scrW-5,104-31)
Return
Sub ctrlQ
Plugin Bkgnd.KeyPress(hwn,120)
Return
Sub ctrlZ
Plugin Bkgnd.KeyPress(hwn,119)
Return
Sub check_w
Plugin hwn=Window.GetKeyFocusWnd()
Plugin winRect=Window.GetClientRect(hwn)
winPoint = Split(winRect, "|", -1, 1)
nx = CInt(winPoint(0))-5
ny = CInt(winPoint(1))-31
VBS scrW= CInt(winPoint(2))
VBS scrH= CInt(winPoint(3))
Return |