-- CountMobs by Rock5 -- Version 0.4 pre 745 version local function isFriend(pawn) if not pawn then return false end pawn:update() -- Pets are friends if( player.PetPtr ~= 0 and pawn.Address == player.PetPtr ) then return true; end -- Are they in party if settings.profile.options.PARTY == true and pawn.InParty then return true end -- Are they on the friends list for i,v in pairs(settings.profile.friends) do if( string.find( string.lower(pawn.Name), string.lower(v), 1, true) ) or tonumber(v) == pawn.Id then return true; end end return false; end function CountMobs(onlyaggro, inrange) local aggrocount = 0 local objectList = CObjectList(); objectList:update(); for i = 0,objectList:size() do local obj = objectList:getObject(i); if obj ~= nil and obj.Type == PT_MONSTER and (inrange == nil or inrange >= distance(player.X,player.Z,player.Y,obj.X,obj.Z,obj.Y) ) then local pawn = CPawn(obj.Address); if pawn.Alive and pawn.Attackable then if onlyaggro == true then if pawn.TargetPtr == player.Address then aggrocount = aggrocount + 1 end else aggrocount = aggrocount + 1 end end end end return aggrocount end function CountPlayers(inrange, printnames, ignoreFriends) local count = 0 local objectList = CObjectList(); objectList:update(); for i = 0,objectList:size() do local obj = objectList:getObject(i); if obj ~= nil and obj.Type == PT_PLAYER and obj.Address ~= player.Address and obj.Name ~= "" and (inrange == nil or inrange >= distance(player.X,player.Z,player.Y,obj.X,obj.Z,obj.Y) ) then if ignoreFriends ~= true or isFriend(CPawn(obj.Address)) == false then count = count + 1 if printnames == true then printf(obj.Name.."\t") end end end end if printnames == true then printf("\n") end return count end