游戏地址
qQ]]~
F www.fgcq996.com %kshQ%P)? 那年传奇百区1.76 Q>< 0[EPj3 ,E )|y4 找到 lua_State 然后调用下面的函数就能实现功能
#KlCZ~s 一个跑单狗注意qq1946913194
]e?x# <S 游戏账号密码。fanren9527 qq2293307009 -V.d?A4"
Ol_q{^
搞完演示完,删除好友跑单 w f.T3 E0n6$5Uc? --自动寻路Ex
8 .>/6M function API_AutoMoveEx(mapX, mapY)
^Q<mV*~ ssr.AutoMoveBegin(mapX, mapY, ssr.GetCurMapData().mapID)
]b?9zeT*'l local inputProxy = global.Facade:retrieveProxy(global.ProxyTable.PlayerInputProxy)
;E^K.6 local pathPoints = inputProxy:GetPathFindPoints()
!U%T&?E l if pathPoints == nil then
:iWS\G^U return 0
cZ8.TsI~ end
O`1! return #pathPoints
Hh;:`;}
end
w*9br SK y[};J
vk --自动寻路
"_UdBG function API_AutoMove(mapX, mapY)
HeGYu?& ssr.AutoMoveBegin(mapX, mapY, ssr.GetCurMapData().mapID)
#18 FA| local inputProxy = global.Facade:retrieveProxy(global.ProxyTable.PlayerInputProxy)
pmvT$;7I local pathPoints = inputProxy:GetPathFindPoints()
.wA+S8}S if pathPoints == nil then
+EXJ\wy return 0
*A 'FC|\ end
SMr13%KN/ return #pathPoints
Ga>uFb}W~ end
ZzGahtx)Y K kW;-{c --停止寻路
{=2DqkTD function API_AutoMoveEnd()
:(|'S4z global.Facade:sendNotification(global.NoticeTable.AutoMoveEnd)
Z6C=T;w end
<yA}i"-1W VZka}
7a --自动打怪
)m3Uar function API_AutoFight(isAFK)
zdl%iop3e if isAFK then
e!-,PU9+ if not IsAFKState() then
6Q&r0>^{ global.networkCtl:SendMsg(global.MsgType.MSG_CS_AUTOPLAYGAME_REQUEST, 1)
uE/T2BX* global.Facade:sendNotification(global.NoticeTable.AFKBegin)
{~GYj%-^ end
qVqRf.-\ else
g6t"mkMY
L if IsAFKState() then
aVs(EHF
global.networkCtl:SendMsg(global.MsgType.MSG_CS_AUTOPLAYGAME_REQUEST, 2)
( lm&*tKm global.Facade:sendNotification(global.NoticeTable.AFKEnd)
POI.]1i end
6DTTV66 end
^jB8Q end
%VJ85^B
3 0-Y:v(|. function IsAFKState()
Jq.lT(E8D local AutoProxy = global.Facade:retrieveProxy(global.ProxyTable.Auto)
BaF!O5M return AutoProxy:IsAFKState()
f"u*D,/sS end
-Y#sI3o*R8 `?g`bN`Vn --打开自动穿戴
#t8{R~y"gv function API_AutoDress()
s.Y4pWd5@ --不抢别人归属
=;a!u global.MMO.SETTING_IDX_NO_ATTACK_HAVE_BELONG =1
Z7rJ}VP global.MMO.SETTING_IDX_AUTO_PUT_IN_EQUIP = 1
Cb t{H}I3 local ServerOptionsProxy = global.Facade:retrieveProxy(global.ProxyTable.ServerOptionsProxy)
moj]j`P5a ServerOptionsProxy._data["autoDress"] = 1
n]_[NR) i global.ConstantConfig.autousetimes = 0
WF&[HKOy/ end
W1Lr_z6
tY${M^^<J --强制打开自动挂机拾取
l- pe4x function API_AutoPick()
dCe4u<so\ local ItemConfigProxy = global.Facade:retrieveProxy(global.ProxyTable.ItemConfigProxy)
`nXVE+E@ local config = ItemConfigProxy.config
V"o7jsFH6n for k, v in pairs(config) do
<:FP4e
"( --local res = string.gsub(v.pickset, "0", "1")
G0 J4O!3 v.pickset = v.pickset .. 1
]r!>{ end
>KLtY|o) end
=h6
sPJ #ge)2 --获取人物坐标
WO4=Mte? function API_GetMapXY()
>7`<!YJkK return ssr.GetMainPlayerMapPos()
'TC/vnM end
yH 9!GS# LTV{{Z+ --获取人物状态
4D%9Rc0 G function API_GetAction()
anw}w!@U local player = global.gamePlayerController:GetMainPlayer()
1be %G [* local list = global.playerManager.mPlayersInCurrViewField
p9U?!L!y return player:GetAction()
B&+`)E{KB end
r"2V @RFs/' --设置宠物状态
>h2%[j= function API_PetSleep(isSleep)
-4w=s|#.\ local SummonsProxy = global.Facade:retrieveProxy(global.ProxyTable.SummonsProxy)
n~V4nj&_T if not SummonsProxy:IsAlived() then
87%*+n:?* return false
"vYE+ end
/yz=Cj oz if isSleep then
hv 6@Jr3 SummonsProxy:RequestModeChange(2)
iqQUtE]E_ else
#*$P'r SummonsProxy:RequestModeChange(4)
OH^N" L end
t>GfM end
Ok7t@l$ {qW~"z*
--获取人物数据
aSuM2 function API_GetGamePlayer()
H.<a`mm8 local player = global.gamePlayerController:GetMainPlayer()
+;g{$da5 local list = global.playerManager.mPlayersInCurrViewField
l+V,DCE local person = {}
?&LZB}1
R person["等级"] = player:GetLevel()
\$aF&r<R person["职业"] = player:GetJobID()
$WYbm}j person["名字"] = player:GetName()
;4M><OS! person["金币"] = ssr.GetMoneyCountById(1)
M/?KV9Xk2 person["元宝"] = ssr.GetMoneyCountById(2)
]eQV,Vt person["绑金"] = ssr.GetMoneyCountById(3)
[%50/_h return person
IKtB; end
pL1Q7&&c0 Nw& !}#m function API_GetGamePlayerLevel()
G2LK] local player = global.gamePlayerController:GetMainPlayer()
M<SdPC(+ return player:GetLevel()
i&njqK!wS end
-LDCBc" |py6pek| --获取周围怪物
y-p70.'{U function API_GetMonster()
x\&`>>uA local list = global.monsterManager.mMonstersInCurrViewField
B/5=]R local actors = {}
ihh4pD27g for k, v in pairs(list) do
!3iGz_y local actor = {}
mNf8kwr actor["mID"] = v:GetID()
E3@QI?n^^ actor["mName"] = v:GetName()
=.]l*6WV actor["mRace"] = v:GetRace()
yc2/~a_Gx actor["mType"] = v:GetType()
E_F5(xSA actor["mSubType"] = v:GetSubType()
i,V;xB2 actor["mX"] = v:GetMapX()
,\ 2a=Fp actor["mY"] = v:GetMapY()
4!asT;`' actor["mAction"] = v:GetAction()
Uie?9&3 actor["mTypeIndex"] = v:GetTypeIndex()
-U<Upn)2 actor["mAnimationID"] = v:GetAnimationID()
ZT02"3F actor["mLv"] = (v.GetLevel and { v:GetLevel() } or { 0 })[1]
V._6=ZJ actor["mSex"] = (v.GetSexID and { v:GetSexID() } or { 0 })[1]
X1IeSMAe actor["mJobID"] = (v.GetJobID and { v:GetJobID() } or { 0 })[1]
}?cGf-c actor["mHP"] = (v.GetHP and { v:GetHP() } or { 0 })[1]
5qg2Zc~ actor["mHPMax"] = (v.GetMaxHP and { v:GetMaxHP() } or { 0 })[1]
9_\'LJ actor["mMP"] = (v.GetMP and { v:GetMP() } or { 0 })[1]
=ji1S}e~p actor["mMPMax"] = (v.GetMaxMP and { v:GetMaxMP() } or { 0 })[1]
AC
O)Dt(Y actor["mOwnerID"] = (v.GetOwnerID and { v:GetOwnerID() } or { "" })[1]
;!o]wHmA actor["mOwnerName"] = (v.GetOwnerName and { v:GetOwnerName() } or { "" })[1]
y@j,a actor["mGuildName"] = (v.mGuildName and { v.mGuildName } or { "" })[1]
0JgL2ayIVI actor["mColor"] = "0xFFFFFF"
`28};B> if v:GetType() == global.MMO.ACTOR_PLAYER then
VIP7OHJh local batch_label = global.MMO.HUD_TYPE_BATCH_LABEL
*Ype>x{ local label_name = global.MMO.HUD_LABEL_NAME
nf1#tlIJd local hudName = global.HUDManager:GetHUD(v:GetID(), batch_label, label_name)
d!K
sNkk if hudName then
2^t#6XBk/ actor["mColor"] = GetColorHexFromRBG(hudName:getColor())
2<&Bw2 end
uE[(cko end
{k4CEt; table.insert(actors, actor);
r
'CM end
vHAg-Avc c PgfTT return actors
2&+#Vsm`V end
J--m[X Ggh.dZI4 --遍历周围玩家
c4_`Ew^k function API_GetPlayer()
[Q\GxX. local list = global.playerManager.mPlayersInCurrViewField
H
k
>79}; local actors = {}
v7%X@j]ji for k, v in pairs(list) do
n~g)I& local actor = {}
9Rek4<5 actor["mID"] = v:GetID()
!-m&U4Ku6o actor["mName"] = v:GetName()
6"c1;P!4 actor["mRace"] = v:GetRace()
s5RjIa0$7 actor["mType"] = v:GetType()
v+jsC`m actor["mSubType"] = v:GetSubType()
h25G/` actor["mX"] = v:GetMapX()
K"
<PGOF actor["mY"] = v:GetMapY()
tb:L\A^: actor["mAction"] = v:GetAction()
K:'q>D@ actor["mTypeIndex"] = v:GetTypeIndex()
;"O&X<BX- actor["mAnimationID"] = v:GetAnimationID()
h._nK\ actor["mLv"] = (v.GetLevel and { v:GetLevel() } or { 0 })[1]
liR? actor["mSex"] = (v.GetSexID and { v:GetSexID() } or { 0 })[1]
7W6cM%_B actor["mJobID"] = (v.GetJobID and { v:GetJobID() } or { 0 })[1]
g}p;\o
actor["mHP"] = (v.GetHP and { v:GetHP() } or { 0 })[1]
[4fU+D2\d actor["mHPMax"] = (v.GetMaxHP and { v:GetMaxHP() } or { 0 })[1]
X2tk
[Kr actor["mMP"] = (v.GetMP and { v:GetMP() } or { 0 })[1]
K^_i%~ actor["mMPMax"] = (v.GetMaxMP and { v:GetMaxMP() } or { 0 })[1]
_U;eN|Ww actor["mOwnerID"] = (v.GetOwnerID and { v:GetOwnerID() } or { "" })[1]
s>0Nr actor["mOwnerName"] = (v.GetOwnerName and { v:GetOwnerName() } or { "" })[1]
h^
-.]Y actor["mGuildName"] = (v.mGuildName and { v.mGuildName } or { "" })[1]
"NRDNqj( actor["mColor"] = "0xFFFFFF"
tbnH,* if v:GetType() == global.MMO.ACTOR_PLAYER then
)
BfT7{WN local batch_label = global.MMO.HUD_TYPE_BATCH_LABEL
qQ!1t>j+H local label_name = global.MMO.HUD_LABEL_NAME
0O k,oW{ local hudName = global.HUDManager:GetHUD(v:GetID(), batch_label, label_name)
&z"krM]G if hudName then
b':|uu*/ actor["mColor"] = GetColorHexFromRBG(hudName:getColor())
DzQ1%! end
Z):n c% S end
lpH=2l$>? table.insert(actors, actor);
T#pk]c6Q end
SI:U0gUc return actors
8Ld:"Y# end
b3wM;jv mMMQ|ea --遍历周围玩家EX
OB~X/ function API_GetPlayerExe()
"O8gJ0e local s1 = API_GetPlayer()
<p;k)S2J local result = ""
/ywD{* for k, v in pairs(s1) do
X=8Y% local s2 = string.format(
b$k&dT\o "mID=%s,mName=%s,mRace=%s,Dura=%s,mType=%s,mSubType=%s,mX=%s,mY=%s,mAction=%s,mTypeIndex=%s,mAnimationID=%s,"
2,aPr:] , v["mID"]
IrMl:+t\ , v["mName"]
+GsWTEz , v["mRace"]
XC7%vDIt , v["Dura"]
Le"oAA#[ , v["mType"]
\7"@RHcihB , v["mSubType"]
8 6f2'o+ , v["mX"]
#_mi `7!B# , v["mY"]
(M
=Y&M'f , v["mAction"]
UD~p'^.m_ , v["mTypeIndex"]
i&8FBV- , v["mAnimationID"])
*5<Sr q' local s3 = ""
:';L/x> local s3 = string.format("mLv=%s,mSx=%s,mJD=%s,mHP=%s,mHPx=%s,mMP=%s,mMPx=%s,mOID=%s,OwN=%s,mGld=%s,mCor=%s"
y8VpFa , v["mLv"]
(Qgde6 , v["mJobID"]
s:00yQ , v["mHP"]
kY]W
Qu , v["mHPMax"]
S4witIK5 , v["mMP"]
x.1-)\ , v["mMPMax"]
KJE[+R H+z , v["mOwnerID"]
4@.|_
zY , v["mOwnerName"]
VL'
fP2 , v["mGuildName"]
uP\lCqK, , v["mColor"])
Pmi#TW3X result = result .. s2 .. s3 .. "\r\n"
RtG}h[k/X end
^IKO2Ft return result
~x{.jn end
K^r)CCO 7u\*_mrv --遍历周围指定NPC
(;. AS function API_GetNpcIdByName(npcName)
?S
?2 0 local npcVec = global.npcManager:FindNpcInCurrViewField()
LJX-AO.4 local npc = {}
`>DP,D)w( for k, v in pairs(npcVec) do
XPB9~:: local npcs = {}
=66Nw(E. npc[v["mID"]] = v["mName"]
D@EO=08<b end
5>J=YLq for key, value in pairs(npc) do
$3D'4\X~? local sPos, ePos = string.find(value, npcName)
!L5jj#0 if sPos then
X0{/ydGF8 return key
jkiTj~WE- end
RFh"&0[ end
E{HY!L[ return nil
q P ;A}C end
y}C`&nW[= mVtXcP4b --NPC名称打开NPC
OL7_'2_z. function API_NpcTalk(npcName)
HE<1v@jW local npcid = API_GetNpcIdByName(npcName)
Y-ux7F{=z local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
+l^LlqA NPCProxy:RequestTalk(npcid)
{b]aC end
QZ
`tNq :/ :a:[. --NPCID打开NPC
_WX#a|4h{ function API_NpcTalkEx(npcid)
A?G IBjs local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
b]E|* NPCProxy:RequestTalk(npcid)
0i
CPi)B end
EL3|u64GO @v\*AYr'M function API_GetNpcTalkData()
,fEO>
i local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
`P Xz local talkData = NPCProxy:GetCurrentNPCTalkData()
T^Ab!O return talkData
n6F/Ac: end
J==SZ v
,mPnQ? function API_GetAllLink()
Oo?,fw local talkData = API_GetNpcTalkData()
y80ykGPT\& _w@qr\4i= local acts = {}
p8wyEHB local kv = {}
D+lzFn$3 P#v*TD' for line in talkData.content:gmatch("(text=.->)") do
X &2oPo
if string.find(line, "@") then
i?Ss: v^ local key = line:match("text=(.-)|")
:hG
PTf <lr*ZSNY local value = line:match("(@.-)>")
jClj_E kv[key] = value
]0D}T'wM end
z}SND9-" end
%7Kooq(i Qy#)Gxp for result in talkData.content:gmatch("(@.-)>") do
,_!6U table.insert(acts, result)
`"vZ);i< end
&Bx
J local sendData = {
wix5B@ UserID = talkData.npcID,
TEUY3z[g index = talkData.index,
iE0ab,OF --Act = "@blbumj",
=TR,~8Z| --commonInput = jsonData.commonInput,
sqx`">R --inputID= jsonData.inputID,
\Mv":Lm1 }
AvR2_ return acts, kv, sendData
5>9Y|UU end
c41: !u^ -ZW0k@5g --按索引号点击按
!gwjN_ZJ^ function API_ClickLinkByIndex(index)
-#-p1^v} acts, kv, sendData = API_GetAllLink()
r!}al5~& sendData["Act"] = acts[index + 2]
Q bhW!9(, local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
wx=0'T-[ NPCProxy:ExecuteWithJsonData(sendData)
+@X5!S6 end
Z,N$A7SBE GC8}X;((Y --按索购买引号点击按
w^K^I_2ge function API_ClickBuyLinkByIndex(index)
v"+k~:t* acts, kv, sendData = API_GetAllLink()
`ir3YnT+ sendData["Act"] = acts[index]
y0v]N local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
FDR1Gy NPCProxy:ExecuteWithJsonData(sendData)
}aB#z<B6 end
`Lyq[zg8 xChI,~i --按名称点击按
`,wu}F85 function API_ClickLinkByName(linkName)
89o)M5KQ acts, kv, sendData = API_GetAllLink()
t?;T3k[RM sendData["Act"] = kv[linkName]
Dj-s5pAW local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
{5c]Mn"r NPCProxy:ExecuteWithJsonData(sendData)
jc_\'Gr+[ end
X
fz`^x>M jdevat,&u --出售物品
us?&:L|!= function API_Sell(npcName,itemsName)
OH<?DcfeL local npcId=API_GetNpcIdByName(npcName)
UVf\2\ Y local bagData=ssr.getBagData()
NGjdG=, for k,v in pairs(bagData) do
L{g E'jCC if string.find(itemsName,v.Name) then
{u7##Vrgt8 --if #v["Values"]<2 then
3l!NG=R local Name = v.Name
l#3($QV, local MakeIndex = v.MakeIndex
!- C' } local networkCtl = global.networkCtl
`=tyN@VC networkCtl:SendMsg(global.MsgType.MSG_CS_NPC_STORE_SELL_ITEM, npcId, MakeIndex , 0, 0, Name , string.len(Name) )
b|^I<7 --end
^ L:cjY/ end
Hv#q:R8 end
E]^5I3=O end
lD;'tqaC --全部卖
]^"k8v/ function API_SellAll(npcName)
x:K?\< local npcId=API_GetNpcIdByName(npcName)
~#Md"3 local bagData=ssr.getBagData()
dOa!htx] for k,v in pairs(bagData) do
B\j~)vg --if #v["Values"]<2 then
lp&!lb` local Name = v.Name
)J/HkOj"V local MakeIndex = v.MakeIndex
ScnY3&rc local networkCtl = global.networkCtl
&!7+Yb(1 networkCtl:SendMsg(global.MsgType.MSG_CS_NPC_STORE_SELL_ITEM, npcId, MakeIndex , 0, 0, Name , string.len(Name) )
ic6L9>[ --end
jRkC/Lw
end
Mjpo1dw end
Iyk6=&?j t[.W$1
= kD~uGA --NPC购买
\hk/1/siyF function API_Buy(npcName,itemName,count)
w=r&?{ --进入子菜单
"5DJu~ local sendData =
"i'bTVs {
.I?@o8'x UserID = API_GetNpcIdByName(npcName),
#/J
'P[z Name = itemName,
^Uw[x\%#gD }
^.X [)U SendTableToServer(1015, sendData)
g: %9jf local function ToBuy()
lHBI local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
~HLRf
L? local list = NPCProxy.facade.view.mediatorMap.NPCStoreMediator._layer.itemList
_rQUE^9 for i=1,count do
90 {tI X if i>#list then
Qb^q+C)o] break
6DS43
AQs end
2iXoj&3e sendData.MakeIndex= list[#list-i].MakeIndex
ka7uK][ SendTableToServer(1014, sendData)
y<r}"TAf- end
/dHs &SU, API_CloseNpcTalk()
-$Y8!5 4 end
X\GM/A local scheduleID = ssr.PerformWithDelayGlobal(ToBuy, 1)
5P^ U_ end
,^T]UHRO [p;*r)f2} ft5DU/% function 打开子项(item)
wuK=6RL local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
.{dE}2^ if item.SubMenu == 1 then
K\=8eg93Z NPCProxy:RequestNpcStoreItemList(item)
"|LQK0q3 end
G^h_YjR`* end
QrjDF> 2JO-0j. function 子项购买(count)
* UcjQ local list = NPCProxy.facade.view.mediatorMap.NPCStoreMediator._layer.itemList
vx 0UoKX for i = 1, count do
#0y<a:}R if i > #list then break end
&a~=b, NPCProxy:RequestNpcStoreBuy(list
) 3_ 2hC!u!K end vgPUIxB@ end c;!g W04av_u 5 --登录角色 E1q%gi4 Q% ;"7/@&M\m function API_LoginRole(index) 2/Nq
' local LoginProxy = global.Facade:retrieveProxy(global.ProxyTable.Login) y,C!9l LoginProxy:SetSelectedRoleByIndex(index) 5rN_jC*U LoginProxy:RequestEnterGame() g,lY ut global.Facade:sendNotification(global.NoticeTable.Audio_Stop_BGM) _,;%mK end 'Tf9z+0; IvU{Xm"qB --登录 L4974E?S function API_Login(name, password) 3A0_C?E local AuthProxy = global.Facade:retrieveProxy(global.ProxyTable.AuthProxy) b;vNq local data = {} ~Yk"Hos data.type = 1 hTS|_5b data.username = name )LFD6\z1pl data.password = password ?vbDB 4 AuthProxy:RequestLogin(data) b :\D\X end Lo3-X g^lFML|
% --开门 mx tgb$* function API_EnterRoom(x, y) Lt<oi8'N
local qq = ssr.GetCurMapData() aPBX=;( global.networkCtl:SendMsg(global.MsgType.MSG_CS_OPEN_DOOR_REQUEST, 0, x, y) OXtBJYe local function callback() )mD\d|7f ssr.AutoMoveBegin(x, y, qq.mapID) PZ]5Hf1" end i.@*tIK SL:ScheduleOnce(callback, 0.5) (KF7zP end "\T"VS^pd gRvJ.Q {h --多开 E`E'<"{Yd function API_PcOpen() (&Q)EBdm LuaBridgeCtl:Inst():CheckClientCount(2)
U1\MA6pXW end 9+VF<;Xw FLbZ
9pX} --盒子显示 oI$V|D3 9 function API_hezi() 0/A-#'> global.L_GameEnvManager._envData["isBoxLogin"] = 1 A~y VYC6l end f)gGH'yOQ &-F"+v,+ --遍历背包物品 ;/A}}B]y function API_GetCurBagData() 1M+Zkak7p local s1 = ssr.getCurBagData() elKx]%k*) local result = "" YRa4W.&Yn for k, v in pairs(s1) do N{pa)
/ local s1 = string.format( HTNA])G "OverLap=%s,DuraMax=%s,Where=%s,Dura=%s,Name=%s,Shape=%s,MakeIndex=%s,Weight=%s,StdMode=%s,Index=%s" @a;sV!S{ , v["OverLap"]
>\\5
"Sf , v["DuraMax"] 5Fe-=BX( , v["Where"] yV_
L/,6}D , v["Dura"] TNsg pJ?\ , v["Name"] g\J)= ,ju, , v["Shape"]
kgc.8 , v["MakeIndex"] pGk"3.ce , v["Weight"] M)=|<h"F , v["StdMode"] # ITLz!gE , v["Index"])
@^HwrwRA local ss = "" }:^X X0:FK if #v["Values"] > 1 then [f(uqLdeM for x, y in pairs(v["Values"]) do ,?w!5N;iRO if y["Value"] > 0 then 1Zq local Values = string.format("m_Value=%s,m_ValueID=%s" d<Dn9,G , y["Value"] N[ Q#R~Hn< , y["Id"]) f(.6|mPp ss = ss .. Values N l|^o{# end }~GV'7d1 end c,AZ/t end n2;(1qr result = result .. s1 .. "," .. ss .. "\r\n" >Jiij end Tg\hx> return result P%jkKE?B4 end ?1DUNZ6 3:O+GQ* --获取背包是否满 vK'9{q|g function API_GetBagFull() [J:zE&aj return ssr.IsBagToFull(isTips) P=pY8X: end !G>(j 8!6<p[_ --获取背包百分比 -&7=uRQk function API_GetBagEx() Ps |QW HW = ssr.GetMetaValueByKey("BW") A?sNXhh MAXHW = ssr.GetMetaValueByKey("MAXBW") aKOf;^@ ELL = HW / MAXHW * 100 5F03y`@ u return math.ceil(ELL) r&/D~g\"|[ end <[FS%2,0mb (WkTQRcN, --获取背包是否满 [wIKK/O function API_GetBagFull() kI]=&Rw return ssr.IsBagToFull(isTips) p}r yKW\cJ end :7k`R62{ *
S{\#s --读取地图ID ZU^Q1}</5 function API_GetMapID() ZK!4>OuH` local tt = ssr.GetCurMapData() y8D 8Y8B return tt.mapID * T\
> end
3:"AFV ZnQ27FcW --读取地图名称 Lqq*Nr function API_GetMapName() Q%$i@JH`m local tt = ssr.GetCurMapData() dc)wu] return tt.mapName %N1T{ end _32/WQF6 o:f|zf>
i< --获取背包最大数 W=M<
c@ function API_GetMaxBag() P69>gBZYD return ssr.GetMaxBag() s|KfC># end D~7%};D[ z.{HD9TD --使用物品 f5N<3 m= function API_UseItem(itemName) -
Ra\^uz local items = ssr.getQuickUseData() V 3%Krn1' local item = ssr.getCurBagData() p0?o<AA%O for k, v in pairs(items) do &F9OZMK= if v.Name == itemName then {MA@A5 ssr.UseItemByIndex(v.Index) Z!k5"\{0pE end wo$|~
Hr end pO5v*oONz+ :Z]/Q/$ for k, v in pairs(item) do vr<)Ay if v.Name == itemName then K"G(?<>~4c ssr.UseItemByIndex(v.Index) J1& A,Gb end d7\k gh end |zg=+ end XZ!cW=bqS .;cxhgU --获取金币数量 e|35|I ' function API_GetMoney(Index) EOofa6f&l return ssr.GetMoneyCountById(Index) !;ZBL;qY9 end zmdWVFVv ho(5r5SNE function API_MergeTables(t1, t2) 6{lG1\o local merged = {} }isCvb for key, value in pairs(t1) do 55(J&q merged[key] = value `s#sE.=
o end tc!!W9{69 for key, value in pairs(t2) do 54;l*}8Hl merged[key] = value j#4+- end P~n8EO1r return merged .$n$%|"H- end K%k XS r=xTs,x
x MP_A<F --获取物品数量 `\nON function API_GetItemCount(itemName,isBind) N,h1$)\B# local items=ssr.getQuickUseData() ?hP<@L6K local bagData=ssr.getBagData() BJ_+z gf` items=API_MergeTables(items,bagData) b*@&c9I;q local bind=isBind or false ll 6]W~[ZC local count=0 {/th`#o4b for k,v in pairs(items) do QZ6[*_Z6 if bind then rwasH,+ --绑定 5~v(AB(x if v.Name==itemName and v.Bind~=nil then N:"M&EUM count=count+ v.OverLap s0_-1VU end A!Knp=Gw else "m
wl-= --不绑定 (9Fabo\SH if v.Name==itemName and v.Bind==nil then "
&_$V@S count=count+ v.OverLap t$ACQ*O
end s@.`"TF.7 end N`y}Gs end /h1d
m, return count A%.J%[MVz end K'a#M g --读取人物坐标 `%KpTh )er?*^9Z nNd`]F^U :|*Gnu function API_GetMapXY() xe"4u JO local aa = ssr.GetMainPlayerMapPos() byEvc[/>Ys local aa = string.format("x=%s,y=%s" p} t{8j> , aa.x =$
&7IQ? , aa.y) /5L' 9e return aa PU,6h} end H={O13 4r68`<mn[ -- 获取角色是否活着 m~Kch~~] function API_IsRoleAlive() Ec7{B
hH) return ssr.IsRoleAlive() .rt8]% end JUe K"|fA u=_bM2;~Z --读取聊天信息 yEMX ` function API_ChatMsg() U-wq- GT local function listcb(msg) 6R$F =MB --table JL}hOBqfI ChatTable = msg l Q=&jkw end lBizC5t!o ssr.RegisterLUAEvent("OnAddChatItem", "增加聊天消息", listcb)
[=]+lei if ChatTable.mt == 1 and ChatTable.ChannelId == 3 or ChatTable.ChannelId == 6 then Td["l!-fe local ChatT = string.format( UE}8Rkt "SendName=%s,SendId=%s,ChannelId=%s,mt=%s,SendTime=%s,Msg=%s" *qeic e%E , ChatTable.SendName =DeHxPv}f , ChatTable.SendId {[YqGv=fF , ChatTable.ChannelId s9ju/+fv , ChatTable.mt =;'ope(?S , ChatTable.SendTime tdMP,0u , ChatTable.Msg) 0})7of return ChatT 0~PXa(!^K end _mIa8K; end zN?$Sxttx y^EF<<\ function API_ChatMaa() sw 3:HNG= return ssr.GetMaxBag() >
{'5>6u end X+?Il)Bv
gQ[] --修理装备
glOqft&>` function API_CopyTable(original) ;PP_3` local copy = {} pXpLL_ for key, value in pairs(original) do Cg]3(3 if type(value) == "table" then m11"i=S" copy[key] = API_CopyTable(value) !0!P.Q8>& else +l[Z2mW copy[key] = value i?&4SG+2~K end 4U LJtM3 end K4h-4Qbn return copy r?Zy-yQ end 41
c
^\1 修衣服 = "0,4" --衣服,头盔 ;*<{*6;=? 修武器 = "1" MHpL$g=5_ 修项链 = "3" EyKkjEXx_ 修手镯 = "5,6" 6ywnyh 修戒指 = "7,8" --左戒指 右戒指 *783xEF>f function API_Repair(npcName, itemPos) i
ECC@g@
a local npcId = API_GetNpcIdByName(npcName) R"9oMaY local tempData = ssr.getEquipData() eCPKpVhP local tobeRepair = {} !R] CmK for k, v in pairs(tempData) do <ZHY3
if string.find(itemPos, tostring(v["Where"])) and v["Dura"] ~= v["DuraMax"] then VrAXOUJw6 local tmp = { TNX%_Q< Name = v.Name, VrnK)za*H MakeIndex = v.MakeIndex, #G[
*2h~99 Where = v.Where QXIbFv } Xj})?{FP table.insert(tobeRepair, tmp) x 1%J1?Fp ssr.TakeOffEquipRequest(v) ]|((b/L3
end [i<$ZP end
,\m;DR1 --脱完 开始修理 #um1?V for k, v in pairs(tobeRepair) do 4cErk)F4 local Name = v.Name 8vX*SrM local MakeIndex = v.MakeIndex *1I
D`o local networkCtl = global.networkCtl cW~6@&zp networkCtl:SendMsg(1023, npcId, MakeIndex, 0, 0, Name, string.len(Name)) BW;=i. end f<s'prF --开始穿 0%qctZy local function ToDress() P&-D0T_ for k, v in pairs(tobeRepair) do EE{#S ssr.TakeOnEquipRequest(v, v["Where"]) :Z*02JwK end Lv, ji_ end R5'Z4.~ local scheduleID = ssr.PerformWithDelayGlobal(ToDress, 1) @=MZ6q API_CloseNpcTalk() oC@"^>4 end w/^0tZ~ *'`3]!A ~'Qpf 8) 5w,YBUp 药店={0} vBCZ/F[ 首饰店={19,20,21,22,23,24,26} [6RV'7`Abj 衣服店={10,11,15,16,27,28,62,64}
'^.=gTk 武器店={5,6} _>_ y@-b 杂货店={3,25,2,30,31} !7,K9/" 铁匠铺={43} $Kw"5cm 书店={4} SCI-jf3WN --检测背包是否有指定类型物品 &ls!IN function API_IsNeedToStore(StdModes) +n8I(l= local function IsNeed(StdMode) x=)30y3*; local bagData=ssr.getBagData() hNR>Hy\ for k,v in pairs(bagData) do DoCQFSL if v.StdMode==StdMode then ?O.6 r" return true 2U+z~ end !w
;A= end nkCRe local EquipProxy = global.Facade:retrieveProxy(global.ProxyTable.Equip) (
F"& A? local equip = EquipProxy:GetEquipData() 00.iMmJ for k,v in pairs(equip) do YiI:uG!|D if v.StdMode==StdMode then 8G[Y9A(bmP if tonumber(v.Dura)/v.DuraMax < 0.9 then tUAY]BJ*s return true T0np<l]A end #(7RX} end 43orR !.Z end t+4%,n f_1 return false Ie`SWg*WL end ''\cBM!
7,&]1+n for k,v in pairs(StdModes) do Lct+cKKU if IsNeed(v) then |+4E
8;4_ return true ~A:;?A'. end QF.wtMGF& end Z+"E* return false "|l
oSf@ end /kviO@jm4( aD2CDu ]a%\Q2[c --范围内怪物个数 bool型返回distance M;Mdz[Q function API_范围内怪物个数(distance, count) ETH#IM8J local proxyUtils = requireProxy("proxyUtils") IpaJ<~ p
local mainPlayerID = global.gamePlayerController:GetMainPlayerID() J1y2Qw$G return proxyUtils.checkIsEnoughEnemy(mainPlayerID, count, distance) Jk6/i;4| end m?R+Z6c[ --关闭NPC框 sVm'9k function API_CloseNpcTalk() ReGO9} global.Facade:sendNotification(global.NoticeTable.Layer_NPC_Talk_Close) o y%g{,V global.Facade:sendNotification(global.NoticeTable.GuideEventEnded, {name = "GUIDE_END_NPC_TALK_LAYER_CLOSED"}) H@&"M% end k}Clq;G --无怪随机 /+JP~K function API_无怪随机() !f]3Riw-=, local list = global.monsterManager.mMonstersInCurrViewField i7w}`
vs local actors = {} n4d(` for k, v in pairs(list) do XGrxzO|{ local actor = {} raI~BIfe actor["mID"] = v:GetID() C>K"ZJ table.insert(actors, actor); ABYW1K= end ?Kz`
O>"6 if #actors < 1 then 9{J8q API_UseItem("随机传送石") Pc:'>,3!V3 local aa = API_GetItemCount(1078) !\|@{UJk/ if aa < 1 then apWrcaj ssr.BuyStoreItemsById(2, 1) WaO;hy~us end Z
YO/'YW end P*^UU\x'4I return #actors l=OC?d*m end >a]
s oIR%{`3"I --API_周围怪物数量 x: wq"X function API_周围怪物数量() PT*@#:MA local list = global.monsterManager.mMonstersInCurrViewField <HX-qNA? local actors = {} sVl:EVv for k, v in pairs(list) do }j<_JI local actor = {} sAAIyPJts actor["mID"] = v:GetID() 1~iBzPU2 table.insert(actors, actor); O!cO/]< end l[j0(T return #actors 2!& ;ZcT, end %;XuA*e Ita!07 --API_周围人物数量 参数是 白名单 HQ#L
|LN function API_视野内敌人(Name, lv) K>p:?w local list = global.playerManager.mPlayersInCurrViewField Fl(ZKpSZU local myName = global.gamePlayerController:GetMainPlayer():GetName() .;sPG local actors = {} Cr\/<zy1-e local names = myName .. "," .. Name y]z# ?? for k, v in pairs(list) do VQJ5$4a& local actor = {} mp$II?hZ* actor["mID"] = v:GetID() Gqu0M`+7 actor["mName"] = v:GetName() oM7-1O actor["mLv"] = (v.GetLevel and { v:GetLevel() } or { 0 })[1] ,T>2zSk --local myName=global.gamePlayerController:GetMainPlayer():GetName() j:<T<8.o if not string.find(names, actor["mName"]) and tonumber(actor["mLv"]) > lv then sU3V
)7"
table.insert(actors, actor); w0>)y- end 9 u89P end leqSS}KU+ return #actors HDG"a&$
end @ShJ: 9Yne=R/] )uJ`E8>- --自动捡 Z`h_oK#y15 API_NoBodyPickEnable=true )W7H{# *>H'@gS --捡取物品白名单 ~bQ:gArk API_MyPlayerNames = "我不是药神," o~N-x* 7`n8
OR4 --全图捡 NNV.x7 API_MapPickEnable = true |&*rSp2iH --自动存 IZ ha* 7 API_InStoreEnable=false \evgDZf API_InStoreItems="" ^O9m11 --自动扔 ep1Ajz.l API_ItemDropEnable=false
jS)-COk --自动用 S^_yiV
S API_ItemKeepCountEnable=true E*]L]vR --自动领取 3JO:n6 API_GetMailItemEnable=false f*f9:xUY --自动买回城石
]@
0V API_BuyStoneEnable=false 78A4n C API_RecoveryItemMaxMoney=1000000 b<MMli --地图 ,=yIfbFQ API_PreMapName="盟重省" JugQ +0 --开关 (.t:sn"P API_TimerEnable=true {-Oc8XI/ u"3cSuqy API_TimerEnable1s=true <