Based on the second bit of code, it looks like 'message' is some sort of table. I think.
Could you post the all the code involved? That would make it much easier to see what you are trying to do.
Okay, the wireless computer's code is here:
rednet.open("back")
while true do
term.clear()
term.setCursorPos(1,1)
print("Command:")
command = read()
rednet.send(28,command)
end
And the code for the turtle is as follows:
rednet.open("left")
rednet.send(12,"MineBot now operating")
while true do
id,message = rednet.receive()
if id == 7 then
if message == "mine" then
H = 0
rednet.send(12,"Mining...")
repeat
turtle.digDown()
turtle.down()
turtle.dig()
turtle.forward()
H = H + 1
if turtle.getFuelLevel() == 0 then
turtle.refuel()
local x, y, z = gps.locate(5)
if not x then
rednet.send(12,"Could not find location")
else
rednet.send(12,"MineBot Location: " .. x .. "," .. y .. "," .. z .. " ")
end
end
until H == 50
end
if message == "return" then
rednet.send(12, "Returning to surface")
turtle.turnRight()
turtle.turnRight()
H = 50
repeat
turtle.up()
sleep(0.1)
turtle.forward()
sleep(0.1)
H = H - 1
until H == 0
if H == 0 then
turtle.turnRight()
turtle.turnRight()
end
end
if message == "180" then
turtle.turnRight()
turtle.turnRight()
end
if message == "forward" or message == "f" then
turtle.forward()
end
if message == "back" or message == "b" then
turtle.back()
end
if message == "up" then
turtle.up()
elseif message =="up1" then
turtle.up()
turtle.forward()
end
if message == "down" then
turtle.down()
elseif message == "down1" then
turtle.down()
turtle.forward()
end
if message == "left" then
turtle.turnLeft()
end
if message == "right" then
turtle.turnRight()
end
if message == "reboot" then
rednet.send(12,"Restarting turtle...")
sleep(2)
os.reboot()
end
if message == "gps" then
local x, y, z = gps.locate(5)
if not x then
rednet.send(12,"Could not find location")
else
rednet.send(12,"Current location: ".. x .. "," .. y .. "," .. z .. " ")
end
end
if message == "off" then
rednet.send(12,"Powering off...")
sleep(1)
rednet.send(12,"System is offline.")
os.shutdown()
end
if message == "save" then
rednet.send(12,"Writing to disk...")
sleep(2)
if disk.isPresent("right") then
if disk.hasData("right") then
disk.setLabel("right","MineOS 1.0.0")
shell.run("cp","startup","disk/MineOS1.0")
rednet.send(12,"Success!")
sleep(2)
rednet.send(12,"Ejecting floppy disk...")
disk.eject("right")
else
rednet.send(12,"No floppy disk found")
end
elseif disk.isPresent("left") then
if disk.hasData("left") then
disk.setLabel("left","MineOS 1.0.0")
shell.run("cp","startup","disk/MineOS1.0")
rednet.send(12,"Success!")
sleep(2)
rednet.send(12,"Ejecting floppy disk...")
disk.eject("left")
else
rednet.send(12,"No floppy disk found")
end
elseif disk.isPresent("back") then
if disk.hasData("back") then
disk.setLabel("back","MineOS 1.0.0")
shell.run("cp","startup","disk/MineOS1.0")
rednet.send(12,"Success!")
sleep(2)
rednet.send(12,"Ejecting floppy disk...")
disk.eject("back")
else
rednet.send(12,"No floppy disk found")
end
elseif disk.isPresent("front") then
if disk.hasData("front") then
disk.setLabel("front","MineOS 1.0.0")
shell.run("cp","startup","disk/MineOS1.0")
rednet.send(12,"Success!")
sleep(2)
rednet.send(12,"Ejecting floppy disk...")
disk.eject("front")
else
rednet.send(12,"No floppy disk found")
end
elseif disk.isPresent("top") then
if disk.hasData("top") then
disk.setLabel("top","MineOS 1.0.0")
shell.run("cp","startup","disk/MineOS1.0")
rednet.send(12,"Success!")
sleep(2)
rednet.send(12,"Ejecting floppy disk...")
disk.eject("top")
else
rednet.send(12,"No floppy disk found")
end
elseif disk.isPresent("bottom") then
if disk.hasData("bottom") then
disk.setLabel("bottom","MineOS 1.0.0")
shell.run("cp","startup","disk/MineOS1.0")
rednet.send(12,"Success!")
sleep(2)
rednet.send(12,"Ejecting floppy disk...")
disk.eject("bottom")
else
rednet.send(12,"No floppy disk found")
end
else
rednet.send(12,"No disk drive present")
end
end
if message == "fuel" then
local fuel = turtle.getFuelLevel()
rednet.send(12,"Fuel remaining: "..fuel.." blocks")
end
end
end
Hope this helps!