This is probably in the wrong section but I need help with computercraft.
I have some variable in my program and i am trying to change then with an if then statement, but it seems that they are not changing. Can someone please help me. 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)
print("How many ingots/blocks should I mold?")
local Num = tostring( read() )
for i=1,Num do
rs.setOutput("mside",true)
os.sleep(1)
rs.setOutput("mside",false)
os.sleep(mtime)
end
I have some variable in my program and i am trying to change then with an if then statement, but it seems that they are not changing. Can someone please help me. 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)
print("How many ingots/blocks should I mold?")
local Num = tostring( read() )
for i=1,Num do
rs.setOutput("mside",true)
os.sleep(1)
rs.setOutput("mside",false)
os.sleep(mtime)
end