Because you have nothing to tell it to set Go to 0.
I really need help with this E2 code that I started making.
For some reason this code acts weirdly. If I have a ranger, and all the colours are correct, it still outputs 1 to "Go".
If I refresh the chip, it seems to correct itself, and if I take it away from the ranger it goes back to 1 as usual, but if I put it back in it stays as one. Any help?
I have tried with and without the timer for "Go", but nothing changes.Code:@name Automatic Train Expression @inputs ColR ColG ColB @outputs Thruster Thruster2 @persist Go runOnTick(1) if(ColR==50 & ColG==50 & ColB==50) {timer"Go=0",2000} else {Go=1} if(Go==1) { Thruster=1 Thruster2=1 } else { Thruster1=0 Thruster2=0 }
Expression 3 GATE
-Something to remember. We cannot see your information through this. Only you (and G. Bush) can.
Because you have nothing to tell it to set Go to 0.
The Olympus Technologies drones, totally not SkyNet in Gmod form.
Cronus: The Ultimate Drone, definitely SkyNet in Gmod form.
The gBrain Project, the drone controls system that thinks it's better than you
You seem to misunderstand the use of timers.
When you set a timer, you give it a name and a time in milliseconds until it activates.
When a timer activates, it triggers the execution of the code. You can check whether the execution is caused by a timer by using clk().
Also, runOnTick is not necessary for this chip.
You also had Thruster1 = 0 (There is no Thruster1).
The follow code should work:
Code:@name Automatic Train Expression @inputs ColR ColG ColB @outputs Thruster Thruster2 @persist Go if(ColR==50 & ColG==50 & ColB==50) { Go = 0 timer("Go",2000) } if (clk("Go")) { Go = 1 } if(Go==1) { Thruster=1 Thruster2=1 } else { Thruster=0 Thruster2=0 }
[E2] Extended Timers
Bulls pro-tip of the day:
When you honestly think that Led3=1,0,1,0,1,0,1 can make a light blink, stop trying to make an OS and do something easier.
Thanks, I am new to E2...
Also, Lyinginbedmon, it is there.
And I tried with and without the timer, so it was because I am an idiot sometimes and had Thruster1 for the else{} bit.
Expression 3 GATE
-Something to remember. We cannot see your information through this. Only you (and G. Bush) can.
Bookmarks