Jump to content




[lua][question]


2 replies to this topic

#1 jordan30001

  • New Members
  • 2 posts

Posted 15 April 2012 - 08:59 AM

HI I'm having trouble with the following code http://pastebin.com/qHixyL8t .
What I'm trying to do is send a rednet message from another computer for example it could be any of these combinations seperated by comas

rednet.send(id, "right,back,left|red power color code") *color codes ranging from 1 trough 15 (white to red)

the first data sent before the "|" is to tell the computer which side to send the data after the "|".

once it has figured out which side it needs to send the signal it inputs the color code into the next free available space in the array.

it then loops trough and adds all the array up and outputs a bundled output signal now this works great...if you send it in order 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 fine great work, but if you send for instance this 4,7,11,15,1 then all will show up except one and the same with this sequence of numbers 15,14,13,12,11,10,9,8,7,6,5,4,3,2,1 everything except the 1 will turn on.

would be great if someone could fix this and make it so that it will work no matter which combinations of colors are sent

#2 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 15 April 2012 - 03:52 PM

It might be easier if you use colors.combine on all the colours at the sending side - and send that number. That way the computer on the other end can just do rs.setBundledOutput("side", number). Saves messing around with arrays.

#3 jordan30001

  • New Members
  • 2 posts

Posted 16 April 2012 - 02:37 PM

the sending side is a server and it doesn't store any information it just forwards it to the right slave depending on the information it receives and I would sill have to do it the same way as i have done it currently jut on the server





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users