Posted 01 April 2012 - 04:37 PM
Here is my RC light program.
Lets say the target computer id is 105.
If I do:
That will turn the lights off.
But if I send it:
same if i send it:
term.clear()
term.setCursorPos(1,1)
print(Now running Turtle-Light on computer #" .. os.computerID())
rednet.open("right")
rednet.broadcast("TLS")
redstone.setOutput("front", true)
redstone.setOutput("back", true)
redstone.setOutput("left", true)
redstone.setOutput("right", true)
print("Now on.")
state,x,y,z = 1,nil,nil,nil
while true do
id, message, dis = rednet.receive()
if message ~= nil then
--print("Message received from: " .. id .. "nMessage reads: " .. message .. "nDistance is: " .. dis)
if message == os.computerID() .. "1" then
print("Turning On.")
redstone.setOutput("front", true)
redstone.setOutput("back", true)
redstone.setOutput("left", true)
redstone.setOutput("right", true)
state = 0
end
if message == os.computerID() .. "s" then
rednet.send(id, state)
end
if message == os.computerID() .. "l" then
x, y, z = gps.locate
rednet.send(id, x,y,z)
end
end
Lets say the target computer id is 105.
If I do:
rednet.send(105, "1050")
That will turn the lights off.
But if I send it:
rednet.send(105, "105s")
the computer running the program will crash with rednet:350: string expectedsame if i send it:
rednet.send(105, "105l")
Anybody know whats going on?