Jump to content


Using Redstone Bundled Output


7 replies to this topic

#1 Meni

    Script Kiddie

  • Members
  • Pip
  • 53 posts

Posted 08 January 2013 - 08:47 PM

Hi guys this is my first tutorial and i will try to explain the redstone.setBundledOutput() function.

First let look at the order of the cables

Posted Image

Understanding...
This are the cables numbers, but how do i gonna turn on/off this cables?
Simple using:
redstone.setBundledOutput(side,num)
Ok! The side is a string that is where the bundled cable is. They are "left" ,"right" ,"top" ,"bottom" ,"back" ,"front" .
But how i gonna turn on/off this cabes?
Using their numbers!
If i use num as 2 power the number of the cable. W

Why?
If you use num as 1 it will turn on the white cable, if you use 2 you will turn the orange cable, but if you use num as 3 you will turn on the white and orange cables.

OMG I want to turn on just one cable!
Easy just get the cable number and use as exponent of 2

WTF??
To turn the cable witch have the number 5 just use:
redstone.setBundleOutput(side,2^5)

But now i want the bundle cable 5 and the 11!
Simple! Just add 2^11
redstone.setBundleOutput(side,2^5+2^11)
And the result is
Posted Image

Now i want all cables off!
Simple just use num as 0
redstone.setBundledOutput(side,0)

OMG that is too hard!
Ok just use colors.thecolor as the num!
redstone.setBundledOutput(side,colors.white)
--Is the same think as
redstone.setBundledOutput(side,2)


Thank you guys, i hope have helped you! Any questions just reply!
Meni.



#2 theoriginalbit

    Semi-Professional ComputerCrafter

  • Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 4,293 posts
  • LocationAustralia

Posted 08 January 2013 - 08:57 PM

Good job, I know a lot of people can be confused by this. However i have a suggestion to make it easier that them having to worry about binary ( 2 ^ n ). Just use the colours API so it would be
rs.setBundledOutput( side, colors.yellow + colors.red )
etc, etc, etc :)

View PostMeni, on 08 January 2013 - 08:47 PM, said:

Now i want all cables off!
Simple just use num as 0
redpower.setBundledOutput(side,0)

Typo 'redpower' should be 'redstone' or 'rs' obviously...

EDIT: Also the images seem to not work...

Edited by TheOriginalBIT, 08 January 2013 - 08:58 PM.


#3 Meni

    Script Kiddie

  • Members
  • Pip
  • 53 posts

Posted 08 January 2013 - 09:27 PM

Oh sorry about that! I edit and now is correct! Im a bit tired! I dont sleep for a day... Thank you!
And about the images here is working fine i used media fire to upload id but i will try another

#4 Andrakon

    Clueless

  • Members
  • 37 posts

Posted 25 February 2013 - 03:31 PM

This helped me out a LOT! I ended up writing an API to handle all the mess of the bundled cables for me based off of using 1, 2,and 2^2 through 2^15 as the color numbers.

#5 SuicidalSTDz

    Permutator of Strings

  • Members
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 1,227 posts
  • LocationWhere else -- The End

Posted 25 February 2013 - 03:39 PM

Now we can use redset <side> <color> <state> Very helpful API. Also, nice tutorial for players getting into Bundled Cabling. Very nice.

#6 Lyqyd

    Lua Liquidator

  • Moderators
  • 3,163 posts

Posted 25 February 2013 - 04:07 PM

This is somewhat unclear in that it suggests that the colors are numbered 1-16, then suggests that you raise 2 to the power of the number of the cable (i.e., 2^1 through 2^16), when in fact, the range of numbers is 2^0 through 2^15.

#7 Neekow

    Clueless

  • Members
  • 25 posts

Posted 02 March 2013 - 07:32 PM

Hum ... will try to explain but will be hard ...
command with variable is missing?

So to do it: rs.setBundledOutput("side", variable)

i.e:
local signal = 0


while true do
  rs.setBundledOutput("side", 2^signal)
  signal = signal+1
  if signal > 15 then signal = 0 end
  sleep(0.5)
end

with this, you will see every output 1 by 1.


I know, most of people know this, but not every one ^^

#8 redeye83

    Code Kiddie

  • Members
  • PipPipPip
  • 169 posts
  • LocationUnited Kingdom

Posted 04 March 2013 - 04:46 PM

I know theoriginalbit said this but I wanted to second it, Its so much simpler to use the colors rather than the numbers.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users