游戏地址
1>;6x^_h0S www.fgcq996.com kPedX 那年传奇百区1.76 ZI
y(<0 d~/xGB`< 找到 lua_State 然后调用下面的函数就能实现功能
3Tw%W0q 一个跑单狗注意qq1946913194
s
kY0 \V 游戏账号密码。fanren9527 qq2293307009 !ABLd|tP
un&> 搞完演示完,删除好友跑单 2<m
Q,,j w= B --自动寻路Ex
5 iv@@1c function API_AutoMoveEx(mapX, mapY)
SZE `J:w ssr.AutoMoveBegin(mapX, mapY, ssr.GetCurMapData().mapID)
c
}'Xoc local inputProxy = global.Facade:retrieveProxy(global.ProxyTable.PlayerInputProxy)
(xQI($Wq*M local pathPoints = inputProxy:GetPathFindPoints()
2{gwY85: if pathPoints == nil then
vC-[#]< return 0
!|(Ao"] end
`W="g6( return #pathPoints
R05T5Q1]A end
7_7xL(F/ .Nk6 --自动寻路
#'KY`&Tw& function API_AutoMove(mapX, mapY)
qw)Key ssr.AutoMoveBegin(mapX, mapY, ssr.GetCurMapData().mapID)
#4lHaFq local inputProxy = global.Facade:retrieveProxy(global.ProxyTable.PlayerInputProxy)
l`qP~
k# local pathPoints = inputProxy:GetPathFindPoints()
_-
(z@ if pathPoints == nil then
9<w=),R`8 return 0
Y`q!V= end
YpiRF+G
return #pathPoints
d(\ 1 }l end
"d:.*2Z2 1
3\Sh --停止寻路
wH!}qz/ function API_AutoMoveEnd()
Sn0Xl3yr
global.Facade:sendNotification(global.NoticeTable.AutoMoveEnd)
$'y1Po'2 end
L*IU0Jy> uiuTv)pwF --自动打怪
eA10xpM0 function API_AutoFight(isAFK)
pBvo M={2! if isAFK then
sq48#5Tc^r if not IsAFKState() then
pj j}K global.networkCtl:SendMsg(global.MsgType.MSG_CS_AUTOPLAYGAME_REQUEST, 1)
qjzZ} global.Facade:sendNotification(global.NoticeTable.AFKBegin)
$Q#?`j end
O2$!'!hz else
&!4(
0u if IsAFKState() then
/LSq%~UF global.networkCtl:SendMsg(global.MsgType.MSG_CS_AUTOPLAYGAME_REQUEST, 2)
~V!EtZG$ global.Facade:sendNotification(global.NoticeTable.AFKEnd)
(+@faP
end
Ag<4r end
65uZLsQ end
Vj29L?3 KZi+j#7O function IsAFKState()
)'w]YIv9 local AutoProxy = global.Facade:retrieveProxy(global.ProxyTable.Auto)
LuLy6]6D; return AutoProxy:IsAFKState()
5#P: "U end
2,+@#q -5o?#% --打开自动穿戴
Fu#Y7)r function API_AutoDress()
7/4~>D&-b --不抢别人归属
F61+n!%8 global.MMO.SETTING_IDX_NO_ATTACK_HAVE_BELONG =1
7Y4%R`9H global.MMO.SETTING_IDX_AUTO_PUT_IN_EQUIP = 1
e1oFnu2R local ServerOptionsProxy = global.Facade:retrieveProxy(global.ProxyTable.ServerOptionsProxy)
E8+8{
#f; ServerOptionsProxy._data["autoDress"] = 1
i4 P$wlO global.ConstantConfig.autousetimes = 0
l;XUh9RF`A end
B>R*
f C@g
I8:"h --强制打开自动挂机拾取
DCz\T
wzU function API_AutoPick()
ST#PMb'izn local ItemConfigProxy = global.Facade:retrieveProxy(global.ProxyTable.ItemConfigProxy)
IM$'J local config = ItemConfigProxy.config
EWSr@}2j
. for k, v in pairs(config) do
{6ajsy5= --local res = string.gsub(v.pickset, "0", "1")
d"z *Nb v.pickset = v.pickset .. 1
#3YdjU3w end
Mp!2`4rD end
`Uu^I
W5TqC --获取人物坐标
bx1G
CD function API_GetMapXY()
'Dnq+ return ssr.GetMainPlayerMapPos()
n}) end
"MW55OWYU :m)c[q8 --获取人物状态
>>/nuWdpO function API_GetAction()
1a \=0=[ local player = global.gamePlayerController:GetMainPlayer()
"pR $cS local list = global.playerManager.mPlayersInCurrViewField
H 3W_}f return player:GetAction()
o@Dk%LxP end
5/*)+ W=q?tD~V --设置宠物状态
k&n\
=tKN function API_PetSleep(isSleep)
[ e$]pN% local SummonsProxy = global.Facade:retrieveProxy(global.ProxyTable.SummonsProxy)
)kFme=
; if not SummonsProxy:IsAlived() then
mI2|0RWI)l return false
5L/Yi end
R
JQ/y3 if isSleep then
>:="?'N5l! SummonsProxy:RequestModeChange(2)
c>M_?::)0 else
V=:,]fTr SummonsProxy:RequestModeChange(4)
4&#vU(-H end
BASO$?jf4 end
fN~8L}!l ^!N;F" --获取人物数据
"#
[o?_GaJ function API_GetGamePlayer()
mm3zQ!2j. local player = global.gamePlayerController:GetMainPlayer()
ER0TY, local list = global.playerManager.mPlayersInCurrViewField
4KN0i local person = {}
}S
Y`KoC1 person["等级"] = player:GetLevel()
,q{lYX83S person["职业"] = player:GetJobID()
f:)]FHPB1 person["名字"] = player:GetName()
# Lu4OSM+ person["金币"] = ssr.GetMoneyCountById(1)
V*0Y_ T{_
person["元宝"] = ssr.GetMoneyCountById(2)
9?EY.}~ person["绑金"] = ssr.GetMoneyCountById(3)
b=6ZdN1 return person
=iA"; x end
=f/avGX <6~/sa4GN function API_GetGamePlayerLevel()
K+(m'3` local player = global.gamePlayerController:GetMainPlayer()
@Z"QA!OK~c return player:GetLevel()
w; yar=n end
b#bO=T$e- E;ndw/GZjR --获取周围怪物
GA({r
i function API_GetMonster()
jFI]54, local list = global.monsterManager.mMonstersInCurrViewField
EuhF$L1 local actors = {}
Ut0qrkqF for k, v in pairs(list) do
I$rW[l2 local actor = {}
5|{ t+u actor["mID"] = v:GetID()
r>n8`W actor["mName"] = v:GetName()
HJ2O@e actor["mRace"] = v:GetRace()
EfMG(oI actor["mType"] = v:GetType()
`K1PGibV actor["mSubType"] = v:GetSubType()
yTMGISX5 actor["mX"] = v:GetMapX()
cx,u2~43A& actor["mY"] = v:GetMapY()
% t,1_c0w actor["mAction"] = v:GetAction()
1aXIhk4 actor["mTypeIndex"] = v:GetTypeIndex()
X7(rg W8 actor["mAnimationID"] = v:GetAnimationID()
-Hl\j(D7 actor["mLv"] = (v.GetLevel and { v:GetLevel() } or { 0 })[1]
2nOe^X!* actor["mSex"] = (v.GetSexID and { v:GetSexID() } or { 0 })[1]
p1[WGeV actor["mJobID"] = (v.GetJobID and { v:GetJobID() } or { 0 })[1]
0~LnnDN actor["mHP"] = (v.GetHP and { v:GetHP() } or { 0 })[1]
Xmw2$MCB actor["mHPMax"] = (v.GetMaxHP and { v:GetMaxHP() } or { 0 })[1]
#)IdJ] actor["mMP"] = (v.GetMP and { v:GetMP() } or { 0 })[1]
YB(#]H|8S actor["mMPMax"] = (v.GetMaxMP and { v:GetMaxMP() } or { 0 })[1]
p;)klH@ X actor["mOwnerID"] = (v.GetOwnerID and { v:GetOwnerID() } or { "" })[1]
,58kjTM actor["mOwnerName"] = (v.GetOwnerName and { v:GetOwnerName() } or { "" })[1]
G5C#i7cpm actor["mGuildName"] = (v.mGuildName and { v.mGuildName } or { "" })[1]
\H}@-*z+) actor["mColor"] = "0xFFFFFF"
y0W`E/1t if v:GetType() == global.MMO.ACTOR_PLAYER then
0hEF$d6U local batch_label = global.MMO.HUD_TYPE_BATCH_LABEL
]kU~#WT local label_name = global.MMO.HUD_LABEL_NAME
SV$ASs local hudName = global.HUDManager:GetHUD(v:GetID(), batch_label, label_name)
X F
0*d~4 if hudName then
;1Tpzm actor["mColor"] = GetColorHexFromRBG(hudName:getColor())
9
u6
g end
lBYS>4~ end
2l;ge>DJ table.insert(actors, actor);
c;A
ew! end
O;.d4pO(tC yDl5t-0` return actors
IrVM|8vT3 end
|G5=>W @=^jpSnZ --遍历周围玩家
Xl gz.j7XR function API_GetPlayer()
{ILQ
CvP* local list = global.playerManager.mPlayersInCurrViewField
>Kqj{/SWK local actors = {}
6Wcn(h8%* for k, v in pairs(list) do
}1E_G local actor = {}
O>{t}6o actor["mID"] = v:GetID()
?j
; ,q actor["mName"] = v:GetName()
@5POgQ8 actor["mRace"] = v:GetRace()
M\x7=*\ actor["mType"] = v:GetType()
lVO(9sl*i actor["mSubType"] = v:GetSubType()
8I|1Pl actor["mX"] = v:GetMapX()
]MBJ"1F actor["mY"] = v:GetMapY()
}T&;*ww actor["mAction"] = v:GetAction()
}sm56}_ actor["mTypeIndex"] = v:GetTypeIndex()
\p_8YC actor["mAnimationID"] = v:GetAnimationID()
,&
{5,=
actor["mLv"] = (v.GetLevel and { v:GetLevel() } or { 0 })[1]
uvAy#, actor["mSex"] = (v.GetSexID and { v:GetSexID() } or { 0 })[1]
yM\tbT/l actor["mJobID"] = (v.GetJobID and { v:GetJobID() } or { 0 })[1]
$(!D/bvJ actor["mHP"] = (v.GetHP and { v:GetHP() } or { 0 })[1]
Y?q*hS0!H actor["mHPMax"] = (v.GetMaxHP and { v:GetMaxHP() } or { 0 })[1]
x<j($iv actor["mMP"] = (v.GetMP and { v:GetMP() } or { 0 })[1]
UBpM8 /U actor["mMPMax"] = (v.GetMaxMP and { v:GetMaxMP() } or { 0 })[1]
%QlBFl0a actor["mOwnerID"] = (v.GetOwnerID and { v:GetOwnerID() } or { "" })[1]
ui: >eYv actor["mOwnerName"] = (v.GetOwnerName and { v:GetOwnerName() } or { "" })[1]
ff2.|20 actor["mGuildName"] = (v.mGuildName and { v.mGuildName } or { "" })[1]
Y=#mx3. actor["mColor"] = "0xFFFFFF"
%[31ZFYB if v:GetType() == global.MMO.ACTOR_PLAYER then
0L
4]z'5 local batch_label = global.MMO.HUD_TYPE_BATCH_LABEL
cUX]tiC0 local label_name = global.MMO.HUD_LABEL_NAME
Yqj.z| }Nb local hudName = global.HUDManager:GetHUD(v:GetID(), batch_label, label_name)
mYU dh L^ if hudName then
zke~!"iq actor["mColor"] = GetColorHexFromRBG(hudName:getColor())
tue%L]hc end
%)!~t8To end
%d~9at6-B table.insert(actors, actor);
`dq3
= end
5<>R dLo return actors
5>^ W}0s end
J0Rz.=Y ;#Bh_f --遍历周围玩家EX
ag*Hs<gi function API_GetPlayerExe()
~N+/ZVo&y local s1 = API_GetPlayer()
^5iY/t~Q local result = ""
e&VR>VJEA for k, v in pairs(s1) do
uR[PKLh local s2 = string.format(
I'wk/ "mID=%s,mName=%s,mRace=%s,Dura=%s,mType=%s,mSubType=%s,mX=%s,mY=%s,mAction=%s,mTypeIndex=%s,mAnimationID=%s,"
znDtM1sLeV , v["mID"]
q2"'W|I , v["mName"]
smQpIB; , v["mRace"]
t,as{.H{h , v["Dura"]
Z!BQtICs , v["mType"]
j,V$vK P , v["mSubType"]
JCMEhI6d* , v["mX"]
t.i9!'Y ] , v["mY"]
w[n>4?"{ , v["mAction"]
4wEpyQ|L , v["mTypeIndex"]
TW;;OS[ , v["mAnimationID"])
)}g4Rvr local s3 = ""
*p<5(-J3 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"
g{f>jd , v["mLv"]
F<'l'AsC- , v["mJobID"]
I]j/ ab7> , v["mHP"]
77[
;J , v["mHPMax"]
hSf#;=9' , v["mMP"]
$9u , v["mMPMax"]
6
Ge vO3 , v["mOwnerID"]
}sN9QgE , v["mOwnerName"]
0jx~_zq-j , v["mGuildName"]
M`,Z#)Af , v["mColor"])
eDMwY$J
result = result .. s2 .. s3 .. "\r\n"
8f`b=r(a> end
8 H"f9S=K return result
.TrQ +k> end
1*
Fvx-U' jH#^O;A --遍历周围指定NPC
R5~vmT5W function API_GetNpcIdByName(npcName)
kl<B*:RqH local npcVec = global.npcManager:FindNpcInCurrViewField()
x;b+gIz* local npc = {}
lPSDY&`P for k, v in pairs(npcVec) do
oVZ8p- local npcs = {}
.}u(& npc[v["mID"]] = v["mName"]
U=<.P;+f9 end
EG:WE^4 for key, value in pairs(npc) do
|
3/p8 local sPos, ePos = string.find(value, npcName)
|$-d,] V if sPos then
X QoT},
C return key
1VM5W!} end
{w1h<;MH end
>rX R;4% return nil
+!Gr`&w*) end
eX),B
R;m0eG` --NPC名称打开NPC
x@RA1&c function API_NpcTalk(npcName)
g|*eN{g]uE local npcid = API_GetNpcIdByName(npcName)
S5JR`o
local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
ezy5Jqk5% NPCProxy:RequestTalk(npcid)
H\>I&gC' end
1
H@rNa
m&
*Zo o --NPCID打开NPC
|~vQ0D
function API_NpcTalkEx(npcid)
2n r
UE local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
GP
kCgb( NPCProxy:RequestTalk(npcid)
g"AfI end
'-~/!i+= 0Y`tj function API_GetNpcTalkData()
pD.@&J~ local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
zNTu j p local talkData = NPCProxy:GetCurrentNPCTalkData()
5x'y{S< return talkData
g.sV$.T2K end
= 8e8!8 3B|-xq;]I function API_GetAllLink()
uM6!RR!~ local talkData = API_GetNpcTalkData()
uTt:/gm 8qLgB
local acts = {}
10C91/ local kv = {}
' /* rCB .7^-*HT} for line in talkData.content:gmatch("(text=.->)") do
aC6b})^ if string.find(line, "@") then
F0(Sv\<:: local key = line:match("text=(.-)|")
Q]'!FmXf }EG(!)u local value = line:match("(@.-)>")
g#2X'%&+ kv[key] = value
9<r}s end
#.t{g8W\C end
s7.*o@G PKs%-Uk for result in talkData.content:gmatch("(@.-)>") do
%>U*A table.insert(acts, result)
m8A_P:MQq end
DyTk<L local sendData = {
g>-[-z$E3 UserID = talkData.npcID,
&>b1ES.> index = talkData.index,
xa*gQ%+F --Act = "@blbumj",
9{#|sABGD --commonInput = jsonData.commonInput,
32FGDM --inputID= jsonData.inputID,
"8
mulE, }
`*!>79_2C return acts, kv, sendData
.v&h>@'m end
*w,gi.Y3 j7 3@Yi% --按索引号点击按
0-~x[\>> function API_ClickLinkByIndex(index)
beR)8s
C3q acts, kv, sendData = API_GetAllLink()
#E@i @'T sendData["Act"] = acts[index + 2]
1@dx(_ local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
lH>XIEj NPCProxy:ExecuteWithJsonData(sendData)
twS3J)UH end
?a9k5@s `5&V}"
lB --按索购买引号点击按
Z69IHA[ function API_ClickBuyLinkByIndex(index)
)t=u(:u] acts, kv, sendData = API_GetAllLink()
! HC<aWb sendData["Act"] = acts[index]
* c
c+Fd local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
cb,sb^- NPCProxy:ExecuteWithJsonData(sendData)
9o'6es..@Z end
ng*E9Puu[ F}DD;K --按名称点击按
MW>28
function API_ClickLinkByName(linkName)
OkUpgXU acts, kv, sendData = API_GetAllLink()
sYI':UQe sendData["Act"] = kv[linkName]
4^^rOi0 local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
u\?u4 NPCProxy:ExecuteWithJsonData(sendData)
-{%''(G end
GK%ovK >D#}B1(! --出售物品
E-iBA (H function API_Sell(npcName,itemsName)
<BA&S
_=4 local npcId=API_GetNpcIdByName(npcName)
nGd local bagData=ssr.getBagData()
{
f3fc8(p for k,v in pairs(bagData) do
V gk
,+l!4 if string.find(itemsName,v.Name) then
y]%,Y=%X --if #v["Values"]<2 then
Y@Y(;C"SW local Name = v.Name
4TE ?mh} local MakeIndex = v.MakeIndex
W-QPO local networkCtl = global.networkCtl
9v2 ; networkCtl:SendMsg(global.MsgType.MSG_CS_NPC_STORE_SELL_ITEM, npcId, MakeIndex , 0, 0, Name , string.len(Name) )
^eRT8I --end
9Dw&b end
c3t8yifQ end
/CE d14. end
x@}Fn:c!5 --全部卖
;qK6."b`; function API_SellAll(npcName)
(W!$6+GT local npcId=API_GetNpcIdByName(npcName)
D
d O' local bagData=ssr.getBagData()
+eXfT*=u5 for k,v in pairs(bagData) do
uy:=V}p --if #v["Values"]<2 then
y]9UFL" local Name = v.Name
kR(=VM JU local MakeIndex = v.MakeIndex
}O local networkCtl = global.networkCtl
mK4|=Q networkCtl:SendMsg(global.MsgType.MSG_CS_NPC_STORE_SELL_ITEM, npcId, MakeIndex , 0, 0, Name , string.len(Name) )
RBD
MZ --end
0z#k
V}wE end
;)a9Y? end
`0D1Nh"%k 8E[`H V,5}hQJ
F --NPC购买
fC|u function API_Buy(npcName,itemName,count)
`aycYoD --进入子菜单
j #YFwX4. local sendData =
J@iN':l-
{
4pT|r6!< UserID = API_GetNpcIdByName(npcName),
=fo/+m5 Name = itemName,
ii9/ UtIQ }
IBh~(6 SendTableToServer(1015, sendData)
Ti'kn{
Zv local function ToBuy()
s+- aHn local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
#{,IY
03 local list = NPCProxy.facade.view.mediatorMap.NPCStoreMediator._layer.itemList
)&Bv\Tfjt for i=1,count do
o |iLBh$) if i>#list then
hspg-|
R break
V+z)B+ end
$twF93u$ sendData.MakeIndex= list[#list-i].MakeIndex
%Ege^4PE SendTableToServer(1014, sendData)
X+8p2xSO| end
/)TEx}wk API_CloseNpcTalk()
[+z:^a1?V end
fk1f'M)/8 local scheduleID = ssr.PerformWithDelayGlobal(ToBuy, 1)
k;7.qhe: end
>IjLFM+U _6
`4_<c= T_T{c+,Zd$ function 打开子项(item)
-+_twU local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
*xP:7K if item.SubMenu == 1 then
J3;KQ}F.I NPCProxy:RequestNpcStoreItemList(item)
@D=`iG% end
T@.D5[q0: end
J}CK|} $uh DBmb function 子项购买(count)
koZp~W- local list = NPCProxy.facade.view.mediatorMap.NPCStoreMediator._layer.itemList
YYW70k: for i = 1, count do
c
O&9(.d if i > #list then break end
DA~ELje^j NPCProxy:RequestNpcStoreBuy(list
) Bnq\Gg end K/cK6Yr end AAgA]OD, ?%Fk0E#>2 --登录角色 w}q"y+=Z: Sw'?$j^3 function API_LoginRole(index) 'bPo 5V| local LoginProxy = global.Facade:retrieveProxy(global.ProxyTable.Login) =i?,y +< LoginProxy:SetSelectedRoleByIndex(index) 7gcG|kKT LoginProxy:RequestEnterGame() 'O9=*L)X global.Facade:sendNotification(global.NoticeTable.Audio_Stop_BGM) {m:R v&T end
H>6;I >~~\==". --登录 G. TX1 function API_Login(name, password) 06 s3
b local AuthProxy = global.Facade:retrieveProxy(global.ProxyTable.AuthProxy) 5V!XD9P' local data = {} cyg>hX{U data.type = 1 yTiqG5r data.username = name i]pG}SJ data.password = password V"iLeC AuthProxy:RequestLogin(data) |pSoBA9U end U{(07GNm# H_nJST<v` --开门 G[j79o function API_EnterRoom(x, y) Ya 4$7|( local qq = ssr.GetCurMapData() ]{^vs'as
\ global.networkCtl:SendMsg(global.MsgType.MSG_CS_OPEN_DOOR_REQUEST, 0, x, y) V}+;bbUc- local function callback() 5&=n ssr.AutoMoveBegin(x, y, qq.mapID) )W|jt/ end IxBO$2 SL:ScheduleOnce(callback, 0.5) ,$$$_+m\ end oW6<7>1M7 $t'I*k^N --多开 0EXNq*=EE function API_PcOpen() Dj(7'jT LuaBridgeCtl:Inst():CheckClientCount(2) }j*/>m end ?GU!ke p 3HR]T Q%r --盒子显示 +Ob#3PRy function API_hezi() *wcoDQ b; global.L_GameEnvManager._envData["isBoxLogin"] = 1 |LH*)GrD*t end k|'Mh0G0 v*'\w#
--遍历背包物品 Qe.kNdT+_ function API_GetCurBagData() r0
C6Ww7u local s1 = ssr.getCurBagData() A"iD4Q local result = "" ',Pk>f]AB- for k, v in pairs(s1) do (OQ
@!R& local s1 = string.format( ;NeEgqW" "OverLap=%s,DuraMax=%s,Where=%s,Dura=%s,Name=%s,Shape=%s,MakeIndex=%s,Weight=%s,StdMode=%s,Index=%s" rF3]AW( , v["OverLap"] #)
}bUNc' , v["DuraMax"] |/s2AzDD , v["Where"] [d>yo_iB , v["Dura"] KBA% , v["Name"] tuV?:g? , v["Shape"] >Fk`h=Wd , v["MakeIndex"] QC,(rB , v["Weight"] No\&~ , v["StdMode"] J5( D7rp# , v["Index"]) ABmDSV5i local ss = "" FH`&C*/F0Y if #v["Values"] > 1 then iDc|9"|Tf3 for x, y in pairs(v["Values"]) do wJ*-K- if y["Value"] > 0 then Cbs4`D, local Values = string.format("m_Value=%s,m_ValueID=%s" _O9H._E , y["Value"] $OoN/^kv , y["Id"]) PGl-2Cr ss = ss .. Values <W')
~o} end ;XQ lj?: end KXCmCn
end OUO^/]
J1S result = result .. s1 .. "," .. ss .. "\r\n" vaJXX end 3eP0v return result 8w?\_P7QA end IF}c*uGj} u(WQWsN --获取背包是否满 rss.F3dK function API_GetBagFull() +J8/,d return ssr.IsBagToFull(isTips) v1g5( end _k.bGYldk -8 =u{n --获取背包百分比 [c[MQA0 function API_GetBagEx() |ZlT>u HW = ssr.GetMetaValueByKey("BW") $:
m87cR~ MAXHW = ssr.GetMetaValueByKey("MAXBW") :";D.{|| ELL = HW / MAXHW * 100 bMOM`At>z return math.ceil(ELL) rGGepd end h^ $}1[ %kFELtx --获取背包是否满 ey\{C`(__y function API_GetBagFull() 'oQP:*Btl3 return ssr.IsBagToFull(isTips) M8j(1&(: end ruA+1-<f RTBBb:eX --读取地图ID @Qjl`SL%O^ function API_GetMapID() Q4LlToHn local tt = ssr.GetCurMapData() `G0rF\[ return tt.mapID ,T*_mDVY end L^{;jgd&T9 %7d
@+
. --读取地图名称 m&0BbyE.z function API_GetMapName() fB,1s}3Hn local tt = ssr.GetCurMapData() C;:L~)C@t return tt.mapName q }v04Yy,o end $"{3yLg zQ %z"tQ --获取背包最大数 L(2P|{C function API_GetMaxBag() |QNLO#$ - return ssr.GetMaxBag() VSpt&19 end ;Pqyu
? f"<@6Axq --使用物品 PeU
d function API_UseItem(itemName) 39aCwhh7v local items = ssr.getQuickUseData() jl-Aos"/ local item = ssr.getCurBagData() ^@*zH?Rx{ for k, v in pairs(items) do n!eqzr{ if v.Name == itemName then p6y0W`U ssr.UseItemByIndex(v.Index) Etc?; Z[F# end (X_ ,*3Yxk end ^!p<zZ j[J@tM# for k, v in pairs(item) do 6Vbv$ AU if v.Name == itemName then }-q`&1!t ssr.UseItemByIndex(v.Index) x D=qU end 3 [)s;e end K&IrTA
j} end 0Q-
Mxcj Zjic"E1 --获取金币数量 avt>saR function API_GetMoney(Index) LLn{2,jfQ return ssr.GetMoneyCountById(Index) p@7i=hyt`p end _[vdY|_ Sa?5iFg function API_MergeTables(t1, t2) }vUlTH local merged = {} H(G^O&ppdB for key, value in pairs(t1) do :{i$2\DH6 merged[key] = value eMl]td rI end +fP/|A8P for key, value in pairs(t2) do v;bP8)mI merged[key] = value P`3s\8[Q end 1'v !9 return merged P-OPv%jyi end <\d|=>; IgiF,{KE, Ce5w0&VlS --获取物品数量 9oz (=R function API_GetItemCount(itemName,isBind) teOBsFy/I local items=ssr.getQuickUseData() }L$Xb2^l local bagData=ssr.getBagData() 60aKT:KLC_ items=API_MergeTables(items,bagData) Q
f+
p0E; local bind=isBind or false :ONuWNY
N local count=0 Rw/JPC"
for k,v in pairs(items) do cR=94i=t if bind then !(]dz~sM --绑定 B=gsd0^] if v.Name==itemName and v.Bind~=nil then ,v}?{pc count=count+ v.OverLap 5h|m
4)$ end gF,[u
else {NY~JFM --不绑定 L;--d`[ if v.Name==itemName and v.Bind==nil then }6CXJ+-UR count=count+ v.OverLap /y9J)lx end ,bVS.A'o end [UJEU~XC end EAD0<I<>
return count u3*NO
)O end gVnwsE --读取人物坐标 KM6N'x ^z ^YG7dd_ )zW%\s*' 5rfH;` function API_GetMapXY() K(Q]&&< local aa = ssr.GetMainPlayerMapPos() ,jbGM&.C local aa = string.format("x=%s,y=%s" Wm$`ae
, aa.x T}t E/ , aa.y) {7=WU4$ return aa
]~prR? end iF [?uF hEv=T'*,K) -- 获取角色是否活着 'wz\tT ^ function API_IsRoleAlive() s^g.42?u return ssr.IsRoleAlive() (zs4#ja2, end +dCDM1{_a (aJP: ^ --读取聊天信息 q[)q|R| function API_ChatMsg() f8LrDR local function listcb(msg) Z&dr0w8 --table 5oU`[&=Ob ChatTable = msg r:c@17 end SLdN.4idK ssr.RegisterLUAEvent("OnAddChatItem", "增加聊天消息", listcb) 1tc]rC4h if ChatTable.mt == 1 and ChatTable.ChannelId == 3 or ChatTable.ChannelId == 6 then ]> )u+| local ChatT = string.format( !EX?m }7 "SendName=%s,SendId=%s,ChannelId=%s,mt=%s,SendTime=%s,Msg=%s" _(oP{wgB , ChatTable.SendName mvHh"NJ , ChatTable.SendId hgweNRTh! , ChatTable.ChannelId W,HH
*! , ChatTable.mt g|K6iY , ChatTable.SendTime b W=.K>| , ChatTable.Msg) WxVn&c\ return ChatT 't|Un G end +}7E
a:K end &c!j`86y* m"gni # function API_ChatMaa() (odR'# return ssr.GetMaxBag() M&qh]v gC end 'dIX=/RZ SZ5O89 --修理装备 8_a$kJJ2 function API_CopyTable(original) +mfe*'AU local copy = {} yn/?=
?0 for key, value in pairs(original) do 4<
G? if type(value) == "table" then qIbg
4uE copy[key] = API_CopyTable(value) ?$|uT else <%d51~@={I copy[key] = value .KLm39j( end .M
9d*qp`S end bBUbw *DF) return copy hWD ! end $J QWfGwR 修衣服 = "0,4" --衣服,头盔 ,4^9cFVo 修武器 = "1" 9VoDhsKk 修项链 = "3" [G{rHSK5tQ 修手镯 = "5,6" Gnbfy4Z 修戒指 = "7,8" --左戒指 右戒指 `fBG~NDw function API_Repair(npcName, itemPos) { OB-J\7Y local npcId = API_GetNpcIdByName(npcName) A 1T< local tempData = ssr.getEquipData() vKNt$]pm= local tobeRepair = {} qwq/Xcv for k, v in pairs(tempData) do =\~E n5 if string.find(itemPos, tostring(v["Where"])) and v["Dura"] ~= v["DuraMax"] then @br@[RpB local tmp = { @+'c+ Name = v.Name, }P<Qz^sr_ MakeIndex = v.MakeIndex, }>MP{67Dm Where = v.Where tcBC!
_vF } RAIVdQ}.Z table.insert(tobeRepair, tmp) g.64Id ssr.TakeOffEquipRequest(v) 1. #
|QX end $%7I: end C#
MFpT --脱完 开始修理 |@ikx{W for k, v in pairs(tobeRepair) do #yW.o'S+ local Name = v.Name J\het2?\ local MakeIndex = v.MakeIndex [YC=d1F5 local networkCtl = global.networkCtl qbS'|--wH networkCtl:SendMsg(1023, npcId, MakeIndex, 0, 0, Name, string.len(Name)) XR*Q|4 end $_Y/'IN`k --开始穿 H>60D|v[ local function ToDress() ^)&Ly_xrU for k, v in pairs(tobeRepair) do
eeuZUf+~] ssr.TakeOnEquipRequest(v, v["Where"]) [Q4_WKI0T end wYZT D*A2h end ^"3\iA: local scheduleID = ssr.PerformWithDelayGlobal(ToDress, 1) wL 4ZW8_ API_CloseNpcTalk() 3/X-Cr+d end Ho3dsh) U'tE^W B\Xh3l]+j lj.nCV_ 药店={0} q=|R89 首饰店={19,20,21,22,23,24,26} K K?Zm_ 衣服店={10,11,15,16,27,28,62,64} Ne3R.g9;Z 武器店={5,6} 7#QLtU 杂货店={3,25,2,30,31} &J8Z@^ 铁匠铺={43} uxWFM
$ 书店={4} t?gJNOV --检测背包是否有指定类型物品
}10\K function API_IsNeedToStore(StdModes) tbtI1"$ local function IsNeed(StdMode) _p\6
29` local bagData=ssr.getBagData() &!ED# gs for k,v in pairs(bagData) do p6`Pp"J_tr if v.StdMode==StdMode then h }<0 / return true !7}IqSs end k@#5$Ejc2 end ]b 3/Es+ local EquipProxy = global.Facade:retrieveProxy(global.ProxyTable.Equip) {vs 4vS6 local equip = EquipProxy:GetEquipData() *yJ[zXXjJ for k,v in pairs(equip) do M70c{s`w5 if v.StdMode==StdMode then l0I}&,+ if tonumber(v.Dura)/v.DuraMax < 0.9 then <lUOJV{&\ return true j5PL{6 end ~@{w\%(AK] end /QQ8.8=5 end |+>uA[6# return false wZ#Rlv,3Wa end MWiMUTZg3 N;uUx#z for k,v in pairs(StdModes) do 4t04}vp if IsNeed(v) then p8Iw!HE return true OFA{
KZga end -;^;2#](g end rah,dVE] return false 7W"/N#G end oBr.S_Qe sONBQ9
Bs[nV}c>> --范围内怪物个数 bool型返回distance dm6~ function API_范围内怪物个数(distance, count) Z1M>-[j) local proxyUtils = requireProxy("proxyUtils") iZ
aeoy local mainPlayerID = global.gamePlayerController:GetMainPlayerID() @5WgqB return proxyUtils.checkIsEnoughEnemy(mainPlayerID, count, distance) L'lF/qe^ end 3{KR
{B#L --关闭NPC框 ['z!{Ez function API_CloseNpcTalk() (:5G#?6, global.Facade:sendNotification(global.NoticeTable.Layer_NPC_Talk_Close) ~3gru>qI& global.Facade:sendNotification(global.NoticeTable.GuideEventEnded, {name = "GUIDE_END_NPC_TALK_LAYER_CLOSED"}) wJgX/W end 2R]&v;A --无怪随机 9M_(He
- function API_无怪随机() 9:5:`'b local list = global.monsterManager.mMonstersInCurrViewField f;gZ|a local actors = {} ` @8`qXg for k, v in pairs(list) do b.s9p7:J local actor = {} %JtbRs(~q actor["mID"] = v:GetID() 1"}cdq. table.insert(actors, actor); b.b@bq$1 end .e@> if #actors < 1 then 9Y/L?km_(
API_UseItem("随机传送石") Cp#)wxi6[y local aa = API_GetItemCount(1078) FXV`9uq}Z if aa < 1 then 5!Bktgk. ssr.BuyStoreItemsById(2, 1) $6T
3y8 end '_dzcN,z end _d@=nK) return #actors 3J{vt"dS end w
5*Z! -?<4Og[^ --API_周围怪物数量 XF|WCZUnY% function API_周围怪物数量() z>;$im local list = global.monsterManager.mMonstersInCurrViewField @wp4 |G local actors = {} AVG>_$< for k, v in pairs(list) do - hzjV| local actor = {} YD\]{,F| actor["mID"] = v:GetID() *:_P8G; table.insert(actors, actor); 3NIUW!gr end w(j^ccPD return #actors ,`32!i end Q6IQV0{p *#y;8 --API_周围人物数量 参数是 白名单 MAqLIf<G function API_视野内敌人(Name, lv) ?7jg(`Yh local list = global.playerManager.mPlayersInCurrViewField !"Q}R p local myName = global.gamePlayerController:GetMainPlayer():GetName() [iS,#w`
5 local actors = {} M\oTZ@ local names = myName .. "," .. Name #D*r]M for k, v in pairs(list) do '9s5OTkN ; local actor = {}
1tB[_ $s actor["mID"] = v:GetID() >xu[q\:" actor["mName"] = v:GetName() O oSb>Y/4 actor["mLv"] = (v.GetLevel and { v:GetLevel() } or { 0 })[1] w~Ff%p@9 --local myName=global.gamePlayerController:GetMainPlayer():GetName() 5Y\!pf7SQ| if not string.find(names, actor["mName"]) and tonumber(actor["mLv"]) > lv then V-!"%fO.s table.insert(actors, actor); YE}s end K-eY|n end ifK%6o6 return #actors PXzT6) end U47}QDh j>Ag\@2ME T*~H m --自动捡 3= -pG API_NoBodyPickEnable=true 06*rW
u9P3 :q#K} / --捡取物品白名单 R}:KE&tq API_MyPlayerNames = "我不是药神," uj|BQ`k 8FkFM^\1L --全图捡 k+^'?D--'P API_MapPickEnable = true in-C/m# --自动存 hWo=;#B* API_InStoreEnable=false !k&Q 5s: API_InStoreItems="" 1l8Etp&< --自动扔 wmU0E/{9] API_ItemDropEnable=false AoaN22 --自动用 pS[KBQ"F API_ItemKeepCountEnable=true |o<8}Nja6 --自动领取 *[+)7 API_GetMailItemEnable=false %7hB&[ 5 --自动买回城石 2Y!S_Hw8 API_BuyStoneEnable=false Bi3+)k>u7 API_RecoveryItemMaxMoney=1000000 LN
2D --地图 ^pnG0(9 API_PreMapName="盟重省" BZv+H=b --开关 ;8{cA_& API_TimerEnable=true Yw;D:Y( Q@@v1G\ API_TimerEnable1s=true os lJC$cy' API_TimerEnable10s=true xI*#(!x"G --1S定时器 !0,Mp@ j/ function API_AutoSchedule1s() 5S{7En~zUE if GET_GAME_STATE() == "world" and API_TimerEnable1s then s;flzp8 --自己设置的自动捡 C0*@0~8$9 --API_PickItems() 6t'l(E + --系统自动捡 AJ^#eY5 if API_NoBodyPickEnable then C1EtoOv K if API_IsInCurrViewField(API_MyPlayerNames) then qT:zEt5 API_OpenGroupPick(false) <M]h{BS= --release_print("来人,关自动捡") Rli:x --API_RunAway() --逃跑 ^! 8P<y --API_UseItem3Second("回城石") $,>@o=)_ else
9Z5D\yv?H API_OpenGroupPick(true) 5kNzv~4B,; API_PickItems() X^9d/}uTa --release_print("无人,开自动捡") {<>K]P~wD end %ir:ASk end {nT^tAha end _ee
dBpV end t*<#<a --10s定时器 I zbU)ud function API_AutoSchedule10s() CSPKP#,B0[ if GET_GAME_STATE()=="world" and API_TimerEnable then 6 15s5ZA --自动扔 9`//^8G:= if API_ItemDropEnable then 6]zd.W API_DropItemKeep("回城卷",2) C[!MS5 end E m
6Qe NcPgq?3p --自动组队 R"MRnr_4K if ssr.GetCurMapData().mapName == "石墓二层" or ssr.GetCurMapData().mapName == "石墓三层" or ssr.GetCurMapData().mapName == "地牢一层西" then wa=uUM_4u^ API_InviteJoinTeam() ^u}L;`
L API_TeamApplyUpdate() --允许所有邀请 /walu+]h end S& #U!#@ 0[?ny`Y --自动用消耗品 z7M_1%DEx if API_ItemKeepCountEnable then wkqX^i7ls if API_GetItemCount("强效金创药") > 1 then klgy;jSEr API_UseItem("强效金创药") &N~ZI*^ end C;
QAT if API_GetItemCount("强效魔法药") > 1 then 5
<wnva API_UseItem("强效魔法药") mI*[>#q> end v[plT2"s if API_GetItemCount("太阳水") > 1 then :0)3K7Q API_UseItem("太阳水") [[d(jV=* end m'\ 2:mDu0 if API_GetItemCount("魔法药(中量)") > 7 then `LAR@a5i API_UseItem("魔法药(中量)") =0;}K@(J end uEyH2QO if API_GetItemCount("魔法药(中量)") < 1 then Uy
? API_UseItem("魔法药(中)包") *KY=\
%D end CC\*?BKj" if API_GetItemCount("金创药(中量)") > 1 then '0y9M
XRT API_UseItem("金创药(中量)") Y{v(p7pl end :l7U>~ o if API_GetItemCount("护身符(大)") < 1 then ~c)~015` API_UseItem("回城卷") @_:]J1jw7 end m-^8W[r+_ if API_GetItemCount("魔法药(中量)") < 1 and SL:GetMetaValue("MAP_NAME") ~= "盟重省" and API_GetItemCount("魔法药(中)包") < 1 then i
wxVl)QL API_UseItem("回城卷") ~8"8w(CG*I end
;zM*bWh9 if SL:GetMetaValue("HP") < 30 and not SL:GetMetaValue("IN_SAFE_AREA") then 1&;QyTN API_UseItem("回城卷") P0H6mn* end b"!Q2S~ end f7h*Vu`> ydw)mT44K if API_GetMailItemEnable then >9RD_QG7 global.networkCtl:SendMsg(global.MsgType.MSG_CS_EMAIL_GET_REQUEST, 2) 9% l% global.Facade:sendNotification(global.NoticeTable.Layer_Enter_Current) #ET/ = end LK6; ?m end uZfnz
d)c end 3d<HN6&U ZxV"(\$n --定时器 / kt2c[9 function API_TimerStart() [aI
]y=v --1S定时开关 s&\I=J. if API_AutoScheduleID1s == nil then `qd+f{Q API_AutoScheduleID1s = ssr.Schedule(API_AutoSchedule1s, 1) ?(*t@
{k else 1]IQg;q ssr.UnSchedule(API_AutoScheduleID1s) O+}qQNe< API_AutoScheduleID1s = ssr.Schedule(API_AutoSchedule1s, 1) "S3wk=?4 end '13ZX: --10S定时开关 A
)%A!
if API_AutoScheduleID10s == nil then VJ ^dY; API_AutoScheduleID10s = ssr.Schedule(API_AutoSchedule10s, 10) <mi-}s else :qChMU|Y6 ssr.UnSchedule(API_AutoScheduleID10s) 1]orUF&_ API_AutoScheduleID10s = ssr.Schedule(API_AutoSchedule10s, 10) N2.AKH end U=h
lu end ^rvx!?zO function API_IsInCurrViewField(names, level) >.dWjb6t local lv = level or 0 8
k3S local nameList = names or "" f2,jh}4 local list = global.playerManager.mPlayersInCurrViewField =K{\p`? local actors = {}
Dfq(Iv for k, v in pairs(list) do z]b>VpW: local actor = {} `tjH< actor["mID"] = v:GetID() T\w?$ s actor["mName"] = v:GetName() L\y;LSTU actor["mLv"] = (v.GetLevel and { v:GetLevel() } or { 0 })[1] Ag F,aZU if not string.find(names, actor["mName"]) and tonumber(actor["mLv"]) > lv then asY[8r?U table.insert(actors, actor); ui
(^k $ end s'kDk2r end DjSbyXvrg if #actors > 0 then Gmf B return true <SI}lQ'i else OKFtl return false dCj,b$ end
Q{B}ef end uV 7BK+[O @as"JAN --打开组捡 k)TSR5A function API_OpenGroupPick(isOpen) <dW]\h?) local GameSettingProxy = global.Facade:retrieveProxy(global.ProxyTable.GameSettingProxy) z25m_[p2 local count = 0 nLV9<M
Zm for key, value in pairs(GameSettingProxy._pickConfig) do 3;%5Yu count = count + 1 ^"J8r W6[ end ?nP*\8 local function SetGroup(pickgroup) ]E] 2o for i = 1, count do pp7$J2s+j GameSettingProxy:SetPickGroupValue(i, pickgroup) ^pJ!isuqu end kOh{l: 2-+ end o.q/O)'V u if isOpen then
QtvY v! local pickgroup = { 1, 1, 1 } 4)1s M=u SetGroup(pickgroup) $95h2oXt else P-ri=E}> local pickgroup = { 1, 1, 0 } {uGP&cS~( SetGroup(pickgroup) .BFYY13H end Duc#$YfGm end < yC <{~6}6o