Skip to content

Commit

Permalink
add mooncontroller compatibility for luatool (#133)
Browse files Browse the repository at this point in the history
Co-authored-by: BuckarooBanzay <[email protected]>
  • Loading branch information
BuckarooBanzay and BuckarooBanzay authored Jun 10, 2023
1 parent 2dcc25c commit 79cc84a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion luatool/mod.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name=luatool
description=Provides metatool:luatool to copy/paste luacontroller or luatube code
depends=metatool
optional_depends=pipeworks,mesecons_luacontroller,mesecons_microcontroller
optional_depends=pipeworks,mesecons_luacontroller,mesecons_microcontroller,mooncontroller
15 changes: 10 additions & 5 deletions luatool/nodes/luacontroller.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,19 @@ local lpadcut = function(s, c, n)
return (c:rep(n - #s) .. s):sub(math.max(0, #s - n + 1), #s + 1)
end

local nodenameprefix = "mesecons_luacontroller:luacontroller"
local nodenameprefixes = {
"mesecons_luacontroller:luacontroller",
"mooncontroller:mooncontroller"
}

-- lua controller, 16 different nodes
local nodes = {}
for i=0,15 do
table.insert(nodes, nodenameprefix .. lpadcut(d2b(i), '0', 4))
for _, prefix in ipairs(nodenameprefixes) do
-- lua/moon controller, 16 different nodes
for i=0,15 do
table.insert(nodes, prefix .. lpadcut(d2b(i), '0', 4))
end
table.insert(nodes, prefix .. '_burnt')
end
table.insert(nodes, nodenameprefix .. '_burnt')

local ns = metatool.ns('luatool')

Expand Down

0 comments on commit 79cc84a

Please sign in to comment.