Patched LuaCombinator

by aahaxor

Finally updated from 0.12 to 0.16! A combinator to run lua commands ingame.

Utilities
6 years ago
0.14 - 0.16
10

b it's broken!

6 years ago
(updated 6 years ago)

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>

6 years ago

Alright, I'm looking this up... turns out that factorio removed set_circuit_condition from LuaEntity without me noticing. I'll get onto fixing this :)
Sorry for the wait, just started senior year of high school and I'm a bit busy :)

6 years ago
(updated 6 years ago)

Buying 1k plastic! i pay in copper plates 1:10 ratio!
EDIT:: sorry i had to =p

New response