128 posts
Location
Holland
Posted 05 July 2013 - 02:08 PM
i`m developing a program that deploys something (including) when a rednet message is applied, but my turtles aren`t responding to my channel message (message: "deploy").
code:
http://pastebin.com/FfLFK3b8
504 posts
Location
Seattle, WA
Posted 05 July 2013 - 02:34 PM
Would you mind positing the code which is sending the message to the turtles? Also, you might want to just use the rednet API instead of trying to wrap modems and use them at a lower level like that unless it is really necessary.
128 posts
Location
Holland
Posted 06 July 2013 - 04:26 AM
yes, it is needed to use the modem API for what i`m trying to do, because i want it so that a computer is able to send all deployers a message on that channel, because it would take lots of sending and isn`t possible otherwise, if you want to have 20 deployers at the same time deploying.
message sender (normal computer with a wireless modem on the left):
http://pastebin.com/CBHVykxv
504 posts
Location
Seattle, WA
Posted 08 July 2013 - 09:56 PM
Well, the rednet API still uses the modem API and just uses the ID you give it as the broadcast channel, not the ID of the receiving computer (this was the case before modems were added).
Your code looks solid, so the only suggestion that I can give is to make sure that your computers are in range of your turtles to receive the message.
5 posts
Posted 09 July 2013 - 03:47 AM
function mainprog()
for i=1,16 do
local it=turtle.getItemCount(i)
if it == 0 then
turtle.select(i)
turtle.place()
else
turtle.place()
end
end
turtle.select(1)
end
This function selects empty slots and empty's the empty slot?
if you want to drop the filled slots you can either do use " if not it == 0 then"
or you can leave the whole if statement out (it doesn't matter if you drop empty slots) so it would be like:
function mainprog()
for i=1, 16, 1 do
turtle.select(i)
turtle.place()
end
turtle.select(1)
end