This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
ASB44's profile picture

Need help with a simple script

Started by ASB44, 07 September 2012 - 11:21 PM
ASB44 #1
Posted 08 September 2012 - 01:21 AM
Basicly I've been working on a reactor that restocks its self. but my only limitation is this piece of script I've been trying to get to work.

function ASDF()
I = 0
repeat
  redstone.setBundledOutput("right",3+4)
  sleep(.5)
  redstone.setBundledOutput("right",3)
  I = I + 1
until I > 45
end

while true do
if rs.getInput("left") == true then
  ASDF()
  redstone.setBundledOutput("right",3)
end
end

Basicly I want it to pulse the magenta wire and keep the white and orange wires on at the same time
but instead when it turns on the magenta wire the magenta wire does not turn back off in .5 seconds.
Noodle #2
Posted 08 September 2012 - 01:28 AM
rs.setBundledOutput("right", colors.WHITE/RED/ORANGE/ETC)
3 doesn't exist in the rs colors.
ASB44 #3
Posted 08 September 2012 - 01:33 AM
rs.setBundledOutput("right", colors.WHITE/RED/ORANGE/ETC)
3 doesn't exist in the rs colors.
Actualy it does. each wire is assigned a binary value you can use the color names but those take up space.
so white would be one and orange would be two
3 is 2 and 1 and magenta is 4 so turning on magenta and white and orange would be 7. heres some evidence to back up that claim http://www.youtube.com/watch?v=YyjGxTb_9vA
Noodle #4
Posted 08 September 2012 - 05:55 AM
rs.setBundledOutput("right", colors.WHITE/RED/ORANGE/ETC)
3 doesn't exist in the rs colors.
Actualy it does. each wire is assigned a binary value you can use the color names but those take up space.
so white would be one and orange would be two
3 is 2 and 1 and magenta is 4 so turning on magenta and white and orange would be 7. heres some evidence to back up that claim [media]http://www.youtube.com/watch?v=YyjGxTb_9vA[/media]
I see what you mean..
Still is more understandable to people who read your code if you have colors.etc.