http://pastebin.com/r82nw00f
Edited by AdrenalineDM, 15 August 2014 - 06:50 PM.
Posted 15 August 2014 - 08:30 AM
Edited by AdrenalineDM, 15 August 2014 - 06:50 PM.
Posted 15 August 2014 - 01:00 PM
Edited by Maxskywalker, 15 August 2014 - 09:27 PM.
Posted 15 August 2014 - 06:51 PM
Posted 16 August 2014 - 02:34 AM
local detectBlockUp = turtle.detectUp() if detectBlockUp == true then turtle.digUp() end
if turtle.detectUp() then turtle.digUp() end
local times = tonumber( read() )
local times
repeat
term.clear()
term.setCursorPos(1, 1)
term.write("Times to run: ")
times = tonumber( read() )
until times
Posted 17 August 2014 - 07:19 AM
Edited by AdrenalineDM, 17 August 2014 - 08:52 AM.
Posted 17 August 2014 - 02:26 PM
while not turtle.detect() do turtle.forward() endThis code will move the turtle forward until it detects a block in front. And will NOT tell you anything while it moves.
Posted 17 August 2014 - 04:30 PM
while not turtle.forward() do turtle.dig() end
Edited by RickiHN, 17 August 2014 - 04:33 PM.
Posted 17 August 2014 - 05:24 PM
Posted 17 August 2014 - 08:50 PM
local i=0
repeat
if turtle.detect() then
turtle.dig()
end
--# put your other if turtle.detect()'s here
while not turtle.detect() then
i = i + 1
print("Turtle Moved: ".. i .. " Times.")
turtle.forward()
end
until i == times --# ends the loop when i is the same as what the user inputed.
Edited by Dragon53535, 17 August 2014 - 08:54 PM.
Posted 17 August 2014 - 09:13 PM
Posted 17 August 2014 - 09:21 PM
if i % 10 == 0 then
Edited by Dragon53535, 17 August 2014 - 09:32 PM.
Posted 17 August 2014 - 09:35 PM
Posted 18 August 2014 - 01:46 AM
Posted 18 August 2014 - 06:33 AM
ya my first program was a stripmining program. Since I also play with a lot of people who don't know computercraft I made it userfriendly. Here's some tips and stuff you can make it even better like I have mine. although mine still needs a little bit of tweaking but I'm a protectionist so not sure if I'll ever stop working on it lol.
Don't add everything all at once as I added one thing at a time till it worked perfectly. Next I'm attempting to make it so it can save it's spot incase it shuts down or server crashes.
1. on the user input make it so it changes it's input to a number. example x = tonumber( read() ) it can make stuff easier when you start having it do math.
2. Not only should you make it do single strips but multiple ones. I got mine so it asks the user how many strips it wants and how far apart they want them.
3. chest or ender chest support. I got mine to ask the user if they have an ender chest in slot 16 of it. This way once the inv is full it can dump all the items into it or sit and wait for the user to empty it.
4. A lot of people that I see that do turtle programs make it so the turtle has to refill. I got mine set up to do the math (see suggestion 1) to make sure the turtle has enough fuel in it to do it's job before it starts. The math I have needs tweaking as it's not perfect but does give the turtle a buffer in how much it says it needs and how much is actually used as it uses a little less than it says it will.
5. Torch support. The easiest way I found to do torch is when I put a counter in my move forward function. It will also ask the user if they want the turtle to place torches and how far apart the torches will be. When ever the counter reaches the user input then it will place a torch and reset the counter. Also when placeing torches you should do something like:
turtle.select(15) if turtle.placeDown() == false then if turtle.placeUp() == false then turtle.turnLeft() turtle.turnLeft() turtle.place() turtle.turnLeft() turtle.turnLeft() end end turtle.select(1)[/indent] this makes it so if it can't place it torch down then it tries placing it up. If it can't place it up then it tries placing it behind it. if that fails it will just turn back around and give up turn back around and continue mining.
while not turtle.forward() do turtle.dig() turtle.attack() sleep(0.6) -- sleep incase mob is still alive or gravel falls then it will dig the gravel that falls also.
Edited by subzero22, 18 August 2014 - 06:37 AM.
0 members, 1 guests, 0 anonymous users