Posted 02 April 2013 - 02:35 PM
I made a wireless turtle cooblestone generator, but it is not working, when I run, he does not print or do anything.
The program:
[COMPUTER]
Program name: stoneGenerator
[TURTLE]
Program name: Wireless
The program that break the cooblestone:
Program Name: generaator
The program:
[COMPUTER]
Program name: stoneGenerator
local turtleId = 6
local id, message = rednet.receive()
local command = shell.run(generator, input)
local side = bottom
rednet.open(lado)
print("Modem connected.")
sleep(0.5)
print("Trying to connect to the turtle...")
rednet.send(turtleId, try)
if id == turtleId and message == ok then
print("Turtle connected.")
end
print("How many cooblestones want?")
input = read("")
print("Sending request of cooblestones......")
rednet.send(turtleId, sending)
rednet.send(turtleId, command)
if id == turtleId and message == generating then
print("Request accepted. Generating cooblestones.")
end
print("Ending Program......")
rednet.close(side)
[TURTLE]
Program name: Wireless
local computerId = 9
local id, message = rednet.receive()
rednet.open(right)
if id == computerId and message == try then
rednet.send(computerId, ok)
end
if id == computerId and message == sending then
rednet.receive(5)
end
rednet.close(right)
shell.run(wireless)
The program that break the cooblestone:
Program Name: generaator
local arg = { ... }
local i = 1
local quantity = arg + 1
repeat -- O loop
turtle.dig()
sleep(0.25)
turtle.turnRight()
sleep(0.25)
until i == quantity