Posted 20 December 2013 - 09:24 PM
Hello,
So I coded an API for use with transmitting rednet signals. I have already verified that the API can be loaded and is transmitting signals successfully. However upon trying to use some of the other functions it says Attempt To Call Nil on line 6. I have tried it with calling the other functions of the same type and the same result, attempt to call nil on their respective lines. Any help is greatly appreciated!
Code Calling the function
Function being called (Pretty sure it's not here, and the correct file is being loaded)
So I coded an API for use with transmitting rednet signals. I have already verified that the API can be loaded and is transmitting signals successfully. However upon trying to use some of the other functions it says Attempt To Call Nil on line 6. I have tried it with calling the other functions of the same type and the same result, attempt to call nil on their respective lines. Any help is greatly appreciated!
Code Calling the function
function setWarplan()
rednet.open("top")
unused, warplan = rednet.receive()
os.loadAPI("warplan")
if warplan == "1" then
warplan.set1()
elseif warplan == "2" then
warplan.set2()
elseif warplan == "3" then
warplan.set3()
elseif warplan == "4" then
warplan.set4()
elseif warplan == "5" then
warplan.set5()
else
print("Invalid Warplan")
end
end
Function being called (Pretty sure it's not here, and the correct file is being loaded)
function set1()
rednet.open("top")
rednet.send(30, "griff")
rednet.send(31, "altMain")
rednet.send(33, "lightMain")
rednet.send(35, "spleefArena")
rednet.send(36, "moria")
rednet.send(37, "willMain")
rednet.send(38, "1.6House")
rednet.send(43, "generalShelter")
rednet.close()
print("Missile plans sent!")
end
Edited on 21 December 2013 - 05:42 PM