SHOW:
|
|
- or go back to the newest paste.
1 | -- INFO: For this to work, you need a Advanced Computer and a Advanced Nuclear Information Reader with liquid sensor location cards in it | |
2 | -- code by Dezindzer | |
3 | -- peripheral | |
4 | nir = peripheral.wrap("left") --Nuclear Information Reader | |
5 | local mon = peripheral.wrap("top") --Advanced Monitor | |
6 | term.redirect(mon) | |
7 | mon.setTextScale(1) | |
8 | mon.setCursorPos(20,1) | |
9 | mon.clear() | |
10 | --- LOOP START-- | |
11 | while true do --Always loop | |
12 | term.setTextColor( colors.purple) | |
13 | mon.setCursorPos(10,1) | |
14 | - | print("|Dezinliquidator 3000|") |
14 | + | print("|Casio fx-2200z|") |
15 | term.setTextColor( colors.white) | |
16 | - | mon.setCursorPos(6,3) |
16 | + | |
17 | mon.setCursorPos(20,3) | |
18 | print("Buckets") | |
19 | - | print("%") |
19 | + | |
20 | --Basic function | |
21 | ||
22 | local function isempty(s) | |
23 | return s == nil or s == '' | |
24 | end | |
25 | ||
26 | local x = 1 | |
27 | while x < 10 do | |
28 | mon.setCursorPos(6,4+x) | |
29 | id, state, title, data = nir.get(x) | |
30 | ||
31 | x= x+1 | |
32 | -- liquid search starts here | |
33 | if isempty(data) then | |
34 | term.setTextColor( colors.white) | |
35 | print("prazno") | |
36 | elseif data.liquidId > 0 then | |
37 | if data.liquidId == 9 then | |
38 | term.setTextColor( colors.blue) | |
39 | print("Water: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
40 | elseif data.liquidId == 11 then | |
41 | - | print("Water: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
41 | + | |
42 | print("Lava: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
43 | elseif data.liquidId == 255 then | |
44 | - | print("Lava: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
44 | + | |
45 | print("Oil: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
46 | elseif data.liquidId == 4064 then | |
47 | - | print("Oil: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
47 | + | |
48 | print("Fuel: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
49 | elseif data.liquidId == 7773 then | |
50 | - | print("Fuel: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
50 | + | |
51 | print("Creosite: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
52 | elseif data.liquidId == 7776 then | |
53 | - | print("Creosite: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
53 | + | |
54 | print("Steam: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
55 | elseif data.liquidId == 8799 then | |
56 | - | print("Steam: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
56 | + | |
57 | print("Liquid DNA: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
58 | -- MFR LIQUIDS start | |
59 | - | print("Liquid DNA: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
59 | + | |
60 | term.setTextColor( colors.white) | |
61 | print("Milk: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
62 | elseif data.liquidId == 12245 then | |
63 | - | print("Milk: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
63 | + | |
64 | print("Sludge: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
65 | elseif data.liquidId == 12246 then | |
66 | - | print("Sludge: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
66 | + | |
67 | print("Sewage: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
68 | elseif data.liquidId == 12247 then | |
69 | - | print("Sewage: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
69 | + | |
70 | print("Mob Essence: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
71 | elseif data.liquidId == 12265 then | |
72 | - | print("Mob Essence: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
72 | + | |
73 | print("BioFuel: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
74 | -- MFR LIQUIDS end | |
75 | - | print("BioFuel: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
75 | + | |
76 | elseif data.liquidId == 12390 then | |
77 | term.setTextColor( colors.white) | |
78 | print("Milk: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
79 | elseif data.liquidId == 13267 then | |
80 | - | print("Milk: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
80 | + | |
81 | print("Apple Juice: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
82 | elseif data.liquidId == 13273 then | |
83 | - | print("Apple Juice: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
83 | + | |
84 | print("Biofuel: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
85 | elseif data.liquidId == 13274 then | |
86 | - | print("Biofuel: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
86 | + | |
87 | print("Biomass: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
88 | -- bees? start | |
89 | - | print("Biomass: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
89 | + | |
90 | term.setTextColor( colors.orange) | |
91 | print("Honey: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
92 | elseif data.liquidId == 13391 then | |
93 | - | print("Honey: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
93 | + | |
94 | print("Seed Oil: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
95 | -- bees end | |
96 | - | print("Seed Oil: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
96 | + | |
97 | elseif data.liquidId == 30103 then | |
98 | term.setTextColor( colors.cyan) | |
99 | print("Coolant: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
100 | -- test data & metdata | |
101 | - | print("Coolant: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
101 | + | |
102 | elseif data.liquidId == 21269 then | |
103 | if data.liquidMeta == 4 then | |
104 | term.setTextColor( colors.gray) | |
105 | print("Wolframium: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
106 | elseif data.liquidMeta == 5 then | |
107 | - | print("Wolframium: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
107 | + | |
108 | print("Lithium: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
109 | elseif data.liquidMeta == 7 then | |
110 | - | print("Lithium: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
110 | + | |
111 | print("Silicon: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
112 | elseif data.liquidMeta == 10 then | |
113 | - | print("Silicon: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
113 | + | |
114 | print("Berylium: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
115 | elseif data.liquidMeta == 12 then | |
116 | - | print("Berylium: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
116 | + | |
117 | print("Sodium: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
118 | elseif data.liquidMeta == 16 then | |
119 | - | print("Sodium: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
119 | + | |
120 | print("Mercury: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
121 | end | |
122 | - | print("Mercury: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
122 | + | |
123 | ||
124 | elseif data.liquidId == 21270 then | |
125 | if data.liquidMeta == 0 then | |
126 | term.setTextColor( colors.blue) | |
127 | print("Hydrogen: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
128 | elseif data.liquidMeta == 1 then | |
129 | - | print("Hydrogen: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
129 | + | |
130 | print("Deuterium: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
131 | elseif data.liquidMeta == 2 then | |
132 | - | print("Deuterium: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
132 | + | |
133 | print("Tritium: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
134 | elseif data.liquidMeta == 3 then | |
135 | - | print("Tritium: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
135 | + | |
136 | print("Helium: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
137 | elseif data.liquidMeta == 6 then | |
138 | - | print("Helium: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
138 | + | |
139 | print("Helium-3: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
140 | end | |
141 | - | print("Helium-3: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
141 | + | |
142 | elseif data.liquidId == 21271 then | |
143 | if data.liquidMeta == 3 then | |
144 | term.setTextColor( colors.yellow) | |
145 | print("Plasma: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
146 | elseif data.liquidMeta == 1 then | |
147 | - | print("Helium Plasma: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
147 | + | |
148 | print("Deuterium: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
149 | elseif data.liquidMeta == 2 then | |
150 | - | print("Deuterium: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
150 | + | |
151 | print("Tritium: "..(data.amount/1000).." / "..(data.capacity/1000)) | |
152 | end | |
153 | - | print("Tritium: "..(data.amount/1000).." / "..((100-(data.amount/data.capacity)/200))) |
153 | + | |
154 | term.setTextColor(colors.white) | |
155 | print("Tank empty") | |
156 | else | |
157 | print("No card info in slot "..x) | |
158 | end -- kraj pretrage | |
159 | ||
160 | ||
161 | end -- break/isempty | |
162 | ||
163 | ||
164 | ||
165 | end -- while x | |
166 | os.sleep(2) | |
167 | mon.clear() | |
168 | end -- master loop |