21 posts
Posted 21 August 2013 - 09:47 PM
Hi. Mining code was working until if stopped turning itself off after a inputted number of digs. And yes this is a very basic code but it is the best I got. Also if anyone has an suggestions for my code, please tell me.
http://pastebin.com/QScsh6S4
35 posts
Posted 21 August 2013 - 10:37 PM
If you need to shutdown a turtle you can use this:
if i == 0 then
--Code (to return to the top maybe?)
os.shutdown()
end
21 posts
Posted 21 August 2013 - 10:40 PM
It is not as much a shutdown code but a code that after a sequence of events shuts it down. Sorry for not making that clear.
32 posts
Location
UK
Posted 21 August 2013 - 10:46 PM
It is not as much a shutdown code but a code that after a sequence of events shuts it down. Sorry for not making that clear.
Would you not just put
os.shutdown()
where you want the computer to shut down….? After the 'sequence of events'
21 posts
Posted 21 August 2013 - 11:01 PM
The problem is not the shutdown itself but the sequence of events before it. Please check the code, I am still VERY new at this(which is why I really can't explain the problem) , so I have not been able to find the problem.
21 posts
Posted 22 August 2013 - 01:09 AM
Updated code:
Main Turtle:
http://pastebin.com/2FAzXh6qOther Turtles:
http://pastebin.com/WrUU807NNow the problem is the main one is unable to control the other ones and the main one still has the earlier problem. Any help someone could provide could be very helpful.
Thanks,
Noob
32 posts
Location
UK
Posted 22 August 2013 - 06:52 AM
Updated code:
Main Turtle:
http://pastebin.com/2FAzXh6qOther Turtles:
http://pastebin.com/WrUU807NNow the problem is the main one is unable to control the other ones and the main one still has the earlier problem. Any help someone could provide could be very helpful.
Thanks,
Noob
I think the problem you are talking about its with rednet.recieve()
you have
message = rednet.recieve()
should be
local senderId, message, distance = rednet.receive()
21 posts
Posted 22 August 2013 - 07:19 PM
Updated code:
Main Turtle:
http://pastebin.com/2FAzXh6qOther Turtles:
http://pastebin.com/WrUU807NNow the problem is the main one is unable to control the other ones and the main one still has the earlier problem. Any help someone could provide could be very helpful.
Thanks,
Noob
I think the problem you are talking about its with rednet.recieve()
you have
message = rednet.recieve()
should be
local senderId, message, distance = rednet.receive()
Tried that, did not work. But it still is not stopping via the "if h <= 1 then", it just keeps on moving even through h does = 1.