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

Need Help with Redstone Output

Started by DZCreeper, 03 April 2013 - 04:32 PM
DZCreeper #1
Posted 03 April 2013 - 06:32 PM
I am just making myself a quarry with some turtles and a master computer. Direwolf20 style design, with a few improvements, none ComputerCraft related though, so on to my problem. This piece of code will not work at all.

  • redstone.setBundledOutput(left, 5)
  • sleep(0.4)
  • redstone.setBundledOutput(left, 0)
  • sleep(0.4)
  • shell.run("dig")
  • sleep(45)

Right from pastebin, so it should maintain its lack of formatting, its only 6 lines, its just a simple program that gets called to be run on the master computer. Everytime I do so it says ProgramName:1: Expected String , Integer.

I tried using rs.setBundledOutput and normal redstone.setOutput, same result. Sort of, redstone.setOutput gives the same message but it expects String , Boolean.

I first tried normal red alloy wire, which didn't work, then vanilla redstone, and then I switched commands, grabbed some bundled and yellow cable and it still won't work.
theoriginalbit #2
Posted 03 April 2013 - 06:36 PM
left needs to be in "

so it should be

rs.setBundledOutput("left", 5)

also for the future so you don't have to colour the code use the [code][/code] tags :)/>
DZCreeper #3
Posted 03 April 2013 - 06:40 PM
Excellent info, thanks, I always forget little things like brackets. With this info I will be able to get my sorting system and quarry running, 2 birds with no stone.

Edit: Another problem I may as well get some help with:




rednet.open("right")
rednet.send(M1, "cycle")
rednet.send(M2, "cycle")
rednet.send(M3, "cycle")
rednet.send(M4, "cycle")
rednet.send(M5, "cycle")
rednet.send(M6, "cycle")
rednet.send(M7, "cycle")
rednet.send(M8, "cycle")
rednet.send(M9, "cycle")
rednet.send(M10, "cycle")
rednet.send(M11, "cycle")
rednet.send(M12, "cycle")
rednet.send(M13, "cycle")
rednet.send(M14, "cycle")
rednet.send(M15, "cycle")
rednet.send(M16, "cycle")
rednet.send(M17, "cycle")
rednet.send(M18, "cycle")
rednet.send(M19, "cycle")
rednet.send(M20, "cycle")
rednet.send(M21, "cycle")
rednet.send(M22, "cycle")
rednet.send(M23, "cycle")
rednet.send(M24, "cycle")
rednet.send(M25, "cycle")
rednet.send(M26, "cycle")
rednet.send(M27, "cycle")
rednet.send(M28, "cycle")
rednet.send(M29, "cycle")
rednet.send(M30, "cycle")
rednet.send(M31, "cycle")
rednet.send(M32, "cycle")


This is the dig program mentioned in my code snippet in the OP. It should just send the message "cycle" to all 32 computers on my mining machine. For some reason it says this error: RedNet:53. I didn't see the exact error, I just broke and replaced the machine and redownloaded the programs and same result when I tried again. From what I can tell this code should work, and rednet is a stock program that comes from ComputerCraft itself. Did I somehow break it?

Edit: Some reason code tags didn't work the first time, ended up with a bunch of CSS code from copy and pasting badly.
Edit 2: Will report back, but according to the RedNet page on the wiki you can't use the label of the computer, you must find the numeric ID, that should be changed, sort of confusing I think.
Engineer #4
Posted 03 April 2013 - 08:52 PM
You cant use the label, just because you can label 2 computers with one label. Type ID in your prompt and it returns the ID. And maybe a litle better code:

local ID = {2,524,56,7}
for i = 1, #ID do
   rednet.send(ID[i], "cycle")
end

A lot less writing for you and its easier to read