I am making a program in computercraft and it's not working for some reason. "turtle.select" and "turtle.drop" are the commands that don't seem to be working. It does the prints but skips over them. Everything else works fine and it can receive the messages from other computers. here is my code for the turtle. I am very new to computercraft so sorry for my bad code. Thanks!
rednet.open("right")
local x
local amount
senderId,message=rednet.receive()
x = message
os.sleep(1)
senderId,message=rednet.receive()
amount = message
print(x)
print(amount)
if x == "iron" then
turtle.select(1)
turtle.drop(amount)
end
if x == "cobalt" then
turtle.select(2)
turtle.drop(amount)
end
os.sleep(5)
os.reboot()
rednet.open("right")
local x
local amount
senderId,message=rednet.receive()
x = message
os.sleep(1)
senderId,message=rednet.receive()
amount = message
print(x)
print(amount)
if x == "iron" then
turtle.select(1)
turtle.drop(amount)
end
if x == "cobalt" then
turtle.select(2)
turtle.drop(amount)
end
os.sleep(5)
os.reboot()