Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("Welcome to RemoteTurtle v1.5")
- print("")
- repeat
- print("Does the program already exist on your device")
- q=read()
- if
- q==("yes")
- then
- sleep(0)
- else
- if
- q==("no")
- then
- fs.copy("disk/startup","startup")
- end
- end
- until q==("yes") or q==("no")
- repeat
- print("Do you want this device to transmit or receive?")
- p=read()
- if
- p==("receive")
- then
- os.setComputerLabel("Remote Turtle")
- shell.run("id")
- rednet.open("right")
- print("What Id Do You Want To Link To?")
- l=tonumber(read())
- repeat
- id,message=rednet.receive()
- i=id
- k=message
- if
- l==i and k==("w")
- then
- turtle.forward()
- else
- if
- l==i and k==("a")
- then
- turtle.turnLeft()
- turtle.forward()
- else
- if
- l==i and k==("s")
- then
- turtle.turnRight()
- turtle.turnRight()
- turtle.forward()
- else
- if
- l==i and k==("d")
- then
- turtle.turnRight()
- turtle.forward()
- else
- if
- l==i and k==("q")
- then
- turtle.up()
- else
- if
- l==i and k==("z")
- then
- turtle.down()
- else
- if
- l==i and k==("r")
- then
- shell.run("refuel")
- else
- if
- l==i and k==("x")
- then
- turtle.dig()
- else
- if
- l==i and k==("xup")
- then
- turtle.digUp()
- else
- if
- l==i and k==("xdown")
- then
- turtle.digDown()
- else
- if
- l==i and k==("turnleft")
- then
- turtle.turnLeft()
- else
- if
- l==i and k==("turnright")
- then
- turtle.turnRight()
- else
- if
- l==i and k==("clear")
- then
- os.setComputerLabel("")
- else
- if
- l==i and k==("f")
- then
- turtle.attack()
- else
- if
- l==i and k==("fup")
- then
- turtle.attackUp()
- else
- if
- l==i and k==("fdown")
- then
- turtle.attackDown()
- else
- print("Doesn't match")
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- until
- l==i and k==("stop") or l==i and k==("clear")
- else
- if
- p==("transmit")
- then
- os.setComputerLabel("Remote Controller")
- shell.run("id")
- print("")
- 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
- end
- print("")
- print("What id would you like to connect to?")
- i=tonumber(read())
- print("")
- print("Type /list for a list of commands")
- print("")
- repeat
- write("Command : ")
- x=read()
- if
- x==("/list")
- then
- print("r --> refuel")
- print("w/a/s/d --> movement")
- print("q/z --> up/down")
- print("x --> dig")
- print("xup --> dig up")
- print("xdown --> dig down")
- print("turnleft/turnright --> turn left/ turn right")
- print("f --> attack")
- print("fup/fdown --> attacks up/down")
- print("stop --> Stops using this program")
- print("clear --> Clear Memory after picking up")
- else
- rednet.send(i,x)
- end
- until
- x==("stop") or x==("clear")
- if
- x==("clear")
- then
- os.setComputerLabel("")
- end
- until
- p==("receive") or p==("transmit")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement