Responding to LUA code as a function

I am starting to play with LUA code and I have a few questions.

I have been able to assemble as piece of code to identify what tool is mounted on the UTM

local tool_id = get_device("mounted_tool_id")

local tool = api({ url = "/api/tools/" .. tool_id })
if not tool then
toast("API error", "error")
end
toast(tool.name .. " is in the UTM", "success")

My question is - Is it possible to pass the parameter ‘tool.name’ into a sequence say via an IF statement to make code decisions? Or am I stuck in LUA code?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.