SHOW:
|
|
- or go back to the newest paste.
1 | - | --[[ |
1 | + | |
2 | - | Simple status display for Railcraft boiler with a Liquid fuelbox. |
2 | + | |
3 | - | by got_m1lk |
3 | + | |
4 | - | --]] |
4 | + | |
5 | local mon = peripheral.wrap("top") | |
6 | - | --Specify side of wired modem |
6 | + | |
7 | - | -- Valid: "left", "right", "front", "back", "top", "bottom" |
7 | + | |
8 | - | local modemside = "left" |
8 | + | |
9 | --Adjust the textscale if you have a bigger/smaller monitor | |
10 | - | --Specify side of monitor |
10 | + | |
11 | - | --If the monitor is attached to the modem specify peripheral name instead. |
11 | + | |
12 | - | local monitor = "top" |
12 | + | |
13 | mon.setCursorPos(1,1) | |
14 | - | --Specify the ID of the attached Railcraft liquid fueled firebox |
14 | + | |
15 | - | local boiler = "liquid_fueled_boiler_firebox_0" |
15 | + | |
16 | while true do | |
17 | ||
18 | tank = b.getTanks("top") | |
19 | - | local net = peripheral.wrap(modemside) |
19 | + | |
20 | - | local mon = peripheral.wrap(monitor) |
20 | + | |
21 | ||
22 | ||
23 | local i = 3 | |
24 | ||
25 | for k,v in pairs(tank)do | |
26 | ||
27 | mon.setCursorPos(1,i) | |
28 | mon.clearLine() | |
29 | mon.setTextColor(512) | |
30 | ||
31 | if v["name"] ~=nil then | |
32 | mon.write(v["name"] .. ": ") | |
33 | end | |
34 | ||
35 | mon.setTextColor(colors.orange) | |
36 | if v["amount"] ~=nil and v["capacity"] ~=nil then | |
37 | mon.setCursorPos(9,i) | |
38 | tmp = (v["amount"] / v["capacity"]) *100 | |
39 | tmp = string.match(tostring(tmp),"[^%.]+") | |
40 | mon.write(tmp .. "%") | |
41 | end | |
42 | i = i +1 | |
43 | end | |
44 | ||
45 | ||
46 | mon.setCursorPos(1,i) | |
47 | mon.clearLine() | |
48 | mon.setTextColor(512) | |
49 | temp = string.match(tostring(b.getTemperature()),"[^%.]+") | |
50 | mon.write("Temp: ") | |
51 | mon.setTextColor(colors.orange) | |
52 | mon.write( temp .."'C") | |
53 | os.sleep(1) | |
54 | end |