Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function quitProgram()
- local e, msg=os.pullEvent("char")
- if msg=="q"
- then quit=true
- end
- end
- function man_ovr()
- local e=os.pullEvent()
- if e=="redstone" then
- ovr=true
- end
- end
- function readSlots()
- for i=0, sz-1, 1 do
- tbl[i+1]=p.getStackInSlot(i)
- term.setCursorPos(1,1)
- pct= math.floor((i+1) / 27 * 100)
- print(pct.. "% complete")
- end
- end
- function wait()
- sleep(0.05)
- end
- -------------------------------------------------
- mon=peripheral.wrap("top")
- i=0
- cell=peripheral.wrap("left")
- note=peripheral.wrap("right")
- -- infinite loop
- while true do
- parallel.waitForAny(quitProgram,wait,man_ovr)
- if quit ==true then
- print ("quitting program")
- break
- end
- if ovr==true then
- cell.setEnergySend(100)
- else
- cell.setEnergySend(0)
- end
- --60 cycles till it exits and provides power to clear any machines
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement