8 posts
Posted 03 April 2014 - 11:24 PM
http://pastebin.com/B1n2DrfNThats my code, its my first program ever, i basically edited someones 3x3 tunnel program because i knew absolutly nothing about lua programming so i was reading a tutorial as i was editing the code, but it doesnt work… could someone plz help me fix the code (dont tell me what to do, just tell me whats wrong so that i can fix it on my own and learn from it) thank you :)/>
8543 posts
Posted 04 April 2014 - 02:35 AM
Moved to Ask a Pro.
172 posts
Location
United States
Posted 04 April 2014 - 02:50 AM
http://pastebin.com/B1n2DrfNThats my code, its my first program ever, i basically edited someones 3x3 tunnel program because i knew absolutly nothing about lua programming so i was reading a tutorial as i was editing the code, but it doesnt work… could someone plz help me fix the code (dont tell me what to do, just tell me whats wrong so that i can fix it on my own and learn from it) thank you :)/>
I believe that here:
for j=1,length,1 do
digForward()
for i=1,3,1 do
is your problem. But i would have to try editing it first and testing it on my own, but with my knowledge that area may be your problem
392 posts
Posted 04 April 2014 - 03:14 AM
Well. It shouldn't be running because of line 44:
if digForward() then x = x + 1
You need an "end" after an if block.
For more info, go here:
http://www.computercraft.info/wiki/Conditional_statements
8 posts
Posted 04 April 2014 - 03:35 AM
Well. It shouldn't be running because of line 44:
if digForward() then x = x + 1
You need an "end" after an if block.
For more info, go here:
http://www.computerc...onal_statements
oh my god i didnt even see that… lol thanks man!
http://pastebin.com/B1n2DrfNThats my code, its my first program ever, i basically edited someones 3x3 tunnel program because i knew absolutly nothing about lua programming so i was reading a tutorial as i was editing the code, but it doesnt work… could someone plz help me fix the code (dont tell me what to do, just tell me whats wrong so that i can fix it on my own and learn from it) thank you :)/>
I believe that here:
for j=1,length,1 do
digForward()
for i=1,3,1 do
is your problem. But i would have to try editing it first and testing it on my own, but with my knowledge that area may be your problem
thank you for your help, ill try altering it a bit myself too and testing it, but as i said in my post im really new to programming in lua so i dont know much…
i have anothe question for anybody that feels like answering, how would i make it so that if the torch count/chest count are 0 it stops the program?
172 posts
Location
United States
Posted 04 April 2014 - 01:20 PM
do
if turtle.getItemCount(<slot number here>) == 0 then
return
end
If i remember correctly…
EDIT: my bad… used wrong peripheral syntax…. fixed now
Edited on 04 April 2014 - 11:22 AM