need a little help

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Ankh

New Member
Jul 29, 2019
4
0
0
Hello Interwebs,

First time poster, longtime fan of ftb.

And I'm kinda stuck with writing a program for a automated light system.
Everytime I want to test my program I get: test:4: invalid side.
I don't know if it's the setup or the program, so I decided to post both and what It should do.

The program;

term.clear()
term.setCursorPos(1, 1)
print"test started"
rs.setBundledOutput("Back", 1)
sleep "2"
rs.setBundledOutput("Back", 2)
sleep "2"
rs.setBundledOutput("Back", 4)
sleep "2"
rs.setBundledOutput("Back", 8)
sleep "2"
print "done"

The setup;





What It should do (See thumbnail 2 for visual aid);

Middle Piston retracts
Left Piston retracts
Right Piston extends
Middle Piston extends
Flip toggle latch, turn on wireless transmitter

This is a test for retracting a dirt block, extending a lamp and turning the lamp on.

If I can make this work, I want to do it in reverse and automate it with a Light Sensor.

Hope someone can help me :)

P.s. This is my first time doing anything with computercraft.
 

rushfan43

New Member
Jul 29, 2019
15
0
0
I think it is because the b is capitalized in "Back" and it doesn't recognize it as a valid side. Also, isn't the syntax for the sleep method sleep(int). I'm not the best at LUA so I don't know how credible any of that is.
 

Ankh

New Member
Jul 29, 2019
4
0
0
Thanks for the respond.
Changed all the B's and now I get the bios:133: expected number error.
I'm going to look if I made a typo.
 

Ankh

New Member
Jul 29, 2019
4
0
0
term.clear()
term.setCursorPos(1, 1)
print"test started"
rs.setBundledOutput("back", 1)
sleep "2"
rs.setBundledOutput("back", 2)
sleep "2"
rs.setBundledOutput("back", 4)
sleep "2"
rs.setBundledOutput("back", 8)
sleep "2"
print "done"

I just noticed when I start this program, it stops after the white cable (bit value 1) turns on and stays turned on.
It doensn't even print test started.
Going to lookup a few tutorials.
 

rushfan43

New Member
Jul 29, 2019
15
0
0
Try print ("test started") for line 3 and print ("done") for the last line. Also do sleep(2) for all the sleeps.