Posted 12 January 2014 - 02:08 AM
Title: Lua error control:50: 0 and control:57:
Hi, i am new to the forums, but im old with computercraft *-* , about 1 year ago C:
I talk spanish, but i can understand english and type in english C:
I know lua but not too much as pro's D:
I need help, im making a IC2 nuclear control menu, its VEEERY simple.
Here is the code:
strings are in spanish, dont give them attention, i have a problem with a pheripheral or the menusel() functio
They are diferent errors (2 diferent errors) here are some screenshots :
error 1: when i want to turn off the reactor energy / cutoff(energia saliente)
error 2: when i want to turn ON another output while one is ON:
Yes, i use extraperipherals mod from pzyber, it only adds 1 block, a Bundled Conector
that adds compatibility with redproject bundled cables and redlogic ones
Can someone please help me? i think the error is in p.setBundledOutput(onoffcolor, energycolor)
Thanks!
Hi, i am new to the forums, but im old with computercraft *-* , about 1 year ago C:
I talk spanish, but i can understand english and type in english C:
I know lua but not too much as pro's D:
I need help, im making a IC2 nuclear control menu, its VEEERY simple.
Here is the code:
function clear()
term.clear()
term.setCursorPos(1, 1)
end
local function cprint(text)
local x,y = term.getSize()
local x2,y2 = term.getCursorPos()
term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
print(text)
end
local function cwrite(text)
local x,y = term.getSize()
local x2,y2 = term.getCursorPos()
term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
write(text)
end
local reactor = ("2")
local nucleo = ("4")
local onoffcolor = (colors.red)
local energycolor = (colors.blue)
local onoff = "OFF"
local energy = "OFF"
local p = peripheral.wrap("back")
function menu()
clear()
term.setTextColor(32)
cprint("Reactor " ..reactor)
cprint("#===============================================#")
cprint("# #")
cprint("# Nucleo " ..nucleo .." #")
cprint("# 1- Apagar/Prender el reactor #")
cprint("# 2- Cortar/Abrir energia saliente #")
cprint("# Estado del nucleo " ..onoff .." #")
cprint("# Energia Saliente: "..energy .." #")
cprint("# #")
cprint("#===============================================#")
end
function menusel()
cwrite("Su eleccion:")
input = read()
if input == "1" and onoff == "OFF" and energy == "OFF" then
p.setBundledOutput(onoffcolor)
onoff = " ON"
sleep(1)
clear()
menu()
menusel()
elseif input == "1" and onoff == " ON" and energy == "OFF" then
p.setBundledOutput()
onoff = "OFF"
sleep(1)
clear()
menu()
menusel()
elseif input == "1" and onoff == "OFF" and energy == " ON" then
p.setBundledOutput(onoffcolor, energycolor)
onoff = " ON"
sleep(1)
clear()
menu()
menusel()
elseif input == "1" and onoff == " ON" and energy == " ON" then
p.setBundledOutput(energycolor)
onoff = "OFF"
sleep(1)
clear()
menu()
menusel()
elseif input == "2" and onoff == "OFF" and energy == "OFF" then
p.setBundledOutput(energycolor)
energy = " ON"
sleep(1)
clear()
menu()
menusel()
elseif input == "2" and onoff == "OFF" and energy == " ON" then
p.setBundledOutput()
energy = "OFF"
sleep(1)
clear()
menu()
menusel()
elseif input == "2" and onoff == " ON" and energy == "OFF" then
p.setBundledOutput(onoffcolor, energycolor)
energy = " ON"
sleep(1)
clear()
menu()
menusel()
elseif input == "2" and onoff == " ON" and energy == " ON" then
p.setBundledOutput(onoffcolor)
energy = "OFF"
sleep(1)
clear()
menu()
menusel()
else
cprint("Seleccion incorrecta")
sleep(1)
clear()
menu()
menusel()
end
end
menu()
menusel()
strings are in spanish, dont give them attention, i have a problem with a pheripheral or the menusel() functio
They are diferent errors (2 diferent errors) here are some screenshots :
error 1: when i want to turn off the reactor energy / cutoff(energia saliente)
error 2: when i want to turn ON another output while one is ON:
Yes, i use extraperipherals mod from pzyber, it only adds 1 block, a Bundled Conector
that adds compatibility with redproject bundled cables and redlogic ones
Can someone please help me? i think the error is in p.setBundledOutput(onoffcolor, energycolor)
Thanks!