View difference between Paste ID: 1xTMADeX and ASa2uiTC
SHOW: | | - or go back to the newest paste.
1-
rednet.open("back")
1+
redstoneSide = "top"
2-
term.clear()
2+
peripheralName = "peripheral_0"
3-
term.setCursorPos(1, 1)
3+
searedTanks = 3
4-
version = 1.2
4+
tank = peripheral.wrap(peripheralName)
5
loopCounter = 0
6-
 function startupClear()
6+
7-
    f = fs.open("startup", "w")
7+
	function startupClear()
8-
    f.write("shell.run('pastebin run ASa2uiTC')")
8+
		f = fs.open("startup", "w")
9-
    f.close()
9+
		f.write("shell.run('smeltery')")
10-
                end
10+
		f.close()
11
	end
12-
local function readCommand()
12+
13-
        local command = read()
13+
	local function readCommand()
14-
        return command
14+
        	local command = read()
15
        	return command
16
	end
17-
function autoMode()
17+
18-
sender, message = rednet.receive()
18+
	function looper(counter)
19-
	
19+
		counter = math.floor(counter/9)
20-
	if message == "running" then
20+
		counter = math.floor(counter/searedTanks)
21-
		term.setTextColor(colors.red)
21+
		print("Starting to loop "..counter.." times")
22-
		print("UberMiner : AutoMode, is already running somewhere else")
22+
		for int=1,counter,1 do
23
			inter = int + 1
24-
	else if message == true then
24+
			rs.setOutput(redstoneSide, true)
25-
		term.setTextColor(colors.lime)
25+
			sleep(1)
26-
		print("UberMiner : AutoMode, now online!")
26+
			rs.setOutput(redstoneSide, false)
27
			amount = 0
28-
	else
28+
			while amount < 1296 do 
29-
		term.setTextColor(colors.red)
29+
			tableInfo = tank.getInfo()
30-
		print("UberMiner : AutoMode, now offline.")
30+
			contents = tableInfo.contents
31
			currentAmount = contents.amount
32
			amount = currentAmount
33-
sleep(2)
33+
			sleep(0.1)
34
			end
35
			print("[UPDATE] "..int.."/"..counter.." outputed.")
36-
local function processCommand(command)
36+
			sleep(4)
37-
	if command:lower() == "/help" then
37+
38-
		term.clear()
38+
		toggle()
39-
		term.setCursorPos(1, 1)
39+
	end
40-
		term.setTextColor(colors.red)
40+
41-
		print("List o' Commands:")
41+
42-
		term.setTextColor(colors.cyan)
42+
function toggle()
43-
		print("/wither | /w -- Spawns and Kills a Wither!")
43+
44-
		print("/autoMode | /am -- Puts UberMiner on/off AutoMode")
44+
        term.setCursorPos(1, 1)
45-
		print("/forward | /f -- UberMiner Forward!")
45+
        term.setTextColor(colors.cyan)
46-
		print("/reboot | /r -- Reboot the computer to refresh the program")
46+
	print("How many ingots do you want to excrete?")
47-
		print("/help -- List o' Commands (Obviously)")
47+
48-
		term.setTextColor(colors.red)
48+
        local command = readCommand()
49-
		print("Press any key to return to prompt")
49+
	looper(command)
50-
		os.pullEvent("key")
50+
51
52-
	else if command:lower() == "/reboot" or command:lower() == "/r" then
52+
53-
		term.setTextColor(colors.blue)
53+
54-
		print("Rebooting...")
54+
55-
		sleep(0.2)
55+
56-
		os.reboot()
56+
toggle()