Jump to content




[lua][rednet]turtle doesn`t respond to channel message


  • You cannot reply to this topic
4 replies to this topic

#1 Jappards

  • Validating
  • 116 posts
  • LocationHolland

Posted 05 July 2013 - 01: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

#2 Grim Reaper

  • Members
  • 503 posts
  • LocationSeattle, WA

Posted 05 July 2013 - 01: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.

#3 Jappards

  • Validating
  • 116 posts
  • LocationHolland

Posted 06 July 2013 - 03: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

#4 Grim Reaper

  • Members
  • 503 posts
  • LocationSeattle, WA

Posted 08 July 2013 - 08: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 verdult

  • Members
  • 5 posts

Posted 09 July 2013 - 02: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






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users