Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Modem()
- if
- peripheral.getType("right") == "modem" then
- rednet.open("right")
- elseif
- peripheral.getType("left") == "modem" then
- rednet.open("left")
- elseif
- peripheral.getType("top") == "modem" then
- rednet.open("top")
- elseif
- peripheral.getType("bottom") == "modem" then
- rednet.open("bottom")
- elseif
- peripheral.getType("back") == "modem" then
- rednet.open("back")
- elseif
- peripheral.getType("front") == "modem" then
- rednet.open("front")
- end
- end
- function AboutFace()
- print("Turning")
- Modem()
- for i = 9, 24 do
- rednet.send(i, "AboutFace")
- end
- os.sleep(1)
- print("Next")
- shell.run("Quarry")
- end
- function Dig()
- print("Digging")
- Modem()
- for i = 9, 24 do
- rednet.send(i, "Dig")
- end
- os.sleep(45)
- print("Next")
- shell.run("Quarry")
- end
- function MoveNorth()
- print("MoveNorth")
- rs.setBundledOutput("back", 2048)
- sleep(1)
- rs.setBundledOutput("back", 0)
- print("Next")
- shell.run("Quarry")
- end
- function MoveSouth()
- print("MoveSouth")
- rs.setBundledOutput("back", 16)
- sleep(1)
- rs.setBundledOutput("back", 0)
- print("Next")
- shell.run("Quarry")
- end
- function MoveEast()
- print("MoveEast")
- rs.setBundledOutput("back", 1024)
- sleep(1)
- rs.setBundledOutput("back", 0)
- print("Next")
- shell.run("Quarry")
- end
- function MoveWest()
- print ("MoveWest")
- rs.setBundledOutput("back", 16384)
- sleep(1)
- rs.setBundledOutput("back", 0)
- print("Next")
- shell.run("Quarry")
- end
- function MoveUp()
- print ("MoveUp")
- rs.setBundledOutput("back", 32)
- sleep(1)
- rs.setBundledOutput("back", 0)
- print("Next")
- shell.run("Quarry")
- end
- function MoveDown()
- print ("MoveDown")
- rs.setBundledOutput("back", 512)
- sleep(1)
- rs.setBundledOutput("back", 0)
- print("Next")
- shell.run("Quarry")
- end
- while true do
- local event, param1 = os.pullEvent ("char")
- if param1 == "n" then
- MoveNorth()
- break
- elseif param1 == "e" then
- MoveEast()
- break
- elseif param1 == "s" then
- MoveSouth()
- break
- elseif param1 == "w" then
- MoveWest()
- break
- elseif param1 == "u" then
- MoveUp()
- break
- elseif param1 == "l" then
- MoveDown()
- break
- elseif param1 == "d" then
- Dig()
- break
- elseif param1 == "t" then
- AboutFace()
- break
- elseif param1 == "c" then
- shell.run("Commands")
- break
- else
- print ("Wrong button!")
- sleep (1)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement