Hydros in Wiremod

hey guys, i have been using wiremod for a couple of weeks now, and i have made an expression gate to run a hydraulic to make me go up & Down, but it can only run in set intervals. is there anyway i can use the wire hydro and the expression gate to make the hydro run smoothly, and just keep moving as long as i hold the button down???

cheers

Something like



timer("wat",80)

if (Input) {
       if (clk("wat")) {
            Hydraulic += 1
}


I’m tired so syntax might be wrong.

were do i put this code?? (forgive my ignorance, but i am still a self-proclaimed n00b)

In the code editor, of course. Modify it to suit your needs.

you select the Expression 2 Tool, go through the panel on the side (in the tool list), and select “New Expression”.

Give the name you want, and with the input section, write whatever you want your input names to be, paste that code in, and save. (unless you change the code jmazouri posted, you will have to have the input named input.)

Optimized:



@name Increment Gate
@inputs Up Down Speed Reset
@outputs Value
@persist
@trigger all
interval(10)
Value+=(Up-Down)*(Speed+1) #Add/subtract up and down. Multiply by Speed. +1 is there so that if you leave Speed unwired it will still work.
if (Reset) {Value = 0} #Allows you to reset it.

My way is a bit more advanced, and is meant for integration into already existing code. That’s good as well, though.

thanks, but i am not entirely sure on how to use this, could someone plz post the expression !!1!! chip file in this thread?? that would be so great…

thanks

You should stop using Expression 1, as it will be phased out soon and completely replaced by E2.