Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rednet.close("left")
- rednet.open("left")
- local inputSide = "back"
- local blue = 2048
- function SwitchColor(switch)
- if switch then
- term.setTextColor(colors.white)
- else
- term.setTextColor(colors.red)
- end
- end
- function Move()
- SwitchColor(true)
- print("-- BUILDING --")
- rednet.send(40, "BUILD", "UPDATE")
- sleep(.1)
- shell.run("move")
- end
- function Redst()
- SwitchColor(false)
- print("-- KILLING --")
- rednet.send(40, "REDST", "UPDATE")
- sleep(.1)
- shell.run("redstone")
- end
- function Test()
- SwitchColor(true)
- print("-- DEPOSITING --")
- shell.run("test")
- end
- function Execute()
- Move()
- sleep(.1)
- Redst()
- sleep(2)
- Test()
- sleep(.1)
- end
- while true do
- os.pullEvent("redstone")
- local signal = rs.getBundledInput(inputSide)
- if signal == blue then
- SwitchColor(false)
- print("-- INITIATING --")
- Execute()
- rednet.send(40, "END", "UPDATE")
- end
- SwitchColor(false)
- print("-- LOOPING --")
- SwitchColor(true)
- print("-------------")
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement