pmatt

HOWTO - Quick LUA script to check hub configuration

Discussion created by pmatt on Oct 1, 2012

Hi all

 

This script is handy for returning the secondary hub config for all robots attached to a given hub. It will also hopefully give you a bunk up if you are starting some LUA scripting.

 

local domain = "domain goes here"
local hub_address = "hub address goes here"
local hub_name = "hub robot name goes here"
local robot_table = nimbus.request ("/"..domain.."/"..hub_address.."/"..hub_name.."/hub","getrobots")

for k,v in pairs(robot_table.robotlist) do
   local robot_hub = nimbus.request (v.addr,"gethub")
   print (v.addr .. "\t\t" .. robot_hub.phub_name .. "\t\t" .. robot_hub.shub_name)
end

 

cheers

Paul

Outcomes