游戏地址
b{WEux{) www.fgcq996.com s1/:Ts[3i 那年传奇百区1.76 t^Hte^#S F9Y/Z5 Ea 找到 lua_State 然后调用下面的函数就能实现功能
SA1|7 一个跑单狗注意qq1946913194
2w
KW17wj, 游戏账号密码。fanren9527 qq2293307009 `EjPy>kM Fy!-1N9|l 搞完演示完,删除好友跑单 sh|@X\EZO ]EhU8bZ --自动寻路Ex
#4Z]/D2G function API_AutoMoveEx(mapX, mapY)
~ R:
=zGDV ssr.AutoMoveBegin(mapX, mapY, ssr.GetCurMapData().mapID)
qwz_.=5E6 local inputProxy = global.Facade:retrieveProxy(global.ProxyTable.PlayerInputProxy)
v\;hI5WY local pathPoints = inputProxy:GetPathFindPoints()
3$E\B=7/U if pathPoints == nil then
O5;$cP: return 0
_0uFe7sIZ end
p~h)@ return #pathPoints
IW1+^F9NEw end
&-s/F` iCK p"(kf --自动寻路
7G^`'oZ function API_AutoMove(mapX, mapY)
N Dt +m ssr.AutoMoveBegin(mapX, mapY, ssr.GetCurMapData().mapID)
vxmz3ht,Q local inputProxy = global.Facade:retrieveProxy(global.ProxyTable.PlayerInputProxy)
>^!qxb- local pathPoints = inputProxy:GetPathFindPoints()
x<-n}VK\ if pathPoints == nil then
'=^$;3Z return 0
a1p}y2 end
{8YNmxF# return #pathPoints
:^Ouv1!e1 end
FN)vFQ#J hj8S# --停止寻路
B
>
sTM function API_AutoMoveEnd()
%%=PpKYtSD global.Facade:sendNotification(global.NoticeTable.AutoMoveEnd)
l_`DQ8L` end
>#jfZ5t ZV?~~_9 --自动打怪
= @UgCu>= function API_AutoFight(isAFK)
q_sQC5:s if isAFK then
:Jz@` s1n if not IsAFKState() then
j!oD9&W4~ global.networkCtl:SendMsg(global.MsgType.MSG_CS_AUTOPLAYGAME_REQUEST, 1)
@&7|Laa global.Facade:sendNotification(global.NoticeTable.AFKBegin)
@
fML.AT end
8D[,z 7n else
/1Q
i9uit if IsAFKState() then
VXpbmg!{S global.networkCtl:SendMsg(global.MsgType.MSG_CS_AUTOPLAYGAME_REQUEST, 2)
HRPNZ!B global.Facade:sendNotification(global.NoticeTable.AFKEnd)
:mpR}.^hv end
[nBdq"K end
ELlTR/NW end
S<+/ Ep 2 Z6Owxqfht function IsAFKState()
{ 4(E
@ local AutoProxy = global.Facade:retrieveProxy(global.ProxyTable.Auto)
0VOj,)K= return AutoProxy:IsAFKState()
W%)uKQha end
Lh"!Z 3Xun>ZQ- --打开自动穿戴
G31??L:< function API_AutoDress()
<o\2-fWvY --不抢别人归属
6tKm'`^z4 global.MMO.SETTING_IDX_NO_ATTACK_HAVE_BELONG =1
rps2sXGr global.MMO.SETTING_IDX_AUTO_PUT_IN_EQUIP = 1
l_Ffbs_6t local ServerOptionsProxy = global.Facade:retrieveProxy(global.ProxyTable.ServerOptionsProxy)
D8b~-# ServerOptionsProxy._data["autoDress"] = 1
T==(Pw7R7 global.ConstantConfig.autousetimes = 0
rTR4j>Ua~ end
}E}b/ulg1 h.`U)6*?&N --强制打开自动挂机拾取
Fa!6*K\ function API_AutoPick()
~BSE8M+r local ItemConfigProxy = global.Facade:retrieveProxy(global.ProxyTable.ItemConfigProxy)
m^O9G? local config = ItemConfigProxy.config
n<. T6 for k, v in pairs(config) do
<`~zKFUQ[ --local res = string.gsub(v.pickset, "0", "1")
b.<>CG' v.pickset = v.pickset .. 1
H,F/u&O end
5tIM@,.I/ end
v@6TC 1M, ?2#v`Z=L; --获取人物坐标
"H
uV' function API_GetMapXY()
[ NSsT>C return ssr.GetMainPlayerMapPos()
0^27grU> end
Xg](V.B6 d_0r --获取人物状态
:-I~-Yj function API_GetAction()
3e<FlH{ local player = global.gamePlayerController:GetMainPlayer()
7:Jyu/*] local list = global.playerManager.mPlayersInCurrViewField
PhS`,I^Z return player:GetAction()
8, >YB+Hb end
.>K):|Opv *TjolE~o --设置宠物状态
T2nbU6H function API_PetSleep(isSleep)
GCf3'u local SummonsProxy = global.Facade:retrieveProxy(global.ProxyTable.SummonsProxy)
_
-vf<QO] if not SummonsProxy:IsAlived() then
E27N1J+1 return false
7,\Uk| end
Or0eY#c if isSleep then
YEEgDw]BQ SummonsProxy:RequestModeChange(2)
&r{.b#7\/A else
*acN/Ca1 SummonsProxy:RequestModeChange(4)
$7#N@7 end
l>Nz]Ul%{ end
a!;]9}u7 =s2dD3Fr| --获取人物数据
^Ms)T3dM function API_GetGamePlayer()
y5X HJUTu local player = global.gamePlayerController:GetMainPlayer()
Ew4>+o! local list = global.playerManager.mPlayersInCurrViewField
Dn6 k,nVh local person = {}
GS%i<HQ3 person["等级"] = player:GetLevel()
&*I\~;1 person["职业"] = player:GetJobID()
k{fCU% person["名字"] = player:GetName()
QFI8|i
@ person["金币"] = ssr.GetMoneyCountById(1)
5 W<\J person["元宝"] = ssr.GetMoneyCountById(2)
7VF^&6 person["绑金"] = ssr.GetMoneyCountById(3)
WhO;4-q)2 return person
q+MV@8w end
g[rxKn\Z x,sMa*vd function API_GetGamePlayerLevel()
M NE{mV( local player = global.gamePlayerController:GetMainPlayer()
FN#6pM']| return player:GetLevel()
x4PH-f-7 end
RaKfYLw 4{:W5eT! / --获取周围怪物
_.xT
:b36 function API_GetMonster()
Fb
<r~2 local list = global.monsterManager.mMonstersInCurrViewField
Cmq.V@ local actors = {}
hSgfp
for k, v in pairs(list) do
v;E7UL
.w local actor = {}
He)<S?X-6 actor["mID"] = v:GetID()
Wdt
9k.hzN actor["mName"] = v:GetName()
)\:cL GM
actor["mRace"] = v:GetRace()
kAbkhZ1^ actor["mType"] = v:GetType()
:q V}v2 actor["mSubType"] = v:GetSubType()
;CU<\ actor["mX"] = v:GetMapX()
qsB,yckml actor["mY"] = v:GetMapY()
p0KkPE">p4 actor["mAction"] = v:GetAction()
~ caKzq actor["mTypeIndex"] = v:GetTypeIndex()
^y?7B_%:B# actor["mAnimationID"] = v:GetAnimationID()
wff&ci28 actor["mLv"] = (v.GetLevel and { v:GetLevel() } or { 0 })[1]
&&0,;r,-) actor["mSex"] = (v.GetSexID and { v:GetSexID() } or { 0 })[1]
FuOP+r!H actor["mJobID"] = (v.GetJobID and { v:GetJobID() } or { 0 })[1]
BReNhk)S actor["mHP"] = (v.GetHP and { v:GetHP() } or { 0 })[1]
wW3fsXu actor["mHPMax"] = (v.GetMaxHP and { v:GetMaxHP() } or { 0 })[1]
`"0#lZ`n actor["mMP"] = (v.GetMP and { v:GetMP() } or { 0 })[1]
sOSol7n actor["mMPMax"] = (v.GetMaxMP and { v:GetMaxMP() } or { 0 })[1]
C043
h?x actor["mOwnerID"] = (v.GetOwnerID and { v:GetOwnerID() } or { "" })[1]
5Rv6+d actor["mOwnerName"] = (v.GetOwnerName and { v:GetOwnerName() } or { "" })[1]
`?Pk~7 actor["mGuildName"] = (v.mGuildName and { v.mGuildName } or { "" })[1]
;79X#hI actor["mColor"] = "0xFFFFFF"
}+[H~8)5 if v:GetType() == global.MMO.ACTOR_PLAYER then
M DnT local batch_label = global.MMO.HUD_TYPE_BATCH_LABEL
})V9d local label_name = global.MMO.HUD_LABEL_NAME
<a-I-~ local hudName = global.HUDManager:GetHUD(v:GetID(), batch_label, label_name)
$XFiH~GI if hudName then
g)*[W>M actor["mColor"] = GetColorHexFromRBG(hudName:getColor())
W;]*&P[[
end
|kvom 4 T end
}]pq&v! table.insert(actors, actor);
KzeTf?G end
%}+!%A.3 a!,q\p8<t0 return actors
Zho d %n3 end
S
Rl:+!@. }5H3DavW --遍历周围玩家
h1.]Nl
C function API_GetPlayer()
|
x|#n local list = global.playerManager.mPlayersInCurrViewField
})OgsBk local actors = {}
K~A$>0c for k, v in pairs(list) do
3~"G(UP local actor = {}
Y{X79Rd
actor["mID"] = v:GetID()
$_-f}E actor["mName"] = v:GetName()
]8(_{@/ actor["mRace"] = v:GetRace()
[>P@3t(/ actor["mType"] = v:GetType()
.+<Ul]e/ actor["mSubType"] = v:GetSubType()
PaF`dnJ actor["mX"] = v:GetMapX()
'CT8vt; actor["mY"] = v:GetMapY()
<|~8Ezd actor["mAction"] = v:GetAction()
@[0zZX2EE actor["mTypeIndex"] = v:GetTypeIndex()
m~ %\f8w-x actor["mAnimationID"] = v:GetAnimationID()
1FU(j*~: actor["mLv"] = (v.GetLevel and { v:GetLevel() } or { 0 })[1]
}2Y:#{m actor["mSex"] = (v.GetSexID and { v:GetSexID() } or { 0 })[1]
{g?$u actor["mJobID"] = (v.GetJobID and { v:GetJobID() } or { 0 })[1]
xrX^";}j actor["mHP"] = (v.GetHP and { v:GetHP() } or { 0 })[1]
4K82%P9a actor["mHPMax"] = (v.GetMaxHP and { v:GetMaxHP() } or { 0 })[1]
4P@Ak7iL(V actor["mMP"] = (v.GetMP and { v:GetMP() } or { 0 })[1]
a3i4e
GT - actor["mMPMax"] = (v.GetMaxMP and { v:GetMaxMP() } or { 0 })[1]
M,Q(7z?#5 actor["mOwnerID"] = (v.GetOwnerID and { v:GetOwnerID() } or { "" })[1]
VnUWUIVJ actor["mOwnerName"] = (v.GetOwnerName and { v:GetOwnerName() } or { "" })[1]
(W3~r actor["mGuildName"] = (v.mGuildName and { v.mGuildName } or { "" })[1]
jX^uNmb actor["mColor"] = "0xFFFFFF"
^[}^+ if v:GetType() == global.MMO.ACTOR_PLAYER then
'AN3{ local batch_label = global.MMO.HUD_TYPE_BATCH_LABEL
VLW<"7I 6\ local label_name = global.MMO.HUD_LABEL_NAME
o5gt`H" local hudName = global.HUDManager:GetHUD(v:GetID(), batch_label, label_name)
'c 0]8Y4
if hudName then
.OM m"RtK actor["mColor"] = GetColorHexFromRBG(hudName:getColor())
*<n]"- end
TI-8I) end
"?|sC{'C4j table.insert(actors, actor);
$LLkYOwI end
zhH-lMNj- return actors
!Q!==*1H end
-QL_a8NL dzMlfJp --遍历周围玩家EX
MtC \kTW function API_GetPlayerExe()
^)Xl7d|m+ local s1 = API_GetPlayer()
[ z$th local result = ""
5" <7 for k, v in pairs(s1) do
S[rz=[7{ local s2 = string.format(
x
J>U_Gd "mID=%s,mName=%s,mRace=%s,Dura=%s,mType=%s,mSubType=%s,mX=%s,mY=%s,mAction=%s,mTypeIndex=%s,mAnimationID=%s,"
V3WHp'1 , v["mID"]
K1 M s , v["mName"]
WpE\N0Yg , v["mRace"]
bX%9'O [- , v["Dura"]
:T(3!}4 , v["mType"]
)Xxu-/- , v["mSubType"]
~"89NVk" , v["mX"]
(]0JI1
d , v["mY"]
@K; 4'b~ , v["mAction"]
JQQP!]%} , v["mTypeIndex"]
m@)~.E , v["mAnimationID"])
b: UTq
7^ local s3 = ""
b f.__3{ 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"
d@~Hp? , v["mLv"]
_,:gSDW| , v["mJobID"]
Q?KWiFA}' , v["mHP"]
L.XGD|m , v["mHPMax"]
:@zz5MB5@ , v["mMP"]
g$<Sh.4A , v["mMPMax"]
Z-W>WR , v["mOwnerID"]
iE$qq~% , v["mOwnerName"]
eO#Kn'5 , v["mGuildName"]
T !C39
T , v["mColor"])
\EF^Ag result = result .. s2 .. s3 .. "\r\n"
wP.b2X_V end
}p 0\ return result
t<5$
85Y~ end
L5/J
iB1"aE3 --遍历周围指定NPC
-ju&
"L B function API_GetNpcIdByName(npcName)
_oK*1#Rm8 local npcVec = global.npcManager:FindNpcInCurrViewField()
<U(wLG'XS local npc = {}
fQcJyX for k, v in pairs(npcVec) do
P!@b:.$ local npcs = {}
x5_V5A/@LU npc[v["mID"]] = v["mName"]
Zq7Y('=`t@ end
<eP`Lu" for key, value in pairs(npc) do
zKB$n.H local sPos, ePos = string.find(value, npcName)
Jhdo#}Ub if sPos then
"w.gP8` return key
5s3!{zT{ end
o.IJ4'}aN end
c3,YA,skb! return nil
SoX\S|}%6[ end
(27bNKr Z
Yr6Wn --NPC名称打开NPC
^6R?UG;6 function API_NpcTalk(npcName)
Y=+pz^/" local npcid = API_GetNpcIdByName(npcName)
KECo7i= e local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
z+IBy+ NPCProxy:RequestTalk(npcid)
w.w(*5[ end
`
6
a 3oX\q/$ --NPCID打开NPC
8UiRirw function API_NpcTalkEx(npcid)
o
NX-vN- local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
CX/ _\0G4 NPCProxy:RequestTalk(npcid)
%O]]La
end
7M;7jI/C D4nYyj1O3
function API_GetNpcTalkData()
P%w)*); local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
yClX!OL local talkData = NPCProxy:GetCurrentNPCTalkData()
[w&B>z=g$ return talkData
yf7p,_E/ end
W]b>k lp; ~>vv9-_ function API_GetAllLink()
pRyePxCDj) local talkData = API_GetNpcTalkData()
J:g4ES-/ ~JhH ,E local acts = {}
s`Z
|
A local kv = {}
S"+X+Oxp7? ?:DeOBAb for line in talkData.content:gmatch("(text=.->)") do
Gf` `0F) if string.find(line, "@") then
SVKjhZK local key = line:match("text=(.-)|")
@I_!q* 4eOS+& local value = line:match("(@.-)>")
/BEE.`6yI5 kv[key] = value
Zi'}qs$v end
fS9
TDy end
GH ]c oPP`)b$x for result in talkData.content:gmatch("(@.-)>") do
_Q XC5i table.insert(acts, result)
FI|jsO 3 end
+/+:D9j , local sendData = {
VZhtx) UserID = talkData.npcID,
w)}' {]P"c index = talkData.index,
=^a Ngq --Act = "@blbumj",
>Pa&f20Hp --commonInput = jsonData.commonInput,
Egy#_ RT{ --inputID= jsonData.inputID,
B?A]0S }
/j%(Z/RM return acts, kv, sendData
44@yQ? end
NVyel*QE v+\&8)W= --按索引号点击按
8zhr;Srt function API_ClickLinkByIndex(index)
yhTC?sf< acts, kv, sendData = API_GetAllLink()
L>xecep sendData["Act"] = acts[index + 2]
g"b{M local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
d2'1
6.lV NPCProxy:ExecuteWithJsonData(sendData)
>#pZ`oPEAv end
{v3?.a$u BF)
!VnJ --按索购买引号点击按
1nGpW$Gx function API_ClickBuyLinkByIndex(index)
E~]37!,\\9 acts, kv, sendData = API_GetAllLink()
mO#62e4C sendData["Act"] = acts[index]
D1G9^7:^E local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
[%?ViKW NPCProxy:ExecuteWithJsonData(sendData)
Qdt4h$~V" end
s}w?Dvo \ p;nRxi7' --按名称点击按
vG X
L'k function API_ClickLinkByName(linkName)
&Ul8h,qw acts, kv, sendData = API_GetAllLink()
Rda~Drz sendData["Act"] = kv[linkName]
MKiP3kt8 local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
C[X2]zr
NPCProxy:ExecuteWithJsonData(sendData)
!i4/#H end
]*/%5ZOI& 7bk=D~/nSg --出售物品
.|?UqZ(, function API_Sell(npcName,itemsName)
Ec2?'*s local npcId=API_GetNpcIdByName(npcName)
mCb1^Y local bagData=ssr.getBagData()
<rQ+ErDA for k,v in pairs(bagData) do
4eD>DW if string.find(itemsName,v.Name) then
=[_=y=G --if #v["Values"]<2 then
#!yW)RG local Name = v.Name
o57r ,`N local MakeIndex = v.MakeIndex
#{f%b,.yxt local networkCtl = global.networkCtl
{wK|C<K networkCtl:SendMsg(global.MsgType.MSG_CS_NPC_STORE_SELL_ITEM, npcId, MakeIndex , 0, 0, Name , string.len(Name) )
)#%v1rR --end
-K%hug
end
C3k[ipCN end
p)&Yr end
Sm5T/&z --全部卖
%p; 'l function API_SellAll(npcName)
a8w/#!^34 local npcId=API_GetNpcIdByName(npcName)
.:wo
AR
W! local bagData=ssr.getBagData()
I9VU,8~ for k,v in pairs(bagData) do
TmEJ!)* --if #v["Values"]<2 then
Z@1vJH6IbA local Name = v.Name
lEXER^6 local MakeIndex = v.MakeIndex
Bjc<d,]
local networkCtl = global.networkCtl
Y%zYO networkCtl:SendMsg(global.MsgType.MSG_CS_NPC_STORE_SELL_ITEM, npcId, MakeIndex , 0, 0, Name , string.len(Name) )
[\BLb8 --end
tDWoQ&z2t_ end
FTJv
kcc?m end
z79c30y]" +H**VdM6s pB;8yz= --NPC购买
woyn6Z1JQ function API_Buy(npcName,itemName,count)
n[E/O}3& / --进入子菜单
%96l(JlJ)B local sendData =
B'}pZOa[Wb {
~~iFs ,9 UserID = API_GetNpcIdByName(npcName),
r,8~qHbOT Name = itemName,
i8nzPKF2$3 }
fVvB8[(;~ SendTableToServer(1015, sendData)
oVAY}q|wU local function ToBuy()
BJ*8mKi h local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
G2 {R5F ! local list = NPCProxy.facade.view.mediatorMap.NPCStoreMediator._layer.itemList
P9
yg for i=1,count do
YJm64H,[ if i>#list then
A6S|pO1)3 break
bmP2n
D6 end
O[<YYL0 sendData.MakeIndex= list[#list-i].MakeIndex
Ge_Gx*R SendTableToServer(1014, sendData)
96#aGh> end
-\I".8"YE API_CloseNpcTalk()
YiGSFg end
E{8-VmY local scheduleID = ssr.PerformWithDelayGlobal(ToBuy, 1)
7;rf$\-& end
x\K9|_! uXuA4o$t- 8?4/ function 打开子项(item)
s2kom) local NPCProxy = global.Facade:retrieveProxy(global.ProxyTable.NPC)
w l#jSj%pd if item.SubMenu == 1 then
QLLMSa+! \ NPCProxy:RequestNpcStoreItemList(item)
aGs\zCAP end
k [eWhdSw end
s`dwE*~ E``\Jre@ function 子项购买(count)
0J z|BE3Y
local list = NPCProxy.facade.view.mediatorMap.NPCStoreMediator._layer.itemList
W*WSjuFr2 for i = 1, count do
Qz4n%| if i > #list then break end
EC8 Fapy NPCProxy:RequestNpcStoreBuy(list
) \Y$@$) end i5 ;_ end :pw6#yi8` Xaw&41K --登录角色 w:3CWF4q] c2~oPUj function API_LoginRole(index) Dd'4W local LoginProxy = global.Facade:retrieveProxy(global.ProxyTable.Login) _xu_W;nh LoginProxy:SetSelectedRoleByIndex(index) P
~rT uj LoginProxy:RequestEnterGame() ?Zh,W(7W global.Facade:sendNotification(global.NoticeTable.Audio_Stop_BGM) a0)] W%F end f7v|N) ;=lQMKx0 --登录 /
0ra]}[( function API_Login(name, password) &s~b1Va local AuthProxy = global.Facade:retrieveProxy(global.ProxyTable.AuthProxy) "?Yf3G: \0 local data = {} iPK:gK3Q data.type = 1 B!AJ* data.username = name VK[`e[.C data.password = password $*qQ/hi AuthProxy:RequestLogin(data) HLb`'TC3r+ end X$(YCb f\X7h6k8{ --开门 EHH+)mlo function API_EnterRoom(x, y) @p[ml m local qq = ssr.GetCurMapData() %T,cR>lw global.networkCtl:SendMsg(global.MsgType.MSG_CS_OPEN_DOOR_REQUEST, 0, x, y) *}RV)0m
if local function callback() (_n U}<y_i ssr.AutoMoveBegin(x, y, qq.mapID) ^X|Bzz) end ['_W< SL:ScheduleOnce(callback, 0.5) vT;~\,M end \}:;kO4f Lt2<3
DB --多开 hwi$:[ function API_PcOpen() !n`Y^ LuaBridgeCtl:Inst():CheckClientCount(2) 8c<O
X! end q vGP$g owe6ge7m
--盒子显示 $^5c8wT function API_hezi() XGSgx global.L_GameEnvManager._envData["isBoxLogin"] = 1 ]EfM;'j[ end
%mNd9 ]< b@
OF --遍历背包物品 q{2
+Inf#: function API_GetCurBagData() rOTxD/ local s1 = ssr.getCurBagData() 2|JtRE+ local result = "" @WnW
@'*F for k, v in pairs(s1) do # 5b
local s1 = string.format( .q5WK#^
"OverLap=%s,DuraMax=%s,Where=%s,Dura=%s,Name=%s,Shape=%s,MakeIndex=%s,Weight=%s,StdMode=%s,Index=%s" +?ilTU , v["OverLap"] 'M=V{.8U , v["DuraMax"] DgGG*OXY , v["Where"] c3!YA"5 , v["Dura"] gT#hF]c: , v["Name"] @2/xu , v["Shape"]
^-g-]?q , v["MakeIndex"] LDYk\[81 , v["Weight"] AI9#\$aGV , v["StdMode"] @%gth@8 , v["Index"]) J?oEzf;M local ss = "" f<LRM if #v["Values"] > 1 then zdgSq
v for x, y in pairs(v["Values"]) do u69fYoB' if y["Value"] > 0 then gh<2i\})' local Values = string.format("m_Value=%s,m_ValueID=%s" d#u*Nw
Y} , y["Value"] pe>[Ts`2F , y["Id"]) &b=OT%D~FU ss = ss .. Values NflRNu:- end gn6 @x end +OfHa\Nz end Q)93+1] result = result .. s1 .. "," .. ss .. "\r\n" a=AP*adx8 end JqP~2,T return result A9kn\U92 end ]z"7v n|) JhXQ --获取背包是否满 {LqahO* function API_GetBagFull() 9IJc9Sv( return ssr.IsBagToFull(isTips)
EzGO/uZ] end f;
]C8/ W I0v4TjHH --获取背包百分比 4rH:`494 function API_GetBagEx() ]<:qMLg HW = ssr.GetMetaValueByKey("BW") fea4Ul{ib MAXHW = ssr.GetMetaValueByKey("MAXBW") r@ v&~pL ELL = HW / MAXHW * 100
(x1 #_~ return math.ceil(ELL) 3?uah'D5 end s E0
ldN" #s0Wx47~ --获取背包是否满 R y"N_Fb function API_GetBagFull() b
=R9@! return ssr.IsBagToFull(isTips) p$}1V2h; end hDD]Kc;G^1 DUWSY?^c --读取地图ID A
?ij function API_GetMapID() y /OPN<=* local tt = ssr.GetCurMapData() /<)kI(gf return tt.mapID Bw4 _hlm end v<V9Z
<ub 'I5~<"E --读取地图名称 z~\Y*\f^Y3 function API_GetMapName() 2M*84oh8P local tt = ssr.GetCurMapData() 4j}uVGi{e return tt.mapName IpKpj"eoLy end /}R*'y >f-*D25f% --获取背包最大数 f<Xi/( function API_GetMaxBag() DW0UcLO return ssr.GetMaxBag() "XWO#,Ue end '-vzQ d@y %-#rzeaW --使用物品 3mH(@-OA function API_UseItem(itemName) Usf7
AS= local items = ssr.getQuickUseData()
$-"V
2 local item = ssr.getCurBagData() +JPHQx'W for k, v in pairs(items) do Y<[jUe`O; if v.Name == itemName then %C~LKs5oH ssr.UseItemByIndex(v.Index) ]_y0wLq end NG\^>.8 end Qcs>BOV~ OuV
f<@a for k, v in pairs(item) do 4NRG{FZ9 if v.Name == itemName then .Uh|V- ssr.UseItemByIndex(v.Index) EbMG9
end lWWy|r'il end !y-,r4\@` end ~v^I*/uY Z Ne(sg~G --获取金币数量 )~ =g}& function API_GetMoney(Index) Y(Q!Oe
C return ssr.GetMoneyCountById(Index) +WB';D end P=
nu&$; J6J|&Z~UT, function API_MergeTables(t1, t2) ]}s'`44J9e local merged = {} e2vLUlL8 for key, value in pairs(t1) do
Mt
merged[key] = value -efB8)A end 2qe]1B; for key, value in pairs(t2) do 0mY KzJi merged[key] = value Fv2U@n6'v end }8)iFP&" return merged K XbD7N. end RAi]9` *7 o.x<h"; ~pve;(e= --获取物品数量 MWn+e function API_GetItemCount(itemName,isBind) Ub% 1OQ local items=ssr.getQuickUseData() 0\
}%~e local bagData=ssr.getBagData() 8D1+["& items=API_MergeTables(items,bagData) k!=
jO#)Rd local bind=isBind or false Yb
=Z`) local count=0 Lzy Ix!S for k,v in pairs(items) do Yo a|.
2f if bind then i5G"@4( --绑定 y -=YX qj if v.Name==itemName and v.Bind~=nil then 0="U'|J_ count=count+ v.OverLap <OA[u-ph%S end ^:
64(7 else x>*#cOVz;C --不绑定 IPEJ7n49 if v.Name==itemName and v.Bind==nil then 04P!l count=count+ v.OverLap !Ng~;2GoA end 026
|u|R end !a<}Mpeg end 0w<G)p~%n return count SE
D_^ end {*Tnl-m~ --读取人物坐标 HqKI|^ Mr
u ra>jVE0` gRQV)8uh function API_GetMapXY() C
Ch38qBp local aa = ssr.GetMainPlayerMapPos() HVkq{W|w local aa = string.format("x=%s,y=%s" #(f- cK , aa.x V/CZcMY_ , aa.y) jI~GRk return aa PAHkF& end 4M{]YZMw8 -eSZpz p -- 获取角色是否活着 v dR6y function API_IsRoleAlive() QZ^P2==x return ssr.IsRoleAlive() )7TuV" end 'X{J~fEI! Gp5[H}8K --读取聊天信息 1@p'><\ function API_ChatMsg() |6y(7Ha local function listcb(msg) )EptyH --table +!9&zYu! ChatTable = msg HDV
$y=oHh end c>pbRUMH
ssr.RegisterLUAEvent("OnAddChatItem", "增加聊天消息", listcb) -lNT"9 if ChatTable.mt == 1 and ChatTable.ChannelId == 3 or ChatTable.ChannelId == 6 then P
K9BowlW local ChatT = string.format( Y KWtsy "SendName=%s,SendId=%s,ChannelId=%s,mt=%s,SendTime=%s,Msg=%s" p5PTuJ>q , ChatTable.SendName ts=KAdcJ , ChatTable.SendId I@9[ , ChatTable.ChannelId vhot-rBN , ChatTable.mt .W1i3Z 6g , ChatTable.SendTime ( V^C7ix: , ChatTable.Msg) R7
j'XU return ChatT Z9vJF.clO end /C"?Y' end QH.zsqf( _q/UDf1 function API_ChatMaa() +PGtO9}B return ssr.GetMaxBag() UYW{AG2C end [ yf&]0 "
? t@Y --修理装备 8
DE%ot function API_CopyTable(original) "Oj2B|:s& local copy = {} 3El5g0'G for key, value in pairs(original) do }6#u}^gy if type(value) == "table" then B9Y*'hmI copy[key] = API_CopyTable(value) -|aNHZr else ZclZD{%8J copy[key] = value )/_T`cN end pXBlTZf end [23F0-p return copy
#:st>V_h end F4`5z)<* 修衣服 = "0,4" --衣服,头盔 ;*=MI/"N 修武器 = "1" "Nlw&+
c7 修项链 = "3" x;L.j7lzA; 修手镯 = "5,6" g9K7_T #W 修戒指 = "7,8" --左戒指 右戒指 i<uWLhgh1$ function API_Repair(npcName, itemPos) 4~
YPLu local npcId = API_GetNpcIdByName(npcName) >t Ll|O+ local tempData = ssr.getEquipData() Pe<}kS
m 4 local tobeRepair = {} 9u2Mra for k, v in pairs(tempData) do ->29Tns if string.find(itemPos, tostring(v["Where"])) and v["Dura"] ~= v["DuraMax"] then _(.,<R5 local tmp = { rW<sQ0 Name = v.Name, o6LZ05Z-& MakeIndex = v.MakeIndex, =SqI#v Where = v.Where J0Ik@ } t3b64J[A{ table.insert(tobeRepair, tmp) U6M3,"? ssr.TakeOffEquipRequest(v) k~+(X|!5w end nL]-]n; end ~:M"JNcs --脱完 开始修理 5Dv;-G; for k, v in pairs(tobeRepair) do eTrIN,4 local Name = v.Name U9ZWSDs local MakeIndex = v.MakeIndex Z+ ?V10$ local networkCtl = global.networkCtl _J+p[=[L networkCtl:SendMsg(1023, npcId, MakeIndex, 0, 0, Name, string.len(Name)) Pk6l*+"r< end +o7Np|Ou --开始穿 !W3bHy:C" local function ToDress() 5l
ioL)
for k, v in pairs(tobeRepair) do FsdxLMwk1 ssr.TakeOnEquipRequest(v, v["Where"]) *'&mcEpg end nC;2wQ6aO end A
tU!8Z local scheduleID = ssr.PerformWithDelayGlobal(ToDress, 1) WP b4L9< API_CloseNpcTalk() Y
Cbt(nmr end B}y`E
< fZ)M
Dq KNZN2N)wR v2tKk^6`(i 药店={0} +>,4d 首饰店={19,20,21,22,23,24,26} TtZ
'~cGR 衣服店={10,11,15,16,27,28,62,64} bw\a\/Dw 武器店={5,6} PIxd'B*MF 杂货店={3,25,2,30,31} M]JD( 铁匠铺={43} +zz\* 书店={4} X\dPQwas
M --检测背包是否有指定类型物品 zld[uhc> function API_IsNeedToStore(StdModes) Np?%pB!Q local function IsNeed(StdMode) 9Nkr=/I"P local bagData=ssr.getBagData() O%KP,q&}Y for k,v in pairs(bagData) do "\]NOA* if v.StdMode==StdMode then yS)73s/MrY return true OB{d^e} end lNw8eT~2 end Hi{1C"% local EquipProxy = global.Facade:retrieveProxy(global.ProxyTable.Equip) K4V\Jj1l local equip = EquipProxy:GetEquipData() |z`kFil% for k,v in pairs(equip) do Eoo[)V#x{ if v.StdMode==StdMode then S3oSc<&2 if tonumber(v.Dura)/v.DuraMax < 0.9 then viP.G/(\] return true G?t<4MTv end #ARQB2V end V&75n.L end (6*CORE
return false .*bu:FuDE end @D3Y}nR: +U:U/c5Z^ for k,v in pairs(StdModes) do }{(dG7G+ if IsNeed(v) then 0 kM
4\En return true +oT/
v3, end JQtBt2 end c[I4'x return false eA$wJ$* end 0F495'*A l; .
_
?H #EO@<
>I --范围内怪物个数 bool型返回distance yG`J3++
S function API_范围内怪物个数(distance, count) >)&]Ss5J local proxyUtils = requireProxy("proxyUtils") S-$N! G~! local mainPlayerID = global.gamePlayerController:GetMainPlayerID() L/U^1=Wi*O return proxyUtils.checkIsEnoughEnemy(mainPlayerID, count, distance) i#lnSJ08 end /2n-q_ --关闭NPC框 S?M'JoYy function API_CloseNpcTalk() g{_wMf global.Facade:sendNotification(global.NoticeTable.Layer_NPC_Talk_Close) 'fqX^v5n global.Facade:sendNotification(global.NoticeTable.GuideEventEnded, {name = "GUIDE_END_NPC_TALK_LAYER_CLOSED"}) qkEre end ?Bdhn{_ --无怪随机 z~S(OM@olJ function API_无怪随机() *&d>Vk."] local list = global.monsterManager.mMonstersInCurrViewField /ehmy
(zL local actors = {} 5a PPq~% for k, v in pairs(list) do _=wu>h&7 local actor = {} [vJLj>@ actor["mID"] = v:GetID() {-T}"WHg7 table.insert(actors, actor); c89+}]mGq end <h*r if #actors < 1 then DLWG0$#! API_UseItem("随机传送石") 1j9R^ local aa = API_GetItemCount(1078) `}Of'i if aa < 1 then fnwhkL#8 ssr.BuyStoreItemsById(2, 1) FKX+
z end o<Esh;;*nm end '
F)93SwU return #actors !Rq.L end R8*z}xy{ N'8u}WO --API_周围怪物数量 E=-ed9({: function API_周围怪物数量() '\MYC8" local list = global.monsterManager.mMonstersInCurrViewField sUCI+)cM3 local actors = {} _ \d[`7# for k, v in pairs(list) do a+U^mPe
local actor = {} *WHQ1geI8 actor["mID"] = v:GetID() x?aNK$A~X table.insert(actors, actor); ~6)
A/]6 end i; qb\ return #actors 7O=N78M end lhx"<kR4 qPn}$1+~ --API_周围人物数量 参数是 白名单 m>H+
noc^ function API_视野内敌人(Name, lv) Hd/|f; local list = global.playerManager.mPlayersInCurrViewField uX!5G:x] local myName = global.gamePlayerController:GetMainPlayer():GetName() d'oh-dj %^ local actors = {} s#8mD!T| local names = myName .. "," .. Name J|uxn<E<> for k, v in pairs(list) do R 2{ kS local actor = {} 95wi~
^^ actor["mID"] = v:GetID() >{seaihK actor["mName"] = v:GetName() B=>VP-: actor["mLv"] = (v.GetLevel and { v:GetLevel() } or { 0 })[1] V>$A\AWw --local myName=global.gamePlayerController:GetMainPlayer():GetName() r~q(m>Ct6 if not string.find(names, actor["mName"]) and tonumber(actor["mLv"]) > lv then u\jQe@j
' table.insert(actors, actor); -kGwbV} end n0ZrgTVJ end qy9RYIfZ return #actors @%oHt*u end #{m~=1%;Ya
_i/x4,=xv _uYidtxo= --自动捡 hyHeyDO2 API_NoBodyPickEnable=true r@O5{V uuD|%-Ng --捡取物品白名单 %OIJ. API_MyPlayerNames = "我不是药神," tRl01&0S Y#/mE!
& --全图捡 TbUouoc API_MapPickEnable = true xF#'+Y --自动存 .~nk'm API_InStoreEnable=false y:m
;_U,%c API_InStoreItems="" THVF(M4v --自动扔 R/_bk7o]H API_ItemDropEnable=false !R 2;]d* --自动用 o4^|n1vN API_ItemKeepCountEnable=true ;ewqGDe'3 --自动领取 17
k9h?s* API_GetMailItemEnable=false Sj[iKCEKtv --自动买回城石 ty W5k(> API_BuyStoneEnable=false B2R^oL'
} API_RecoveryItemMaxMoney=1000000 y
DE0qUO --地图 >-%}'iz+ API_PreMapName="盟重省" ]g3RVA%\l --开关 SJ4+s4!l
< API_TimerEnable=true 3tt3:`g HGwSsoS API_TimerEnable1s=true **D3.-0u& API_TimerEnable10s=true Az`c ?
W% --1S定时器 K1gZ>FEY|N function API_AutoSchedule1s() FQ3{~05T if GET_GAME_STATE() == "world" and API_TimerEnable1s then RZ6[+Ygn --自己设置的自动捡 A"V($:>U --API_PickItems() I:L}7uA[t --系统自动捡 MJzY| if API_NoBodyPickEnable then =o!1}'1 }} if API_IsInCurrViewField(API_MyPlayerNames) then 9 W7 ljUg API_OpenGroupPick(false) Bi
dTrO --release_print("来人,关自动捡") MXsCm( --API_RunAway() --逃跑 $ #*";b)QY --API_UseItem3Second("回城石") (2SmB`g else _x2i=SFo*$ API_OpenGroupPick(true) Mur)' API_PickItems() #Ns]l< --release_print("无人,开自动捡") *\n-yx] end :pp@x*uNP end ~\{a<
-R end YV{^2)^ end Ue=Je~Ri;9 --10s定时器 `hVi!Q]*P function API_AutoSchedule10s() w
|k?2 ?& if GET_GAME_STATE()=="world" and API_TimerEnable then C-}@.wr( --自动扔 Q|6lp if API_ItemDropEnable then EZY <k#
API_DropItemKeep("回城卷",2)
4eRV?tE9 end -PG81F&K ^D%hKIT --自动组队 ld7B!_b< if ssr.GetCurMapData().mapName == "石墓二层" or ssr.GetCurMapData().mapName == "石墓三层" or ssr.GetCurMapData().mapName == "地牢一层西" then ;UAi>//# API_InviteJoinTeam() O-=~
Bn
_ API_TeamApplyUpdate() --允许所有邀请 \C&[BQ\ end e2dg{n$6" fHLt{ !O --自动用消耗品 7eR%zNDa if API_ItemKeepCountEnable then Z)7|m if API_GetItemCount("强效金创药") > 1 then C3]"y7 API_UseItem("强效金创药") 4ZX6=-u^ end &>xd6- if API_GetItemCount("强效魔法药") > 1 then (v)/h>vS API_UseItem("强效魔法药") w<P$)~6 end Fcz}Gs4 if API_GetItemCount("太阳水") > 1 then rP7[{'%r API_UseItem("太阳水") :;g7T -_q end 4pJ #fkc^ if API_GetItemCount("魔法药(中量)") > 7 then vT&)
5nN API_UseItem("魔法药(中量)") auai@)v6 end [wO|P{8\" if API_GetItemCount("魔法药(中量)") < 1 then na4^>:r~ API_UseItem("魔法药(中)包") PsMp&~^ end *M]@}'N if API_GetItemCount("金创药(中量)") > 1 then Sc/\g API_UseItem("金创药(中量)") }t
FRl end Qf
.ASC if API_GetItemCount("护身符(大)") < 1 then HPus/#j'+ API_UseItem("回城卷") v]?zG&Jh end "G[yV>pxv if API_GetItemCount("魔法药(中量)") < 1 and SL:GetMetaValue("MAP_NAME") ~= "盟重省" and API_GetItemCount("魔法药(中)包") < 1 then %`# HGji) API_UseItem("回城卷") kR
!O-@GJ] end 6SqS\ 8 if SL:GetMetaValue("HP") < 30 and not SL:GetMetaValue("IN_SAFE_AREA") then l2*o@&. API_UseItem("回城卷") AhCqQ.O71 end XZ&cTjNB& end (X3}&aLF JnY.]: if API_GetMailItemEnable then (oxMBd+n1 global.networkCtl:SendMsg(global.MsgType.MSG_CS_EMAIL_GET_REQUEST, 2) I"hlLP global.Facade:sendNotification(global.NoticeTable.Layer_Enter_Current) i>aIuQ`pe end 5{Oq* | end t9\}!{<s end )s~szmJoVD }HKt{k&$ --定时器 v(`9+* function API_TimerStart() Pl\r|gS; --1S定时开关 Oj,v88= if API_AutoScheduleID1s == nil then !K %8tr4 API_AutoScheduleID1s = ssr.Schedule(API_AutoSchedule1s, 1) [a[.tR38e else b uu /Nz$ ssr.UnSchedule(API_AutoScheduleID1s) y7ZYo7avg API_AutoScheduleID1s = ssr.Schedule(API_AutoSchedule1s, 1) 4c'
F.0^ end ecsQshR --10S定时开关 @km@\w if API_AutoScheduleID10s == nil then 1va~.;/rG API_AutoScheduleID10s = ssr.Schedule(API_AutoSchedule10s, 10) lvd`_+P$ else m 5_ ssr.UnSchedule(API_AutoScheduleID10s) b9Mp@I7Q- API_AutoScheduleID10s = ssr.Schedule(API_AutoSchedule10s, 10) >|1$Pv? end _g2"D[I% end G&z^AV function API_IsInCurrViewField(names, level) t}wwRWo2?f local lv = level or 0 dZ,IXA yB local nameList = names or "" @9e}kiW local list = global.playerManager.mPlayersInCurrViewField xa[)fk$6 local actors = {} o FS2*u for k, v in pairs(list) do oB$c-!& local actor = {} p&$O}AX| actor["mID"] = v:GetID() &~KAZ}xu actor["mName"] = v:GetName() uefrE53 actor["mLv"] = (v.GetLevel and { v:GetLevel() } or { 0 })[1] pdySip< if not string.find(names, actor["mName"]) and tonumber(actor["mLv"]) > lv then E'cI} q table.insert(actors, actor); .gclE~h. end oiTSpd- end A:4?Jd> if #actors > 0 then NyR,@n1 return true [e f&|Pi- else k~XDwmt; return false X8\UTHT&0 end { u %xc"0y end '',g}WvRwe Ial"nV0>0 --打开组捡 ^5n#hSqZ=M function API_OpenGroupPick(isOpen) %:!ILN local GameSettingProxy = global.Facade:retrieveProxy(global.ProxyTable.GameSettingProxy) 2)MX<prH local count = 0 NA!?.zn for key, value in pairs(GameSettingProxy._pickConfig) do ;-Ki
`x.oJ count = count + 1
Jq*Q;}n end @:Emmzucv| local function SetGroup(pickgroup) ' +f(9/ for i = 1, count do dJF3]h Y GameSettingProxy:SetPickGroupValue(i, pickgroup) E"zC6iYZ; end {`ByZB end hlBMRx49 if isOpen then :ggXVwpe local pickgroup = { 1, 1, 1 } +.-g`Vyz* SetGroup(pickgroup) T$"s
w7< else I|<`Er-;58 local pickgroup = { 1, 1, 0 } ^jE8
"G* SetGroup(pickgroup) jR2^n`D end O~#A )d6 end 'mTQ=1 +yI2G!
$T9