Here are the relevent lines of code (the whole programs are over 75 lines long right now):
Drone Deployer- I cut out the functions that do not pertain to the subject matter, such as "deployDrone()"
Spoiler
function variableDeclare()
rsInput = "back"
drone = peripheral.wrap("front")
x = 38
y = 38
table = {x,y}
droneCount = 0
end
function rnSend()
droneID = peripheral.call("front","getID")
print("Drone scanned")
msg = textutils.serialize(table)
print("Instructions encoded")
sleep(.4)
rednet.send(droneID, msg)
print("Instructions sent")
end
function masterLoop()
while true do
if redstone.getInput(rsInput) == true then
term.clear()
deployDrone()
term.setCursorPos(1,1)
write(droneCount)
print(" drones have been sent")
end
sleep(1)
end
end
if os.version() == "TurtleOS 1.4" then --I use disk drives to contain startup programs, making it more flexible to control turtles.
variableDeclare()
rednet.open("right")
masterLoop()
else sleep(.1)
end
Drone-
Spoiler
function rednetStart()
rednet.open("right")
print("Watching RedNet...")
id, msg = rednet.receive()
print("Instructions received")
write(table[1])
write(",")
print(table[2])
table = textutils.unserialize(msg)
x = toNumber(table[1])
y = toNumber(table[2])
print("Instructions decoded")
end
if os.version() == "TurtleOS 1.4" then
rednetStart()
masterLoop() --This is the function that controls what the turtle actually DOES
else sleep(.1)
end
The drone turtle is returning
Watching RedNet...
Instructions received
bios:156: bad argument: string expected, got nil
It might be a few days before I am able to get online again (in the process of changing internet companies, and we have to wait til the first to set up the new one.) I hope you can shine some light as to why it's not working. :P/>