Posted 15 April 2013 - 02:27 PM
So, basically, I'm having a sorting system where a turtle is facing 3 barrels, so it can turn left or right to access any of them. It then turns around and puts them into a pipe. Simple enough.
I'm (trying to) control this with a computer + modem, which just is
I don't need it to send to the specific computers, because these will be the only wireless ones in the area.
The turtles code is this:
That's where the problem lies. I've seen it turn, but it will not suck any items, and it gives no errors. The program just stops. Any idea why that is?
I'll post a picture of what it looks like if you ask for it. Its pretty cheap to do if it works out :D/>
Oh, and the only reason I have cbl for cobble set up is that its just a prototype. I'd get more things set up if it works.
I'm (trying to) control this with a computer + modem, which just is
rednet.open("top")
tArgs = {...}
rednet.broadcast(tArgs[1])
rednet.broadcast(tArgs[2])
I don't need it to send to the specific computers, because these will be the only wireless ones in the area.
The turtles code is this:
rednet.open("right")
turtle.select(1)
local senderId, msg = rednet.receive()
local senderId, amount = rednet.receive()
if msg == "cbl" then
turtle.turnLeft()
turtle.suck()
if turtle.getItemCount(1) > tonumber(amount) then
newamount = turtle.getItemCount(1) - amount
turtle.drop(newamount)
elseif turtle.getItemCount(1) < tonumber(amount) then
turtle.select(2)
turtle.suck()
if turtle.getItemCount(2) + turtle.getItemCount(1) > tonumber(amount) then
newamount = turtle.getItemCount(2) + turtle.getItemCount(1) - tonumber(amount)
turtle.drop(newamount)
end
end
end
That's where the problem lies. I've seen it turn, but it will not suck any items, and it gives no errors. The program just stops. Any idea why that is?
I'll post a picture of what it looks like if you ask for it. Its pretty cheap to do if it works out :D/>
Oh, and the only reason I have cbl for cobble set up is that its just a prototype. I'd get more things set up if it works.