+ Reply to Thread
Results 1 to 7 of 7

Thread: Moving a hydraulic 2 times.

  1. #1
    Wire Noob Noobie's Avatar
    Join Date
    Oct 2007
    Posts
    6

    Default

    Right... I have made a sorta factory, still its just the beginning.

    So. I have created a expression to get this to work the best way, but still. I got a problem.

    I use:

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-spacere;overflow:auto'>Timer >= 1 & Timer <= 10 -> HydraG = 150;</div>

    Ok, HydraG is the one that I want to move. But

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-spacere;overflow:auto'>Timer >= 1 & Timer <= 10 -> HydraG = 150;

    Timer >= 10 & Timer <= 20 -> HydraG = 200;</div>

    Didn&#39;t work. And I have no idea how to do this? I want it to change to value 150 when the timer is over the value of 1 and under the value of 10, and then I want it to change to value 200 when then timer is over value 10 and under the value of 20.

    Please help me.

  2. #2
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default

    Code:
    interval(1000)
    Timer += 1
    Timer >= 1 & Timer <= 10 -> HydraG = 150;
    Timer >= 10 & Timer <= 20 -> HydraG = 200;
    Should work

  3. #3
    Wire Noob Noobie's Avatar
    Join Date
    Oct 2007
    Posts
    6

    Default

    Thanks ALOT! I&#39;ll try it out right away :lol:

    EDIT: Nope... Don&#39;t work... Any more ideas?

  4. #4
    Expressionism 2.0 Syranide's Avatar
    Join Date
    Mar 2007
    Location
    Sweden
    Posts
    4,573

    Default

    what happens? beause it should... I think
    Oh wait, doesn&#39;t the one you first posted work?I didn&#39;t get that "Timer" referred to an external timer.

    Code:
    I@Timer
    O@HydraG
    Timer >= 1 & Timer <= 10 -> HydraG = 150;
    Timer >= 10 & Timer <= 20 -> HydraG = 200;
    Really should work... as you posted it.

  5. #5
    Wirererer uoykcuf's Avatar
    Join Date
    Jul 2007
    Posts
    279

    Default

    I don&#39;t really see any problems either
    appart from the fact that there is this split second that HydraG is two values
    but i believe e-gate just takes the last one assigned as ouput?

    anyway, your problem shouldn&#39;t be in this e-gate, maybe it&#39;s the rest of you wireing?
    Creator of this Ram controller



    Click here if u experience wiremod error Problems

    92% of teens have moved onto rap. If you are part of the 8% that still listen to real music, copy and paste this into your signature.

    98% of teens smoke, or have smoked before in their life. If you are part of the 2% that hasn&#39;t/doesn&#39;t, copy this into your sig.

    It ain&#39;t broken, it just lacks ducktape

  6. #6
    Wire Noob Noobie's Avatar
    Join Date
    Oct 2007
    Posts
    6

    Default

    No.... The wireing is fine :P. Yeah, I also think my code should work... It work&#39;s without the expression, if I just value range it works, but not that. Its very odd...

  7. #7
    Lifetime Supporter shadowkeeper's Avatar
    Join Date
    Jul 2007
    Location
    Heffen, Belgium
    Posts
    478

    Default

    what exactly does that hydro have to do? only switch between those 2 values? or does it need a 0 value outside of those bounds?
    if it does need to go back to 0 you could try this:

    HydraG = (Timer >= 1 & Timer <= 10 ? 150 : (Timer >= 10 & timer <= 20 ? 200 : 0))

    if not, I don&#39;t know what you could change, other then mayby changing ">= 10" to just "> 10" so that you can be absolutely certain that that doesn&#39;t collide and block the code somehow (though it shouldn&#39;t)

    edit: come to think of it, if you don&#39;t need it to zero out you can drop one of the value ranges (since it wouldn&#39;t change after the second range, you can drop that entirely)

    HydraG = (Timer >= 1 & Timer <= 10 ? 150 : (Timer > 1 ? 200 : 150)) <-- the second conditional is merely to prevent a 200 output from 0-1 on the timer, the greater then prevents it from firing at the same time as the first conditional so it won&#39;t spaz (could replace it with ">= 10" for extra security though), also, you can use it to have the hydro get a 0 before the timer hits 1 (replace 150 with 0 on the second conditional) and it would still stay 200 no matter how high the timer got after 10, it really depends on what you&#39;re trying to do exactly.

    edit2:
    if you only need it to switch between the two values, you can try:
    HydraG = (Timer <= 10 ? 150 : 200)

    so as long as the timer is below 10 you&#39;ll get 150, once you go above it you get 200
    if you need it to go back to 150 after that 20th second you can replace "200" by "(Timer <= 20 ? 200 : 150)"

    all this is guesswork ofcourse, since I don&#39;t know what you need specificaly
    I am nowhere, yet I am everywhere, I am the eyes that don't see but see all, I am therefore I live


+ Reply to Thread

Similar Threads

  1. Wiremod load times
    By Starburst in forum Installation and Malfunctions Support
    Replies: 1
    Last Post: 10-30-2008, 01:20 PM
  2. Wire_GPU Increasing server load times significantly?
    By Pestilence2k in forum Bug Reports
    Replies: 7
    Last Post: 10-26-2008, 03:25 AM
  3. Moving the wire tab
    By Jat Goodwin in forum Wiremod General Chat
    Replies: 0
    Last Post: 08-25-2008, 02:05 PM
  4. Loading times
    By andy1976uk in forum Off-Topic
    Replies: 18
    Last Post: 02-23-2008, 08:25 AM
  5. Help with GPS and moving platforms
    By Ripture in forum Installation and Malfunctions Support
    Replies: 4
    Last Post: 07-15-2007, 11:21 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots