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

redstone control

Started by Dabels, 02 August 2016 - 11:57 AM
Dabels #1
Posted 02 August 2016 - 01:57 PM
so i am trying to do program that will be controlling 4 things in my base. but i have some problems i am very unexperienced
with lua (about 2 days) so i cant figgure it out.
program is running little bit good but it seems like he is "jumping" between functions .
code here: http://pastebin.com/wdeQD2V8

and when function usp1 starts everything is ok. After that function solar is still ok but when function vet says "vetrna OK" and it will call function uz1. uz1 is checking if colors. yellow and pink are online if not i will call function radio but with calling function radio it will turn off redstone signal color.green why ?
i dont need to rework my code i just need an advice to fix this thing.
and sorry for my bad english :/ .
Dabels #2
Posted 02 August 2016 - 09:48 PM
and one more question in script loop (while true do) i have solar first after that vetrna and radioisotipe but on monitor it writes radioisotope before vetrna i am confused about this O.o.
CCJJSax #3
Posted 04 August 2016 - 05:00 AM
It's turning off the green one in urz2(). radio() calls urz2() which is where it's actually being turned off.
Dabels #4
Posted 04 August 2016 - 10:27 AM
Yes this is how i want to have it but green is turned off before it reaches m.write("radioisotope OK"). so i think uz2 cant be called yet.
Bomb Bloke #5
Posted 04 August 2016 - 11:01 AM
There's a bug in ComputerCraft 1.74 that could be relevant here; you're not using that version, are you?
Dabels #6
Posted 04 August 2016 - 09:23 PM
I am using computer craft 1.75 so i think it can be ok ?

EDIT:
so i tried to delete substract green from uz1() uz2() and its still shuting down green redstone signal O.o
Edited on 04 August 2016 - 08:53 PM
Bomb Bloke #7
Posted 05 August 2016 - 03:25 AM
1.75's fine.

Occasionally you're setting "back" to a colour combined with "bottom", or vice versa - lines 60, 73, 127, and 139. These may remove green from the previous output. Are they all intentional?
Dabels #8
Posted 05 August 2016 - 10:01 AM
Well i tried to change from green to Lightgray. With that Lightgray i tested it and its still shuting down lightgray after saing "ventrna OK"