Posted 17 September 2014 - 09:07 PM
Now, before you judge me for not being able to figure out an end error, I already checked my ends. I did by hand as well as with notepad++. From what I can see, all my ends are there. The exact error: 8: 'end' expected (to close 'function' at line 2)
Before you open spoiler: the code is 46 lines, couldn't shorten it due to me not knowing where the error is. Also, using the tekkit modpack, which really dosen't matter because the issue isn't with the mods codes.
Before you open spoiler: the code is 46 lines, couldn't shorten it due to me not knowing where the error is. Also, using the tekkit modpack, which really dosen't matter because the issue isn't with the mods codes.
Spoiler
--Start of setup
local function isReactor(input)
local checkReactor = peripheral.wrap(input)
checkReactor = checkReactor.getActive()
return checkReactor
checkReactor = nil
end
local function whatIs(input)
local reactor = peripheral.wrap(input)
local whatIsIt = reactor.isActivelyCooled()
if whatIsIt then
table.insert(activeReactors, input)
else
table.insert(passiveReactors, input)
end
whatIsIt = nil
reactor = nil
end
local bigReactors = {}
local passiveReactors = {}
local activeReactors = {}
local turbines = {}
--End of setup
--Sorting peripherals
foundPeripherals = peripheral.getNames()
for i=1,#foundPeripherals do
local ok, err = pcall(isReactor(foundPeripherals[i]))
if ok then
table.insert(bigReactors, foundPeripherals[i])
else
print(foundPeripherals[i].." Is not a reactor!")
end
end
foundPeripherals = nil
ok = true
for i=1,#bigReactors do
local ok, err = pcall(whatIs(bigReactors[i]))
if not ok then
table.insert(turbines, bigReactors[i])
end
end
print("Turbines found: "..#turbines)
print("Active reactors found: "..#activeReactors)
print("Passive reactors found: "..#passiveReactors)
Edited on 17 September 2014 - 07:08 PM