View difference between Paste ID: eb6n52xH and CrR8PxzE
SHOW: | | - or go back to the newest paste.
1-
--Peripherals
1+
edit--Peripherals
2
reactor = peripheral.wrap("back")
3
monitor = peripheral.wrap("monitor_4")
4
glowstone = peripheral.wrap("thermalexpansion_light_0","thermalexpansion_light_1")
5
--Constant variables
6
totalEnergy = 1000000
7
totalFuelCapacity = reactor.getFuelAmountMax()
8
9-
function barGraphPreInit(total,maximum)
9+
10-
	local percentage = (total/maximum)*100
10+
11-
	print(percentage)	
11+
12-
	for i = 1,10 do 
12+
13-
		if percentage <= i*10 and percentage > (i-1)*10 then
13+
14
15-
			return i
15+
16-
		end
16+
17-
	end
17+
18-
end
18+
19
20
21
	currentFuel = reactor.getFuelAmount()
22-
function barGraphInit(text,locx,locy,val)
22+
23-
	monitor.setCursorPos(locx,locy)
23+
24-
	monitor.clearLine()
24+
25-
	monitor.setBackgroundColor(colors.black)
25+
26-
	monitor.write(text.. " :")
26+
27-
	monitor.setTextColour(colors.red)
27+
28-
	monitor.write(val)
28+
29-
    monitor.setTextColour(colors.white)
29+
30-
end
30+
31
 if de == 0 then
32-
function justWrite(locx,locy,val)
32+
33-
	monitor.setCursorPos(locx,locy)
33+
34-
	monitor.write(val)
34+
35-
end
35+
36-
function resetFont()
36+
37-
	monitor.setBackgroundColor(colors.black)
37+
38-
	monitor.setTextScale(1)
38+
39-
	monitor.setTextColour(colors.white)
39+
40-
end
40+
41
end