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

Need help with mapping script!

Started by Weasels, 15 December 2013 - 03:48 AM
Weasels #1
Posted 15 December 2013 - 04:48 AM
Turtle mapping script (Need help)



Hey there, I found a script that really interests me. I downloaded it and tried it out but I really need some assistance with a few modifications for it. I'm know a bit of lua but I don't really understand this code. It's a remote controlled turtle that can move left, right, back, and forward. It can break and place blocks. Lastly, it can scan the area by doing a 360. It has one feature that I really like and so far I can't find any others that work as easily as this one. Anyway, the modification I need help with is to make the turtle go up and down. When it goes up or down, it clears the screen of the previous map drawn and lets me move. (If anyone knows how, I would love to have the turtle remember what it explored when I go up or down using files. I'm not really sure how to do this. I don't need this feature, just a bonus I guess.)

The second and last thing I need is: I'd like the turtle to move a bit smoother. I find the controls really strange to me since it has to spin around so much. EX: I'm facing NORTH, I turn east using 'D' and I have to push 'D' to go that way again. I would LOVE to have it so it does this:
I'm facing NORTH, I turn east using 'D' and I push 'W' to go forward. <– it that makes sense.

Thanks to you in advance, I really hope someone gives some assistance! Would be greatly appreciated.

Here's the code for the Computer (Controller) :

http://dl.dropboxusercontent.com/u/25121005/RC_Computer.txt

Here's the code for the Turtle :

http://dl.dropboxusercontent.com/u/25121005/RC_Drone.txt

P.S. There's a 40 block limit on how far this turtle this go using this script. Is there any way I can increase that?
Ajt86 #2
Posted 16 December 2013 - 12:10 AM
You could save the data using the bit API in a file using the fs API. If there's no block, 0; if there's a block, 1
theoriginalbit #3
Posted 16 December 2013 - 12:15 AM
The second and last thing I need is: I'd like the turtle to move a bit smoother. I find the controls really strange to me since it has to spin around so much.
It spins so that it can know its surroundings, Turtles are only capable of detecting blocks in front, above, and below them

P.S. There's a 40 block limit on how far this turtle this go using this script. Is there any way I can increase that?
That would have been imposed because of the wireless range in ComputerCraft. You could modify it, but I suggest being careful due to the fact that the Turtle could get out of range.

You could save the data using the bit API in a file using the fs API. If there's no block, 0; if there's a block, 1
No need to over complicate it with use of the bit api unless the files size becomes an issue. plus most people don't understand binary. It'd be easier to just use the string 0 or 1 as opposed to reading bytes and then performing bitmasks on them.
Edited on 15 December 2013 - 11:15 PM