I created my first script here, and it gives me the error "Multiple Points"
Can you guys help me?
Here is the script I wrote:
local monitor = peripheral.wrap("monitor_0")
local mon2 = peripheral.wrap("monitor_1")
local reactor1 = peripheral.wrap("BigReactors-Reactor_0")
local reactor2 = peripheral.wrap("BigReactors-Reactor_1")
cm = peripheral.wrap("tileentitymonitorstoragefluid_1")
local rp1 = reactor1.getEnergyStored()
local rp2 = reactor2.getEnergyStored()
local rt1 = reactor1.getFuelTemperature()
local rt2 = reactor1.getFuelTemperature()
local rpt = textutils.serialize(rp1+rp2)
local rtt = textutils.serialize(rt1+rt2)
local backup = peripheral.wrap("up")
local mainpower = peripheral.wrap("back")
local totalbytes = cm.getTotalBytes()
local usedbytes = cm.getFreeBytes()
local unusedbytes = cm.getUnusedBytes()
local function getPower(i)
local p = peripheral.wrap("bottom")
return p.callRemote(i, "getEnergyStored", "none")
end
local function getPeripherals()
local t = {}
for k,v in pairs(peripheral.getNames()) do
if (string.find(v,"cofh_thermalexpansion_energycell")) then
t[v] = getPower(v)
end
end
return t
end
function mesystem()
monitor.clear()
monitor.setTextScale(0.5)
monitor.setCursorPos(1,1)
monitor.write("==============================")
monitor.setCursorPos(1,2)
monitor.write("Totale Opslag Terminal:")
monitor.setCursorPos(1,3)
if totalbytes >= 0 and totalbytes < 1000 then
monitor.write(textutils.unserialize(totalbytes.." Bytes"))
elseif totalbytes >= 1000 and totalbytes <= 999999 then
monitor.write(textutils.unserialize(totalbytes/1000.." KiloByte"))
elseif totalbytes >= 1000000 and totalbytes <= 999999999 then
monitor.write(textutils.unserialize(totalbytes(/1000000).."MegaBytes"))
end
monitor.setCursorPos(1,5)
monitor.write("Gebruikte ruimte in de Terminal:")
monitor.setCursorPos(1,6)
monitor.write(textutils.unserialize(usedbytes.." Bytes"))
monitor.setCursorPos(1,8)
monitor.write("Ongebruikte ruimte in de Terminal:")
monitor.setCursorPos(1,9)
monitor.write(textutils.unserialize(unusedbytes.." Bytes"))
monitor.setCursorPos(1,10)
monitor.write("==============================")
end
function reactor()
local t = getPeripherals()
local power = 0
local i = 0
mon2.clear()
mon2.setTextScale(0.5)
mon2.setCursorPos(1,1)
for k,v in pairs(t) do
power = power + v
i = i + 1
end
mon2.write("===============================")
mon2.setCursorPos(1,3)
mon2.write("Reactor 1 Power = "..reactor1.getEnergyStored())
mon2.setCursorPos(1,4)
mon2.write("Reactor 1 Temp = "..reactor1.getFuelTemperature())
mon2.setCursorPos(1,6)
mon2.write("Reactor 2 Power = "..reactor2.getEnergyStored())
mon2.setCursorPos(1,7)
mon2.write("Reactor 2 Temp = "..reactor2.getFuelTemperature())
mon2.setCursorPos(1,9)
mon2.write("===============================")
mon2.setCursorPos(1,12)
mon2.write("Gemiddelde Backup Power: "..(power/i))
if power/i >= 9000000 then
redstone.setOutput("back", true)
mon2.setCursorPos(1,11)
mon2.write("Backup Power Ingeschakeld!")
elseif power/i <= 1000000 then
redstone.setOutput("back", false)
mon2.setCursorPos(1,11)
mon2.write("Backup Power aan het opladen!")
end
end
function loop()
while true do
reactor()
sleep(0.5)
mesystem()
sleep(0.5)
end
end
loop()
I hope you can help me out with thisKind regards,
Renjestoo