本帖最後由 zhangjiada 於 2009-10-28 14:47 編輯
第一次用 摸索很久
這個是根據內存的腳本下去改的
目前我沒辦法改 不搶怪
希望有人能提供 不搶怪模式 給我ˊˋ
修改的主要內容有
自動補血 請放補血技能到S_7 的地方
(以下是修改補血技能的地方 要自己修改請自己找)
if HP1<65 then (65代表 65% 可以自己修改多少補血)
KeyPress("F1")
Wait(100)
SKeyPress("7") (數字也可以改 但改了不保證能跑)
Print("施放按鍵S_7輔助技能") (同上 記得修改數字)
Wait(2000)
end if
---------------------------------------------------------
這一個是找怪 打怪的
內存只有用三個格子給你放技能 也就是(key1)
我個人是把他修改到4個技能 1個普攻
當然第一刀普攻比較好 因為這樣比較靠近怪
function KillG
key1=GetConfigString("首發攻擊快捷鍵")
stt=GetTime()
GWHP1=ReadGHP(3100/3100)
GWHP2=ReadGHP(3000/3000)
do
KeyPress(key1) (要修改請自己加一套進去)
Wait(1000) (例如我要+個6 你就打KeyPress("6") Wait(1000) )
KeyPress("2") (應該很簡單吧 可是自己改了 我不保證能跑噢)
Wait(1000) (所有要改之前 請先記得之前的是什麼 必免改了不能跑)
KeyPress("3")
Wait(1000)
KeyPress("4")
Wait(1200)
KeyPress("5")
Wait(1000)
HPAPSP()
------------------------------------------------
我撿東西是用 第六格 請用技能欄裡面的撿取放6
loop
KeyPress("W",800)
SetTime=GetTime()
do
KeyPress("6")
hpapsp()
Wait(100)
-------------------------------------------
下面這一段 我實在看不懂在說什麼 有大大能幫我解釋嗎?
內存裡面有的 無緣無故會按esc 亂改的話 腳本動不了...
loop until GetTime()-SetTime > 100
do
KeyPress("esc")
hpapsp()
loop until ReadFG()=0
end function
------------------------------------------------
其實小弟我也是新手 希望能跟大家一起交流^^
-----------------------以下為我個人的腳本-----------------------------
#[HOTKEY]HOME
#SetArgsOnCompile
//原創作者:Seraph討論區ohyeah
//設置:怪物1血量值,怪物2血量值,怪物3血量值 <=> 正常掛網
//快捷欄4:拾取
//快捷欄5:HP藥,快捷欄6:AP藥,快捷欄7:SP藥
//S_1-S_7:加持技能
//啟動與暫停熱鍵:Home
dim x,y
dim WinID
dim pi
dim HPkey1,HP1,HPkey2,HP2,APkey1,AP1,APkey2,AP2,SPkey1,SP1,SPkey2,SP2
dim XHP,XAP,XSP,XTime
dim GHP1,GHP2,GHP3
dim GWHP1,GWHP2,DGJC
dim FW
dim Time1 = -1
dim Time2 = -1
dim Time3 = -1
dim Time4 = -1
dim Time5 = -1
dim Time6 = -1
dim Time7 = -1
dim S1,S2,S3,S4,S5,S6,S7
function init
HPkey1=GetConfigString("放大HP藥的快捷鍵")
HPkey2=GetConfigString("放小HP藥的快捷鍵")
APkey1=GetConfigString("放大AP藥的快捷鍵")
APkey2=GetConfigString("放小AP藥的快捷鍵")
SPkey1=GetConfigString("放大SP藥的快捷鍵")
SPkey2=GetConfigString("放小SP藥的快捷鍵")
XHP=GetConfigNumber("HP少于%休息")
XAP=GetConfigNumber("AP少于%休息")
XSP=GetConfigNumber("SP少于%休息")
XTime=GetConfigNumber("休息糾錯時間")
key1=GetConfigString("首發攻擊快捷鍵")
GHP1=GetConfigNumber("怪物1血量值")
GHP2=GetConfigNumber("怪物2血量值")
GHP3=GetConfigNumber("怪物3血量值")
DGJC=GetConfigNumber("打怪糾錯時間")
FW=GetConfigNumber("掛機范圍")
S1=GetConfigString("輔助鍵S_1冷卻時間")
S2=GetConfigString("輔助鍵S_2冷卻時間")
S3=GetConfigString("輔助鍵S_3冷卻時間")
S4=GetConfigString("輔助鍵S_4冷卻時間")
S5=GetConfigString("輔助鍵S_5冷卻時間")
S6=GetConfigString("輔助鍵S_6冷卻時間")
S7=GetConfigString("輔助鍵S_7冷卻時間")
FindWindow("未來啟示錄",WinID)
ActiveWindow(WinID)
Wait(100)
pi = 4 * Atn(1)
GetActiveWindowSize(w,h)
Print(w &","& h)
ReadXY(x,y)
end function
function SKeyPress(key)
KeyDown("SHIFT")
Wait(100)
KeyPress(key)
Wait(100)
KeyUp("SHIFT")
end function
function ReadXY(byref x,byref y)
KSP_ReadMemory(&H7AE44C,2,add)
KSP_ReadMemory(add+&H8,2,addxy)
KSP_ReadMemory(addxy+&H44,3,addx)
KSP_ReadMemory(addxy+&H4c,3,addy)
x=Int(addx)
y=Int(addy)
ReadXY=true
end function
function Readhas(byref hp,byref ap,byref sp)
KSP_ReadMemory(&H7E5E2C,2,has)
KSP_ReadMemory(has+&HF4,2,h1)
KSP_ReadMemory(h1+&H94,2,hp)
KSP_ReadMemory(has+&HF8,2,a1)
KSP_ReadMemory(a1+&H94,2,ap)
KSP_ReadMemory(has+&HFC,2,s1)
KSP_ReadMemory(s1+&H94,2,sp)
Readhas=true
end function
function ReadMax(byref mhp,byref map,byref msp)
KSP_ReadMemory(&H7E5E2C,2,has)
KSP_ReadMemory(has+&HF4,2,h1)
KSP_ReadMemory(h1+&H90,2,mhp)
KSP_ReadMemory(has+&HF8,2,a1)
KSP_ReadMemory(a1+&H90,2,map)
KSP_ReadMemory(has+&HFC,2,s1)
KSP_ReadMemory(s1+&H90,2,msp)
ReadMax=true
end function
function ReadGhp
KSP_ReadMemory(&H7e5f40,2,addg)
KSP_ReadMemory(addg+&H2f0,2,addg1)
KSP_ReadMemory(addg1+&H94,2,Ghp)
ReadGhp=Ghp
end function
function ReadFG
KSP_ReadMemory(&H7A7308,2,abc1)
KSP_ReadMemory(abc1+&H14,2,abc2)
KSP_ReadMemory(abc2+&H324,2,abc3)
KSP_ReadMemory(abc3+&H10,2,abc4)
KSP_ReadMemory(abc4+&H3C,2,abc)
ReadFG=abc
end function
function HPAPSP
Readhas(HP,AP,SP)
ReadMax(MHP,MAP,MSP)
HP1=Int(HP/MHP*100)
HP2=Int(HP/MHP*100)
AP1=Int(AP/MAP*100)
AP2=Int(AP/MAP*100)
SP1=Int(SP/MSP*100)
SP2=Int(SP/MSP*100)
if HP1<65 then
KeyPress("F1")
Wait(100)
SKeyPress("7")
Print("施放按鍵S_7輔助技能")
Wait(2000)
end if
if HP2<80 then
KeyPress(HPkey2)
end if
if hp = 0 then
Beep(1000,200)
Wait(3000)
MsgBox("人物hp=0", 1)
end if
if AP1<20 then
KeyPress(APkey1)
end if
if AP2<30 then
KeyPress(APkey2)
end if
if SP1<20 then
KeyPress(SPkey1)
end if
if SP2<30 then
KeyPress(SPkey2)
end if
end function
function Xkey
Readhas(HP,AP,SP)
ReadMax(MHP,MAP,MSP)
if Int(HP/MHP*100) <= XHP then
Xk=1
elseif Int(AP/MAP*100) <= XAP then
Xk=1
elseif Int(SP/MSP*100) <= XSP then
Xk=1
else
Xk=0
end if
if Xk=1 then
KeyPress("x")
st=GetTime()
do
if GetTime()-st > XTime * 1000 then
exit do
end if
if ReadGHP()>1 then
KillG()
st=GetTime()
Wait(100)
KeyPress("x")
end if
Readhas(HP,AP,SP)
ReadMax(MHP,MAP,MSP)
loop until HP=MHP and AP=MAP and SP=MSP
end if
Xk=0
end function
function FindG
hpapsp()
Xkey()
KeyPress("tab")
if ReadFG()=1 then
//if ReadGhp()=GHP1 or ReadGhp()=GHP2 or ReadGhp()=GHP3 then //啟用打指定怪物,去掉if前面的//
KillG()
//end if //啟用打指定怪物,去掉end if前面的//
end if
Wait(100)
end function
function KillG
key1=GetConfigString("首發攻擊快捷鍵")
stt=GetTime()
GWHP1=ReadGHP(3100/3100)
GWHP2=ReadGHP(3000/3000)
do
KeyPress(key1)
Wait(1000)
KeyPress("2")
Wait(1000)
KeyPress("3")
Wait(1000)
KeyPress("4")
Wait(1200)
KeyPress("5")
Wait(1000)
HPAPSP()
if gettime()-stt>3*1000 then
GWhp2=ReadGHP()
if GWhp1=GWhp2 then
print("卡怪!!!Tab換怪")
keypress("Tab")
exit do
end if
end if
if ReadGhp()=0 or ReadFG()=0 then
exit do
end if
Wait(1000)
loop
KeyPress("W",800)
SetTime=GetTime()
do
KeyPress("6")
hpapsp()
Wait(100)
loop until GetTime()-SetTime > 100
do
KeyPress("esc")
hpapsp()
loop until ReadFG()=0
end function
function DoFight(add,byref CT,byref YT)
cur=1
p=InStr(cur,add,":")
CT=Mid(add, cur, p-cur)
cur=p+1
p=InStr(cur,add,",")
YT=Mid(add, cur, p-cur)
end function
function STime
if ReadGhp()>1 then
KillG()
exit function
else
if S1 <> "=" then
if Time1 < 0 or GetTime() - Time1 > CNum(S1) * 1000 then
Time1 = GetTime()
KeyPress("F1")
Wait(100)
SKeyPress("1")
Print("施放按鍵S_1輔助技能")
Wait(2000)
end if
end if
if S2 <> "=" then
if Time2 < 0 or GetTime() - Time2 > CNum(S2) * 1000 then
Time2 = GetTime()
KeyPress("F1")
Wait(100)
SKeyPress("2")
Print("施放按鍵S_2輔助技能")
Wait(2000)
end if
end if
if S3 <> "=" then
if Time3 < 0 or GetTime() - Time3 > CNum(S3) * 1000 then
Time3 = GetTime()
KeyPress("F1")
Wait(100)
SKeyPress("3")
Print("施放按鍵S_3輔助技能")
Wait(2000)
end if
end if
if S4 <> "=" then
if Time4 < 0 or GetTime() - Time4 > CNum(S4) * 1000 then
Time4 = GetTime()
KeyPress("F1")
Wait(100)
SKeyPress("4")
Print("施放按鍵S_4輔助技能")
Wait(2000)
end if
end if
if S5 <> "=" then
if Time5 < 0 or GetTime() - Time5 > CNum(S5) * 1000 then
Time5 = GetTime()
KeyPress("F1")
Wait(100)
SKeyPress("5")
Print("施放按鍵S_5輔助技能")
Wait(2000)
end if
end if
if S6 <> "=" then
if Time6 < 0 or GetTime() - Time6 > CNum(S6) * 1000 then
Time6 = GetTime()
KeyPress("F1")
Wait(100)
SKeyPress("6")
Print("施放按鍵S_6輔助技能")
Wait(2000)
end if
end if
if S7 <> "=" then
if Time7 < 0 or GetTime() - Time7 > CNum(S7) * 1000 then
Time7 = GetTime()
KeyPress("F1")
Wait(100)
SKeyPress("7")
Print("施放按鍵S_7輔助技能")
Wait(2000)
end if
end if
end if
end function
function StopAllKey
KeyUp("w")
KeyUp("s")
KeyUp("a")
KeyUp("d")
end function
function GetAngle(fromX, fromY, toX, toY)
dim angle
if toX-fromX=0 then
angle=pi/2
else
angle=Atn((toY-fromY)/(toX-fromX))
end if
if toX-fromX <0 then
angle=angle+pi
end if
GetAngle=angle
end function
function GotoXY(destX, destY)
dim lastX, lastY, currentX, currentY
if not ReadXY(lastX, lastY) then
GotoXY=false
exit function
end if
if Ab●嚴禁張貼廣告● or Ab●嚴禁張貼廣告● then
arrived=false
KeyDown("w")
do
wait(200)
if not ReadXY(currentX, currentY) then
StopAllKey()
GotoXY=false
exit function
end if
if Abs(currentX-destX)<10 and Abs(currentY-destY)<10 then
StopAllKey()
GotoXY=true
exit function
end if
desiredAngle = GetAngle(currentX, currentY, destX, destY)
if currentX <> lastX or currentY <> lastY then
currentAngle=GetAngle(lastX, lastY, currentX, currentY)
dAngle=desiredAngle-currentAngle
if dAngle > pi then
dAngle=dAngle-pi*2
end if
if dAngle < -pi then
dAngle=dAngle+pi*2
end if
KeyUp("a")
KeyUp("d")
if Abs(dAngle)>pi/8 then
if dAngle<0 then
KeyDown("d")
else
KeyDown("a")
end if
end if
end if
lastX=currentX
lastY=currentY
loop while not arrived
StopAllKey()
end if
end function
Function SetWindowCaption(winid_subin , winText_subin)
DllCall("user32.dll","int","SetWindowTextA","int",winid_subin,"str",winText_subin)
end function
function main
init()
STime()
while true
FindG()
STime()
GotoXY(x,y)
wend
end function
function OnEnd
Beep(500, 100)
end function |