Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[ This program ti to represent how much MJ there is stored
- in individual Redstone Cells through BuildCraft gates
- (set to Full energy = Redstone Signal) and then output
- the number onto a monitor ]]
- -- Statements
- local mon = peripheral.wrap("right")
- os.loadAPI ("bundleAPI")
- mon.setTextScale(2)
- function update()
- mon.clear()
- -- Back Colored Wires
- -- White
- local bWhite = 0
- if bundleAPI.getInput("back", "white") == true then
- bWhite = 1
- else bWhite = 0
- end
- -- Orange
- local bOrange = 0
- if bundleAPI.getInput("back", "orange") == true then
- bOrange = 1
- else bOrange = 0
- end
- -- Blue
- local bBlue = 0
- if bundleAPI.getInput("back", "blue") == true then
- bBlue = 1
- else bBlue = 0
- end
- -- Light Blue
- local bLightBlue = 0
- if bundleAPI.getInput("back", "lightblue") == true then
- bLightBlue = 1
- else bLightBlue = 0
- end
- -- Yellow
- local bYellow = 0
- if bundleAPI.getInput("back", "yellow") == true then
- bYellow = 1
- else bYellow = 0
- end
- -- Lime
- local bLime = 0
- if bundleAPI.getInput("back", "lime") == true then
- bLime = 1
- else bLime = 0
- end
- -- Left Colored Wires
- -- White
- local lWhite = 0
- if bundleAPI.getInput("left", "white") == true then
- lWhite = 1
- else lWhite = 0
- end
- -- Orange
- local lOrange = 0
- if bundleAPI.getInput("left", "orange") == true then
- lOrange = 1
- else lOrange = 0
- end
- -- Blue
- local lBlue = 0
- if bundleAPI.getInput("left", "blue") == true then
- lBlue = 1
- else lBlue = 0
- end
- -- Light Blue
- local lLightBlue = 0
- if bundleAPI.getInput("left", "lightblue") == true then
- lLightBlue = 1
- else lLightBlue = 0
- end
- -- Yellow
- local lYellow = 0
- if bundleAPI.getInput("left", "yellow") == true then
- lYellow = 1
- else lYellow = 0
- end
- -- Lime
- local lLime = 0
- if bundleAPI.getInput("left", "lime") == true then
- lLime = 1
- else lLime = 0
- end
- bTotal = bWhite + bOrange + bBlue + bLightBlue + bYellow + bLime
- lTotal = lWhite + lOrange + lBlue + lLightBlue + lYellow + lLime
- MJTotal = bTotal + lTotal
- MJTotal = MJTotal*600000
- local MJTotalPrint = tostring(MJTotal)
- mon.setCursorPos(2,6)
- mon.setTextColor(colors.lime)
- mon.write("There is currently ")
- mon.setTextColor(colors.blue)
- mon.write(MJTotalPrint)
- mon.setTextColor(colors.lime)
- mon.write(" MJ Stored.")
- end
- while true do
- update()
- sleep(0.2)
- end
Advertisement
Add Comment
Please, Sign In to add comment