Anonymous

Module:CombatAreas: Difference between revisions

From Melvor Idle
Added getAreaStat
(Added getAreaByID)
(Added getAreaStat)
Line 49: Line 49:
   elseif type == 'slayer' then type = 'slayerAreas' end
   elseif type == 'slayer' then type = 'slayerAreas' end
   return processArea(AreaData[type][id + 1], id + 1)
   return processArea(AreaData[type][id + 1], id + 1)
end
function p.getAreaStat(frame)
  local areaName = frame.args ~= nil and frame.args[1] or frame[1]
  local statName = frame.args ~= nil and frame.args[2] or frame[2]
  local area = p.getArea(areaName)
  if area == nil then
    return "ERROR: Could not find an area named "..areaName
  end
  return area[statName]
end
end