Hello.
Is this possible send to function array as first parametr?
function gotoBestLabel( section, a, b, z, ...)
local labels = ...
local section = section or false
if type(section) == 'string' then gotolabel(0,section) end
local a = a or $posx
local b = b or $posy
local z = z or $posz
local wptinfo = {}
local distance = {}
for _,lab in ipairs(labels) do
foreach settingsentry s 'Cavebot/Waypoints' do
if get(s, 'Label') == lab then
xyz = get(s, 'Coordinates')
x1,y1,_ = string.match(xyz,'x:(%d+), y:(%d+), z:(%d+)')
end
end
if tilereachable( x1, y1, z, true ) then
table.insert( wptinfo, {id = getwptid(labels[v]), label = lab, x = x1, y = y1, dist = getdistancebetween(x1, y1, z, a, b, z)})
table.insert( distance, getdistancebetween(x1, y1, z, a, b, z) )
end
end
local min = table.min(distance)
for _,lab in pairs(wptinfo) do
if lab.dist == min then
return lab.label--gotolabel(lab.id)
end
end
end
when i got this i must run all time
gotoBestLabel( nil, nil, nil, nil, {'A','B','C'})
but i want
gotoBestLabel( {'A','B','C'})