Posted 23 July 2013 - 02:42 PM
I am very new to computercraft. I am trying to change a variable through an if then statement. Here is my code
local mtime
local mside
print("Should I make blocks(b ) or ingots(i)?")
local ch = tostring( read() )
if ch == b then
mtime = 14
mside = left
end
if ch == i then
mtime = 3
mside = right
end
print(mtime)
this is the part where im renaming the variables, there is more to the program but the rest is not important
the problem is that the variable dont seem to be changing. I set it to print, but nothing shows up when it prints, as if the variable hasnt been assigned.
Please help
local mtime
local mside
print("Should I make blocks(b ) or ingots(i)?")
local ch = tostring( read() )
if ch == b then
mtime = 14
mside = left
end
if ch == i then
mtime = 3
mside = right
end
print(mtime)
this is the part where im renaming the variables, there is more to the program but the rest is not important
the problem is that the variable dont seem to be changing. I set it to print, but nothing shows up when it prints, as if the variable hasnt been assigned.
Please help