--[[nef_20221122 UNHOMED_script This script will give a hot link list of units that are unhomed. It runs directly when loaded. Requires FEATURED_TEXT and SUPPORT_basic. ]] do -- UNHOMED_script -- SOH local featured = setmetatable({},{ -- FEATURED_TEXT __index = function(t,k) local ft = log.featured return assert(ft and ft[k], 'Featured text not loaded.' ) end;}) local function bbcode(...) bbcode = featured.bbcode; return bbcode (...) end local SP = setmetatable({},{ -- SUPPORT_basic __index = function(t,k) local SP = game.SP return assert(SP and SP[k], 'Support package not loaded.') end;}) local function user (...) user = SP.user; return user (...) end local function colored_link(...) colored_link = SP.colored_link; return colored_link(...) end -- STX local report = function(tile,...) if chat then chat.msg(...) log.normal(...) else notify.event(user(),tile,E.BROADCAST_REPORT,...) end end local function p_report (...); p_report = report; p_report(nil, bbcode('b',"Unhomed units.")); p_report(...) end for unit in user():units_iterate() do if unit.homecity == 0 then p_report(unit.tile, colored_link(unit)) end end; if p_report ~= report then report(nil, "No unhomed units.") end end -- end UNHOMED_script