This is a menu program which he uses to control his security stations and forcefields.
Shown in this video.
I have this so far from copying from what I can see in the videos I copied the two functions and guessed what to do after that.
local currline = 0 local pos pos = 1 local loctable local postable local linetable linetable = {} postable = {} loctable = {} local event local keypressed local countlines local page page = 1 function readFile() file = io.open("power","r") for line in file:lines() do currline = currline + 1 for name, active in string.gmatch(line, "(.+):(/>/>/>%a)") do print(name.."="..tostring(active)) loctable[name] = active end end file:close() end function printMenu() file = io.open("power","r") term.clear() term.setCursorPos(1,1) local currpos local wire = 0 currpos = 1 countlines = 0 for line in file:lines() do for name, active in string.gmatch(line, "(.+):(/>/>/>%w+)") do loctable[name] = active countlines = countlines + 1 wire = redstone.getBundledOutput("bottom") if active == "Open" then term.setTextColor(colors.lime) wire = colors.combine(wire, 2^countlines) else term.setTextColor(colors.red) wire=colors.subtract(wire, 2^countlines) end redstone.setBundledOutput("bottom", wire) if currpos == pos then print(name.."="..active.."*") else print(name.."="..active) end postable[countlines] = active linetable[countlines] = line currpos = currpos+1 end end term.setTextColor(colors.white) file:close() end readFile() while true do printMenu() local event, a = os.pullEvent("key") if a == 200 then pos = pos - 1 printMenu() end if a == 208 then pos = pos + 1 printMenu() end if a == 28 then printMenu() end end
Hope you can help me figure this out!
thanks!