Posted 05 January 2015 - 02:50 PM
[CLOSED]
So, I am trying to make a custom turtle API, and I want to make it so that in startup you use one function to make it so that the turtle uses rednet. Is it possible to do it like I have done here? I don't really have a way to check at the moment. The way I envision it, each turtle has its own instance of the API when you load it… Is that how it really works?
Here is the code that I have so far
So, I am trying to make a custom turtle API, and I want to make it so that in startup you use one function to make it so that the turtle uses rednet. Is it possible to do it like I have done here? I don't really have a way to check at the moment. The way I envision it, each turtle has its own instance of the API when you load it… Is that how it really works?
Here is the code that I have so far
-- Variable Declaration
nAPI_RN = false -- set this to true if you don't want to use isRN()
-- Use this in your startup to enable or disable rednet
function isRN(isRN_) { -- Enter true or false
if isRN_ == "true"
nAPI_RN = true
return nAPI_RN
elseif isRN_ == "false"
nAPI_RN = false
return nAPI_RN
else
error("true or false expected. nAPI will default to not use RedNet.")
nAPI_RN = false
end
}
Edited on 06 January 2015 - 01:12 AM