This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Blazara's profile picture

Manual Control Turtle

Started by Blazara, 17 August 2013 - 01:34 PM
Blazara #1
Posted 17 August 2013 - 03:34 PM
This is a project that started with me needing to mine some obsidian a little more quickly, when I had a mining turtle but no diamond pickaxe. I wasn't much up for using the lua command prompt constantly, so I made this:

http://pastebin.com/hnmt5A2Y

The program automatically downloads an API I've made in order to condense some of the movement code. I've provided a link to said API in the comment within the pastebin. Unfortunately; this program requires you to be pretty close to the turtle, as you have to use the turtle's console. I'm trying to port this to a wireless-computer modem deal, but struggling so far.

Here's a full list of commands:
Lower-case WASD moves forward and turns in the expected directions.
Capitalised keys "A" and "D" turn the turtle and move it one block in that direction.
Capitalised "S" Turns the turtle a half turn and moves one block in that direction.
"e" moves the turtle down one block. "q" moves the turtle up one block.
"z" digs the block above the turtle. "c" digs below. "x" digs in front.
"p" will place the block in the selected slot in front of the turtle.
"f" displays the current fuel level. "F" refuels the turtle from the currently selected slot of the turtle.
The numbers 1 through to 0 select slots 1-10. To select 11 through 16, simply press it's single digit counterpart and shift; eg. '!' = 11 '$' = 14 etc.
"r" toggles a redstone signal.

Thanks for reading! Feedback, feature ideas, help with the computer porting, all welcome!
Visckmart #2
Posted 26 August 2013 - 11:49 AM
Amazing, Awesome, Simple, Genius, Brilliant! :D/>

Really, CONGRATULATIONS! :)/>
Sora Firestorm #3
Posted 26 August 2013 - 12:15 PM
I found a little bit of code which could use a little fix-up :

        redstone.getOutput("front")
                if redstone.getOutput("front", true) then
                        redstone.setOutput("front", false)
                        print("Redstone signal off.")
                else
(Lines 51-5 for reference)

The first 'redstone.getOutput' doesn't need to be there, just delete it.
Second, the true in the secound redstone.getOutput doesn't need to be there.
There's nothing wrong with it being there, perse, but it's not doing anything.

Otherwise, the rest of it looks pretty good!
I remember hacking one of these together myself not too long ago, it certainly is very helpful. :)/>
Blazara #4
Posted 27 August 2013 - 08:06 PM
Amazing, Awesome, Simple, Genius, Brilliant! :D/>

Really, CONGRATULATIONS! :)/>
Thanks so much man! Means a lot, was one of my first programs, pretty proud of it! Thanks again :)/>

I found a little bit of code which could use a little fix-up :

		redstone.getOutput("front")
				if redstone.getOutput("front", true) then
						redstone.setOutput("front", false)
						print("Redstone signal off.")
				else
(Lines 51-5 for reference)

The first 'redstone.getOutput' doesn't need to be there, just delete it.
Second, the true in the secound redstone.getOutput doesn't need to be there.
There's nothing wrong with it being there, perse, but it's not doing anything.

Otherwise, the rest of it looks pretty good!
I remember hacking one of these together myself not too long ago, it certainly is very helpful. :)/>

Ah, great! It was mostly there just so I could make it clearer to myself what was really happening when I read the code at a later date. Thanks for the reparations!