rednet.open("right")
host = tonumber(18)
x,y,z = gps.locate()
rednet.send(host,x)
rednet.send(host,y)
while true do
id,message = rednet.receive()
while id ~= host do
id,message = rednet.receive()
end
print(message)
if message == move then
id,message = rednet.receive()
while id ~= host do
id,move = rednet.receive()
end
print(move) <--- here
tonumber(move)
move = move + 1
print(move)
for i = 1,move do
x,y,z = gps.locate()
if x ~= 30 then
turtle.forward()
turtle.forward()
turtle.forward()
elseif x == 30 then
turtle.forward()
turtle.forward()
turtle.turnRight()
end
end
end
end
Well I assume that's where I get because the last thing that is printed it the number that is sent
Need Help Stuck On Part Of Code
Started by Dejected, Oct 01 2013 05:51 PM
4 replies to this topic
#1
Posted 01 October 2013 - 05:51 PM
I need help I run the code and get to
#2
Posted 01 October 2013 - 06:57 PM
You need to assign move to the returned value of tonumber like this:
Functions cannot actually modify the arguments given to them, because they get a copy rather than a reference.
move = tonumber(move)
Functions cannot actually modify the arguments given to them, because they get a copy rather than a reference.
#5
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












