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

[tekkit classic/computercraft 1.33] Gate program mining turtle

Started by CopyYou, 19 August 2014 - 09:01 PM
CopyYou #1
Posted 19 August 2014 - 11:01 PM
Hello all.

First of all, I am still using computercraft 1.33, wich is included in the tekkit classic modpack(i never moved on xD precious, precious worlds). I apologize.
I am pretty new at Lua coding, and i can't figure this out, so i hope i'm at the right place for this.

I made a program that is supposed to mine away the iron bars of a gate when he receives a rednet message, however when i execute the function that is supposed to close the gate again, it goes right up until the point it mines the last stone. Instead of stacking the stone in the first slot where it's supposed to be, it sticks it in the third slot, wich makes it so when i execute it again it goes completely faulty in the placement of bars and stone.

Yes, I realize i could and probabely should have used loops. Yes, the rednet part is not written yet.

I am most thankful for any help you can provide, and apologize for poor English. Thank you.

code:
http://pastebin.com/NneKxazG

EDIT: of course, pictures…

http://imgur.com/Msi9e0A – pic of the gate
http://imgur.com/0H1psj9 – pic before anything happens
http://imgur.com/B41l17x – pic after code is executed by reboot
note how in the 3rd picture the stone from the second is moved from the first to the third slot?
Edited on 19 August 2014 - 09:25 PM
Lyqyd #2
Posted 20 August 2014 - 12:38 AM
Select slot one before digging that block.
CopyYou #3
Posted 20 August 2014 - 10:34 AM
That worked, indeed. I was not aware that the turtle puts the block in the selected slot instead of stacking. I might have noticed sooner if i had 3rd slot actually selected, instead of the filled 2nd one.
Thank you for the help!