SHOW:
|
|
- or go back to the newest paste.
| 1 | function progress_bar(percentage) | |
| 2 | - | function Check() |
| 2 | + | |
| 3 | - | if peripheral.find("Induction Matrix") == nil then
|
| 3 | + | |
| 4 | - | else cube = peripheral.find("Induction Matrix")
|
| 4 | + | |
| 5 | - | name = "Induction Matrix" |
| 5 | + | |
| 6 | used = '' | |
| 7 | - | return name |
| 7 | + | |
| 8 | for i=0, math.floor(percentage / 2) do | |
| 9 | used = used .. "|" | |
| 10 | count = count + 1 | |
| 11 | end | |
| 12 | for i=0, total - math.floor(percentage / 2) do | |
| 13 | empty = empty .. "-" | |
| 14 | count = count + 1 | |
| 15 | end | |
| 16 | ||
| 17 | t_monitor.setTextColor(colors.white) | |
| 18 | t_monitor.write(start) | |
| 19 | ||
| 20 | t_monitor.setTextColor(colors.white) | |
| 21 | t_monitor.write(used) | |
| 22 | ||
| 23 | t_monitor.setTextColor(colors.gray) | |
| 24 | t_monitor.write(empty) | |
| 25 | ||
| 26 | t_monitor.setTextColor(colors.white) | |
| 27 | t_monitor.write(last) | |
| 28 | return raw | |
| 29 | end | |
| 30 | ||
| 31 | ||
| 32 | monitor = peripheral.wrap("right")
| |
| 33 | t_monitor = peripheral.wrap("top")
| |
| 34 | ||
| 35 | previous = 0 | |
| 36 | ||
| 37 | ||
| 38 | function matrix() | |
| 39 | ||
| 40 | monitor.clear() | |
| 41 | monitor.setCursorPos(1,1) | |
| 42 | monitor.setTextScale(0.9) | |
| 43 | monitor.write("Power Managment")
| |
| 44 | monitor.setCursorPos(1,2) | |
| 45 | monitor.write(string.format("[%s]", name))
| |
| 46 | ||
| 47 | - | function eng_cube() |
| 47 | + | |
| 48 | monitor.setCursorPos(1,3) | |
| 49 | monitor.write(string.format("Capacity : %s J", max))
| |
| 50 | - | monitor.setTextScale(0.8) |
| 50 | + | |
| 51 | - | monitor.write(string.format("Showing Data For [%s]", name))
|
| 51 | + | |
| 52 | monitor.setCursorPos(1,4) | |
| 53 | monitor.write(string.format("Receiving : %s J/T", e_in))
| |
| 54 | ||
| 55 | - | monitor.write(string.format("Capacity: %s J", max))
|
| 55 | + | |
| 56 | monitor.setCursorPos(1,5) | |
| 57 | monitor.write(string.format("Outputting : %s J/T", e_out))
| |
| 58 | - | e_in = current - previous |
| 58 | + | |
| 59 | - | previous = current |
| 59 | + | |
| 60 | monitor.setCursorPos(1,6) | |
| 61 | - | monitor.write(string.format("I/O(+/-): %s J/T", e_in))
|
| 61 | + | |
| 62 | ||
| 63 | cur_perc = (current / max) * 100 | |
| 64 | - | monitor.write(string.format("Stored : %s J", current))
|
| 64 | + | |
| 65 | ||
| 66 | t_monitor.clear() | |
| 67 | t_monitor.setCursorPos(1,1) | |
| 68 | t_monitor.setTextScale(0.9) | |
| 69 | t_monitor.write(string.format("Stored : %s Percent", cur_perc))
| |
| 70 | ||
| 71 | t_monitor.setCursorPos(1,3) | |
| 72 | val_max = progress_bar(cur_perc) | |
| 73 | ||
| 74 | cap = cube.getTransferCap() | |
| 75 | out_perc = (e_out / cap) * 100 | |
| 76 | out_perc = math.floor(out_perc+0.5) | |
| 77 | t_monitor.setCursorPos(1,5) | |
| 78 | t_monitor.write(string.format("Outputting : %s Percent", out_perc))
| |
| 79 | ||
| 80 | ||
| 81 | t_monitor.setCursorPos(1,6) | |
| 82 | val_out = progress_bar(out_perc) | |
| 83 | ||
| 84 | ||
| 85 | in_perc = (e_in / cap) * 100 | |
| 86 | in_perc = math.floor(in_perc+0.5) | |
| 87 | t_monitor.setCursorPos(1,8) | |
| 88 | t_monitor.write(string.format("Receiving : %s Percent", in_perc))
| |
| 89 | ||
| 90 | ||
| 91 | t_monitor.setCursorPos(1,9) | |
| 92 | val_in = progress_bar(in_perc) | |
| 93 | ||
| 94 | end | |
| 95 | ||
| 96 | --while true do | |
| 97 | -- matrix() | |
| 98 | -- sleep(0.1) | |
| 99 | --end | |
| 100 | ||
| 101 | local storage = peripheral.find("mekanism:induction_casing")
| |
| 102 | ||
| 103 | print(storage.tanks()) | |
| 104 | ||
| 105 | local name = peripheral.getNames() | |
| 106 | ||
| 107 | print(name[0]) | |
| 108 | ||
| 109 | --print(peripheral.getMethods(name[0])) |