Towtow10, on 30 January 2016 - 09:16 AM, said:
Towtow10, on 30 January 2016 - 09:16 AM, said:
Posted 23 April 2016 - 03:21 PM
Towtow10, on 30 January 2016 - 09:16 AM, said:
Towtow10, on 30 January 2016 - 09:16 AM, said:
Posted 29 April 2016 - 01:14 PM
Posted 29 April 2016 - 08:32 PM
Anonymous, on 29 April 2016 - 01:14 PM, said:
Edited by Tiin57, 29 April 2016 - 08:32 PM.
Posted 19 May 2016 - 01:17 PM
Posted 25 June 2016 - 06:49 PM
Posted 26 June 2016 - 11:44 AM
veso266, on 25 June 2016 - 06:49 PM, said:
Posted 26 June 2016 - 01:30 PM
Posted 27 June 2016 - 10:34 AM
The Website crashed! /:17 attempt to cal nil Please report this error to the website creator
local function padLeft(str, w) return string.rep(" ", w - #str) .. str end local function findPeripheral(_type) for _,name in pairs(peripheral.getNames()) do if peripheral.getType(name) == _type then return peripheral.wrap(name) end end end local mfsu = findPeripheral("mfsu") local batbox = findPeripheral("batbox") if not mfsu and not batbox then error("Cannot find mfsu attached to this computer", 0) end local w, h = term.getSize() local total = 0 if mfsu then total = mfsu.getEUCapacity() elseif batbox then total = batbox.getCapacity() end os.startTimer(1) while true do local stored = 0 if mfsu then stored = mfsu.getEUStored() elseif batbox then stored = batbox.getStored() end term.clear() term.setCursorPos(1, 2) term.setTextColour(colours.orange) term.write("Energy:") term.setTextColour(colours.white) term.write(padLeft(tostring(stored), w - 7)) term.setCursorPos(1, 4) term.setTextColour(colours.orange) term.write("Total:") term.setTextColour(colours.white) term.write(padLeft(tostring(total), w - 6)) local p = (w-2) * stored / total term.setBackgroundColour(colours.lightGrey) term.setCursorPos(2, 8) term.write(string.rep(" ", w-2)) term.setBackgroundColour(colours.grey) term.setCursorPos(2, 8) term.write(string.rep(" ", p)) term.setBackgroundColour(colours.black) os.pullEvent("timer") os.startTimer(1) end
Edited by veso266, 28 June 2016 - 09:33 AM.
Posted 30 June 2016 - 08:52 PM
Posted 01 July 2016 - 01:42 PM
Insighted, on 30 June 2016 - 08:52 PM, said:
0 members, 1 guests, 0 anonymous users