i were want to create a chat power switch. but now i can see this
--{#CODE#}--
script.on_event(defines.events.on_console_chat, function(event)
local line = event.message ; local i = 1 ; local w = {}
local condics = {on = 'online', off = 'offline'}
for token in string.gmatch(line, "[^%s]+") do
w[i] = token
i = i + 1
end
function playerLprint(state)
for _, player in pairs(game.players) do
if player.force == output.entity.force then
player.print("power "..state)
end
end
end
function setSignalLuaCombinator(count)
local tipe = 'signals' ; name = 'B'
output:clear()
output:set_count(tipe,name,count)
end
if w[1] == "IFAUW.Inc" then
if w[2] == "Power" then
if w[3] == "1" then
if w[4] == "set" then
if w[5] == condics['on'] then
playerLprint(condics['on'])
setSignalLuaCombinator(1)
end
if w[5] == condics['off'] then
playerLprint(condics['off'])
setSignalLuaCombinator(0)
end
end
end
end
end
end)
--{#LOG#}--
Error while running event LuaCombinator::on_console_chat (ID 71)
LuaEntity doesn't contain key set_circuit_condition.
stack traceback:
LuaCombinator/output.lua:11: in function 'clear'
[string "entities = global.variable.lamp.entities;cond..."]:1: in function 'setSignalLuaCombinator'
[string "entities = global.variable.lamp.entities;cond..."]:1: in function <[string "entities = global.variable.lamp.entities;cond..."]:1>