Spoiler
Edited by ShadowDisruptor, 17 September 2014 - 09:05 PM.
Posted 17 September 2014 - 09:04 PM
Edited by ShadowDisruptor, 17 September 2014 - 09:05 PM.
Posted 17 September 2014 - 09:12 PM
local ok, err = pcall( term.setTextColor, colors.lime ) -- separate themSo you would have todo this
local ok, err = pcall( isReactor, foundPeripherals[i] )
Posted 17 September 2014 - 09:25 PM
TheOddByte, on 17 September 2014 - 09:12 PM, said:
local ok, err = pcall( term.setTextColor, colors.lime ) -- separate themSo you would have todo this
local ok, err = pcall( isReactor, foundPeripherals[i] )
Edited by ShadowDisruptor, 17 September 2014 - 09:28 PM.
Posted 17 September 2014 - 09:35 PM
ShadowDisruptor, on 17 September 2014 - 09:25 PM, said:
local foo = "bar"
if 1 == 1 then
local foo = "blah" -- This will be local to the statement, same goes for loops and functions
end
print( foo ) -- will output bar
If your variables isn't local they'll be accessible outside of your program, which would be very bad if you'd use variables to store credentials.
Posted 18 September 2014 - 01:18 AM
if tempReactor.getConnected then -- If there's an entry in "tempReactor" called "getConnected", then... return tempReactor.getConnected() -- ... run it and return the result... else return false end -- ... or if there isn't, just return false.
if peripheral.getType(input) == "BigReactors-Reactor" then return tempReactor.getConnected() else return false end
0 members, 1 guests, 0 anonymous users