jamesc4 Posted November 11, 2019 Share Posted November 11, 2019 Hello, Is there a way from Composer 3x to get counts on Keypads, Switches etc? Quote Link to comment Share on other sites More sharing options...
RyanE Posted November 11, 2019 Share Posted November 11, 2019 You just mean the number of them in the project? If you know the .c4i name of them, and have a DriverWorks driver in the project that lets you execute code in the Lua Command window, you can use something like this (which should list keypads and light-type devices based on the two proxies in the code): local DEVICES = {["Keypads"] = "keypad_proxy.c4i", ["Lights and Switches"] = "light_v2.c4i"} local out, tins = {}, table.insert for title, c4i in pairs(DEVICES) do local count = 0 tins(out, "----------------- " .. title .. " -----------------") for k,v in pairs(C4:GetDevicesByC4iName(c4i)) do tins(out, v) count = count + 1 end tins(out, "----------------------------------") tins(out, "Total " .. title .. ": " .. count) tins(out, " ") end print(table.concat(out, "\n")) The table.insert / table.concat out stuff is so that the output is all printed at once, so lines don't come out of order on Lua Output. It's also faster, although that doesn't much matter here. RyanE Quote Link to comment Share on other sites More sharing options...
crazybuppie Posted November 11, 2019 Share Posted November 11, 2019 I bet if you asked RyanE how to cook a thanksgiving dinner, he could whip up a lua script that would do it Quote Link to comment Share on other sites More sharing options...
RyanE Posted November 11, 2019 Share Posted November 11, 2019 16 minutes ago, crazybuppie said: I bet if you asked RyanE how to cook a thanksgiving dinner, he could whip up a lua script that would do it There are already Oven drivers... RyanE mujtaba.khokhar 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.