LUACN论坛

 找回密码
 加入我们

QQ登录

只需一步,快速开始

搜索
热搜: YJWOW MagicStone BoL
楼主: 贾维斯117

ni辅助教程,自定义函数及移植wowbee函数

  [复制链接]
发表于 2023-11-10 22:46:36 | 显示全部楼层
魔蜂能不能调用NI的函数呢?毕竟魔蜂通俗上手
回复 支持 反对

使用道具 举报

发表于 2023-11-17 13:26:03 | 显示全部楼层
谢谢楼主的分享,学到了
回复 支持 反对

使用道具 举报

发表于 2023-11-18 15:44:15 | 显示全部楼层
6666666666666666666666663333
回复 支持 反对

使用道具 举报

发表于 2023-11-18 23:04:30 | 显示全部楼层
学习大佬的新玩具 看看
回复 支持 反对

使用道具 举报

发表于 2023-11-29 11:40:02 | 显示全部楼层
学习学习,可惜我都没看懂。
回复 支持 反对

使用道具 举报

发表于 2023-12-20 20:21:39 | 显示全部楼层
回帖是一种美德 而且还有好处拿!
回复 支持 反对

使用道具 举报

发表于 2023-12-21 11:51:44 | 显示全部楼层
大佬能帮忙看看魔蜂函数BeeGroupCountScript移植调用失败,帮忙看看什么问题可以么。我把代码发下。
wb.BeeGroupCountScript= function (String,StrReturn,group) --小队或者团队里符合条件的人物信息数量
local count =0;
local u;

        if not(group == "party" or group=="partypet"  or group=="raid"  or group=="raidpet" or group=="arena"  or group=="arenapet" ) then
        DEFAULT_CHAT_FRAME:AddMessage("group 参数不对")
        return false
        end
         
        if String==nil or StrReturn == nil then
       
                DEFAULT_CHAT_FRAME:AddMessage("String 或 StrReturn 参数不能为空")
                return false
        end
       
        local str ='function TEMP_BeeGroupCount(name,class,race,spell,unit,guid,spellcd) local wb = ni.utils.require("wowbee");if ' .. String .. ' then return ' .. strReturn .. '; else return false; end end'
        RunScript(str);
       
        local name,class,race,spell,unit,spellcd,guid;
       
        local Members ,minimum,temp_unit ;
        local temp_n =nil;
       
        if group == "party" or group=="partypet"   then
                Members =GetNumGroupMembers()+1 ;
        elseif group=="raid"  or group=="raidpet" then
                Members =GetNumGroupMembers() ;
        elseif group=="arena" then
                Members =5;
        elseif group=="arenapet" then
                Members =5;
        end

        for i=1, Members do
                if i==Members and group == "party" then
                unit="player"
                elseif i==Members and group == "partypet" then
                unit="pet"
                else
                unit=group .. tostring(i);
                end
               
                if UnitName(unit)then
               
                         --bufflist = BeeUnitBuffList(unit);
                         name = UnitName(unit);
                         class = UnitClass(unit);
                         race = UnitRace(unit);
                         spell = wb.BeeUnitCastSpellName(unit);
                         spellcd = wb.BeeUnitCastSpellTime(unit);
                         guid = UnitGUID(unit);
                 
                        minimum = TEMP_BeeGroupCount(name,class,race,spell,unit,guid,spellcd);
                 
                        if minimum then
                         u = unit;
                                count = count +1;
                        end       
                end
        end       
        --        DEFAULT_CHAT_FRAME:AddMessage(v)

        return count,u;
end
回复 支持 反对

使用道具 举报

发表于 2023-12-23 17:51:37 来自手机 | 显示全部楼层
治疗脚笨全靠找血量最低的函数  如果不移植 怎么用ni自己写
回复 支持 反对

使用道具 举报

发表于 2023-12-25 12:08:17 | 显示全部楼层
感谢楼主无私奉献~~~~妈妈再也不但新我的ni辅助教程不会用le
回复 支持 反对

使用道具 举报

 楼主| 发表于 2023-12-25 16:23:23 | 显示全部楼层
一壶漂泊 发表于 2023-12-23 05:51 PM
治疗脚笨全靠找血量最低的函数  如果不移植 怎么用ni自己写

[Lua] 纯文本查看 复制代码
	if (enables["治疗他人"] or ni.vars.combat.cd) and not ni.unit.buff("player","影遁") and (GetNumRaidMembers()>0 or GetNumPartyMembers()>0) then
			if enables["圣佑术"] then
				if ni.spell.available("圣佑术") and UnitAffectingCombat("player") and not UnitIsDeadOrGhost("player") then
				local lowest = ni.members.inrangebelow("player", 40, values["圣佑术"])[1] 
						if lowest and lowest:valid("圣佑术", false, true) and not lowest:debuffs("自律") then
							return lowest:cast("圣佑术")
						end
				end
			end


inrangebelow                                                                                                                       
Arguments:
unit guid|token
distance number
hp number
Returns: table
返回一个成员表,这些成员位于单位指定的距离内,并且低于传递的 HP 阈值。
[Lua] 纯文本查看 复制代码
local members_below = ni.members.inrangebelow("player", 10, 60); --Returns a table of all the members within 10 yards of the player that are below 60% health

api有很多东西看
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

小黑屋|手机版|Archiver|LUACN论坛

GMT+8, 2026-1-12 08:47 AM , Processed in 0.037026 second(s), 28 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表