+ Reply to Thread
Results 1 to 8 of 8

Thread: Hydraulic

  1. #1
    Wire Noob MiniRazor's Avatar
    Join Date
    Dec 2009
    Posts
    14

    Exclamation Hydraulic

    i want a Hydraulic to go up slow so you can press a + and - button to raise and lower the elevator in E2 of couse can any1 give me a code i can use for it like it do whit hover balls

  2. #2
    Wire Noob (O_o)'s Avatar
    Join Date
    Nov 2008
    Posts
    14

    Default Re: Hydraulic

    do u know how to use search?

  3. #3
    Developer Matte's Avatar
    Join Date
    Jan 2009
    Location
    Norway
    Posts
    3,109

    Default Re: Hydraulic

    Put some more effort in your posts, and someone might actually help you.

    Also, search before posting. I'm sure this has been requested before.
    "If anybody says he can think about quantum physics without getting giddy, that only shows he has not understood the first thing about them."
    -- Niels Bohr

  4. #4
    Banned kajar9's Avatar
    Join Date
    Jun 2009
    Location
    Estonia
    Posts
    187

    Default Re: Hydraulic

    there isn't actually an E2 funtion for ewery key
    so just make an numpad input (+) and numpad input (-)
    Wire the inputs to e2 Chip

    PHP Code:
    @outputs Value
    @inputs Incr Decr
    if(first()){N=1}
    if (
    Incr){Value+=N}elseif(Decr){Value-=N}else{Value=Value
    isn't tested (made outside garry here on forum)
    N is the Value how much it changes per click of numpad

  5. #5
    No u Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    4,582

    Default Re: Hydraulic

    Quote Originally Posted by kajar9 View Post
    PHP Code:
    @outputs Value
    @inputs Incr Decr
    if(first()){N=1}
    if (
    Incr){Value+=N}elseif(Decr){Value-=N}else{Value=Value
    You forgot to put N in persist. Also, why make a variable for N when you can simply put 1 down in the code?

    "else {Value = Value}" does nothing, might as well not have it at all.

    Code:
    @inputs Up Down
    @outputs Nr
    interval(Up|Down)
    Nr+=(Up-Down)
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

  6. #6
    Wire Noob MiniRazor's Avatar
    Join Date
    Dec 2009
    Posts
    14

    Default Re: Hydraulic

    i will make a search for it but thanks for the help

  7. #7
    Wire Noob MiniRazor's Avatar
    Join Date
    Dec 2009
    Posts
    14

    Default Re: Hydraulic

    i found it but now i got an ohter problem

    i will get an door for my elevator so it opens when it comes to floor 0-1-2-3

    Code:

    @name Elevator
    @inputs A B C D
    @outputs Hydraulic Door
    if (A == 1) {Hydraulic=90}
    if (B == 1) {Hydraulic=180}
    if (C == 1) {Hydraulic=270}
    if (D == 1) {Hydraulic=0}
    if (Hydraulic==90) {Door=0} else {Door=47}
    if (Hydraulic==180) {Door=0} else {Door=47}
    if (Hydraulic==270) {Door=0} else {Door=47}
    if (Hydraulic==0) {Door=0} else {Door=47}

    Code:end

    D=0
    thats what i started whit but it only opens at floor 0


    or shut i just use rangers at each floor to open and close
    pls help

  8. #8
    Wire Amateur D_D_Danneh's Avatar
    Join Date
    Sep 2009
    Posts
    92

    Default Re: Hydraulic

    Quote Originally Posted by MiniRazor View Post
    i found it but now i got an ohter problem

    i will get an door for my elevator so it opens when it comes to floor 0-1-2-3

    Code:

    @name Elevator
    @inputs A B C D
    @outputs Hydraulic Door
    if (A == 1) {Hydraulic=90}
    if (B == 1) {Hydraulic=180}
    if (C == 1) {Hydraulic=270}
    if (D == 1) {Hydraulic=0}
    if (Hydraulic==90) {Door=0} else {Door=47}
    if (Hydraulic==180) {Door=0} else {Door=47}
    if (Hydraulic==270) {Door=0} else {Door=47}
    if (Hydraulic==0) {Door=0} else {Door=47}

    Code:end

    D=0
    thats what i started whit but it only opens at floor 0


    or shut i just use rangers at each floor to open and close
    pls help
    One problem with your code, is that it relies on what you are outputting to the hydraulic. This means, when you press the button to go to floor 3, the door will open, and then it will travel.

    I would put a ranger on top the elevator, so it's pointing towards the roof of the elevator shaft. Then, measure what the ranger reads at each floor. So at the ground floor, it might measure 250, at the second floor, maybe 210, or whatever.

    Then use if(inrange(Ranger, Distance 1, Distance 2)) {Door = 0} else {Door = 47}

    Where Distance 1 and 2 are the measurements at each floor, + or - 5.

    So if the measurement for the first floor was 250, and the second floor was 530, you'd use this:

    if(inrange(Ranger, 245, 255)) {Door = 0} else {Door = 47}
    if(inrange(Ranger, 525, 535)) {Door = 0} else {Door = 47}

    I can't understand why your elevator door will only open at the ground floor though.

+ Reply to Thread

Similar Threads

  1. [HELP] hydraulic
    By bldmess vault-boy in forum Installation and Malfunctions Support
    Replies: 5
    Last Post: 07-12-2009, 04:03 PM
  2. XQM hydraulic Vs Normal Hydraulic
    By Jat Goodwin in forum Installation and Malfunctions Support
    Replies: 7
    Last Post: 02-14-2009, 05:54 PM
  3. Hydraulic bug // E2
    By anthraxyhe in forum Bug Reports
    Replies: 1
    Last Post: 01-01-2009, 02:57 AM
  4. A little help with hydraulic's
    By Kaiern in forum Installation and Malfunctions Support
    Replies: 1
    Last Post: 07-11-2007, 11:09 AM
  5. hydraulic bug
    By undead82004 in forum Bug Reports Archive
    Replies: 3
    Last Post: 06-15-2007, 04:43 AM

Tags for this Thread

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