SHOW:
|
|
- or go back to the newest paste.
| 1 | print("Wii Turtle Miner v4.0")
| |
| 2 | sure = false | |
| 3 | repeat | |
| 4 | d = false | |
| 5 | write("Turtle Name> ")
| |
| 6 | name = read() | |
| 7 | write("Turtle Owner> ")
| |
| 8 | owner = read() | |
| 9 | print("Turtle name: "..name.."!\nTurtle owner: "..owner.."!")
| |
| 10 | repeat | |
| 11 | print("Is this the right info? (Y/N)")
| |
| 12 | write("Choice> ")
| |
| 13 | c = read() | |
| 14 | if (string.lower(c) == "n") then | |
| 15 | d = true | |
| 16 | elseif (string.lower(c) == "y") then | |
| 17 | d = true | |
| 18 | sure = true | |
| 19 | end | |
| 20 | until d == true | |
| 21 | until sure == true | |
| 22 | rednet.open("right")
| |
| 23 | rednet.broadcast(name..":"..owner..":starting") | |
| 24 | rednet.close("right")
| |
| 25 | turtle.select(1) | |
| 26 | n = 0 | |
| 27 | built = false | |
| 28 | done = false | |
| 29 | for i = 1,4 do | |
| 30 | turtle.turnRight() | |
| 31 | if (turtle.detect() == true and i < 4) then | |
| 32 | turtle.dig() | |
| 33 | end | |
| 34 | turtle.place() | |
| 35 | end | |
| 36 | if (turtle.detectUp()) then | |
| 37 | turtle.digUp() | |
| 38 | end | |
| 39 | turtle.placeUp() | |
| 40 | while done == false do | |
| 41 | turtle.digDown() | |
| 42 | if (n == 0) then | |
| 43 | turtle.down() | |
| 44 | turtle.digDown() | |
| 45 | n = n + 1 | |
| 46 | end | |
| 47 | for i = 1,5 do | |
| 48 | turtle.turnRight() | |
| 49 | turtle.select(3) | |
| 50 | if (i < 5 and turtle.compare() == false) then | |
| 51 | turtle.dig() | |
| 52 | end | |
| 53 | turtle.select(1) | |
| 54 | end | |
| 55 | if (turtle.detectDown()) then | |
| 56 | rednet.open("right")
| |
| 57 | rednet.broadcast(name..":"..owner..":done") | |
| 58 | rednet.close("right")
| |
| 59 | for i = 1,n do | |
| 60 | turtle.up() | |
| 61 | end | |
| 62 | turtle.digUp() | |
| 63 | turtle.select(2) | |
| 64 | turtle.placeUp() | |
| 65 | turtle.dig() | |
| 66 | turtle.forward() | |
| 67 | turtle.forward() | |
| 68 | turtle.turnRight() | |
| 69 | turtle.turnRight() | |
| 70 | turtle.select(1) | |
| 71 | turtle.place() | |
| 72 | done = true | |
| 73 | else | |
| 74 | n = n + 1 | |
| 75 | turtle.down() | |
| 76 | end | |
| 77 | end |