Ошибка в lua скрипте ( приложение для MineOS Minecraft OpenCompuetrs Mod OS)

привет всем писал приложение для MineOS ( OpenComputers Minecraft Mod ) на lua и после запуска получаю ошибку: attemp to index a nil value (local 'locz') Вот код:

-- Import libraries
local GUI = require("GUI")
local system = require("System")
local component = require("component")
local event = require("event")
local gpu = component.gpu
local unicode = require("unicode")
local reactor

---------------------------------------------------------------------------------

-- Add a new window to MineOS workspace
local workspace, window, menu = system.addWindow(GUI.filledWindow(1, 1, 60, 20, 0xE1E1E1))

-- Get localization table dependent of current system language

-- Add single cell layout to window
local layout = window:addChild(GUI.layout(1, 1, window.width, window.height, 1, 1))

local localization = system.getCurrentScriptLocalization()

local locz = system.getCurrentScriptLocalization()

if not component.isAvailable("br_reactor") then
  GUI.alert("reactor from extreme reactors doesn't connected to this computer!'")

else
  reactor = component.get("br_reactor")

  --Writing statistics and buttons to control
  layout:addChild(GUI.text(1, 1, 0x4B4B4B, locz .greeting .. system.getUser())) -- Ошибка здесь
  layout:addChild(GUI.text(1, 1, 0x4B4B4B, localization.greeting ))
  layout:addChild(GUI.text(1, 1, 0x4B4B4B, localization.fuellvl .. reactor.getFuelAmount() .. " / " .. reactor.getFuelAmountMax()))
  layout:addChild(GUI.text(1, 1, 0x4B4B4B, localization.fuelcns  .. reactor.getFuelConsumedLastTick()))  
  layout:addChild(GUI.text(1, 1, 0x4B4B4B, localization.fuelrec  .. reactor.getFuelReactivity()))
  layout:addChild(GUI.text(1, 1, 0x4B4B4B, localization.energycaption))
  layout:addChild(GUI.text(1, 1, 0x4B4B4B, localization.energylvl  .. reactor.getEnergyStored()))
  layout:addChild(GUI.text(1, 1, 0x4B4B4B, localization.energyprc  .. reactor.getEnergyProducedLastTick()))
  layout:addChild(GUI.text(1, 1, 0x4B4B4B, localization.energycap  .. reactor.getEnergyCapacity()))
  layout:addChild(GUI.text(1, 1, 0x4B4B4B, localization.temperaturecaption))
  layout:addChild(GUI.text(1, 1, 0x4B4B4B, localization.temperaturecasing  .. reactor.getCasingTemperature()))
  layout:addChild(GUI.text(1, 1, 0x4B4B4B, localization.temperaturefuel  .. reactor.getFuelTemperature()))
  layout:addChild(GUI.text(1, 1, 0x4B4B4B, localization.wastecaption))
  layout:addChild(GUI.text(1, 1, 0x4B4B4B, localization.wastelvl  .. reactor.getWasteAmount()))

  -- Customize MineOS menu for this application by your will
  local contextMenu = menu:addContextMenuItem("File")
  contextMenu:addItem("Close").onTouch = function()
    window:remove()
  end

  -- Create callback function with resizing rules when window changes its' size
  window.onResize = function(newWidth, newHeight)
    window.backgroundPanel.width, window.backgroundPanel.height = newWidth, newHeight
    layout.width, layout.height = newWidth, newHeight
  end

  ---------------------------------------------------------------------------------

  -- Draw changes on screen after customizing your window
  workspace:draw()
end

Ответы (0 шт):