sandalle / minecraft_bigreactor_control

Minecraft BigReactor Computercraft Control Program
MIT License
76 stars 41 forks source link

CraftOS 1.7 issue #48

Closed jasonnyland closed 9 years ago

jasonnyland commented 9 years ago

When running EZ-Nuke on a server with CraftOS 1.7, it quits out on startup shows an error on line 273 "attempt to call nil" on the 3x2 monitor.

Original code:

local function termRestore()

  local ccVersion = nil
  ccVersion = os.version() 
        if ccVersion == "CraftOS 1.6" then
                term.native()
        elseif ccVersion == "CraftOS 1.5" then
                term.restore()
        else -- Default to older term.restore
                printLog("Unsupported CraftOS found. Reported version is \""..ccVersion.."\".")
                term.restore()
        end -- if ccVersion
end -- function termRestore()

The error is on the printLog line

Quick fix:

local function termRestore()

                term.native()

end -- function termRestore()

You might want to rework the version check... I have no idea what any of that stuff does or why it's important. I just went to the line with the error, assumed that 1.7 might use the same option as 1.6, and got rid of all the other options and it works. Hope that helps.

jasonnyland commented 9 years ago

Fixed the line and added 1.7 to the version check, should be ready to drop in:

local function termRestore()

  local ccVersion = nil
  ccVersion = os.version() 
        if ccVersion == "CraftOS 1.6" or "CraftOS 1.7" then
                term.native()
        elseif ccVersion == "CraftOS 1.5" then
                term.restore()
        else -- Default to older term.restore
                printLog("Unsupported CraftOS found. Reported version is "\"..ccVersion.."\".")
                term.restore()
        end -- if ccVersion
end -- function termRestore()
sandalle commented 9 years ago

Fixed in 0.3.16 and uploaded to Pastebin/fguScPBQ .