Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t = term
- local arg = {...}
- ends = true
- rednet.open("back")
- term.clear()
- term.setCursorPos(1, 1)
- local function perc(cur,max)
- return cur/max*100
- end
- print("0% done mining")
- while ends == true do
- if not (arg[1] == nil) or type(arg[1]) == "string" then
- rednet.broadcast(arg[1])
- a, b, c = rednet.receive()
- if b == "FINISHED" then
- term.clear()
- term.setCursorPos(1, 1)
- ends = false
- print(b)
- else
- term.clear()
- term.setCursorPos(1,1)
- print(perc(b,arg[1]) .."% done mining")
- end
- else
- error("please use a number!")
- end
- end
Add Comment
Please, Sign In to add comment