[Help] = Expected Error while calling function.

local companyName = "Onex Industries" --name of your company

local cableSide = "bottom" --This station is cabled from the bottom

local coolDownCol = colors.blue --heat at 500 or more local heatUpCol = colors.red --shutoff temp gauge local controlCol = colors.black --reactor on/off local ffCol = colors.cyan -- Forcefield Power

os.pullEvent = os.pullEventRaw

--Declare and set reactor state variables local reactorEnabled = true local timeActive = 0 local previousCycle = 0 local timeCool = 0 local ffActive = false local secondsActive = 0 local secondsCool = 0 local minutesActive = 0 local minutesCool = 0

local autoFeedback = "..." local manualInput = "..."

local width, height = term.getSize() --Store the size of the screen

local function clearScreen() term.clear() --Clear the screen --Print the program and company names term.setCursorPos(1, 1) term.write("Nuclear Reactor Control Unit") term.setCursorPos(width-#companyName+1, height) term.write(companyName) end

local function doTick() --Increment reactor active timer and check inputs timeActive = timeActive + 1 local hot = rs.testBundledInput(cableSide, heatUpCol) local cold = rs.testBundledInput(cableSide, coolDownCol) end

if reactorEnabled then if hot then --Disable the reactor, because it is too hot reactorEnabled = false previousCycle = timeActive timeActive = 0 end else if not cold then --Enable the reactor, because it has cooled down reactorEnabled = true timeCool = timeActive timeActive = 0 end end clearScreen() term.setCursorPos(1,1) term.write("REACTOR ROOM CONTROL CONSOLE: ") term.setCursorPos(1,2) --FULL CHECK if reactorEnabled then term.write("Reactor is Active") else term.write("Reactor is NOT Active") end --END CHECK term.setCursorPos(1, 4) term.write("Current Status: ") term.setCursorPos(1, 5) if reactorEnabled then if hot then term.write("|Check Fuel| |Running| >Over Heating<") elseif cold then term.write("|Check Fuel| >Running< |Over Heating|") else term.write(">Check Fuel< |Running| |Over Heating|") end end term.setCursorPos(1, 7) term.write("Current Cycle Runtime: ") term.setCursorPos(1, 8) if timeActive > 0 then math.ceil(timeActive) secondsActive = timeActive/4 minutesActive = secondsActive/60 secondsActive = secondsActive-(minutesActive60) term.write(minutesActive .. ":" .. secondsActive) else term.write("ERROR") end term.setCursorPos(1, 10) term.write("Previous Cooling Cycle Time: ") term.setCursorPos(1, 11) if timeCool > 0 then math.ceil(timeCool) secondsCool = timeCool/4 minutesCool = secondsCool/60 secondsCool = secondsCool-(minutesCool60) term.write(minutesCool .. ":" .. secondsCool) else term.write("ERROR") end term.setCursorPos(1, 13) term.write("Reactor Room Forcefield: ") term.setCursorPos(1, 14) if ffActive then term.write("Online - ROOM IS LOCKED") else term.write("Offline - ROOM IS UNLOCKED") end term.setCursorPos(1, 17) sleep(.25) --Four ticks to the second eof local function freshPrince manualInput = io.read if manualInput == "Frisky Dingo" rs.setBundledOutput(cableSide, controlCol) term.setCursorPos(1, 16) term.write("Reactor Power Toggled") term.setCursorPos(1, 17) end if manualInput == "FF" rs.setBundledOutput(cableSide, ffCol) term.setCursorPos(1, 16) term.write("Energy Field Toggled") term.setCursorPos(1, 17) end eof

while true do parallel.waitForAny(freshPrince, doTick)

end end

/r/ComputerCraft Thread Parent