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