The code at this level (friend or foe) doesn’t have lua template so I think I made one:
while true do
local friend = self:findNearestFriend()
if friend then
self:say("To battle, " .. friend.id + "!")
end
-- Now tell the enemy to go away
end