+ Reply to Thread
Results 1 to 8 of 8

Thread: WireLib, get if a input is wired

  1. #1
    Wiremod Helper Donkie's Avatar
    Join Date
    May 2008
    Location
    Sweden
    Posts
    1,661

    Default WireLib, get if a input is wired

    As title said, how can i, using Lua, find out if a Input is wired on a entity?
    Get out. Seriously, do it.

  2. #2
    Wire Noob schmoller's Avatar
    Join Date
    Sep 2009
    Posts
    11

    Default Re: WireLib, get if a input is wired

    Something like this:

    where port is an input got through port = ent.Inputs[inputId] where ent is a valid wire entity and inputId is the index of an input
    Code:
    if (port.Src) and (port.Src:IsValid()) then
        -- the input is hooked up
    else
        -- not wired
    end

  3. #3
    Wiremod Helper Donkie's Avatar
    Join Date
    May 2008
    Location
    Sweden
    Posts
    1,661

    Default Re: WireLib, get if a input is wired

    Thanks alot!
    Get out. Seriously, do it.

  4. #4
    Wire Noob schmoller's Avatar
    Join Date
    Sep 2009
    Posts
    11

    Default Re: WireLib, get if a input is wired

    You're welcome

  5. #5
    Wiremod Helper Donkie's Avatar
    Join Date
    May 2008
    Location
    Sweden
    Posts
    1,661

    Default Re: WireLib, get if a input is wired

    Could you tell me where this function is declared? I have checked trough all files inside the Wire/ folder but thers no function, i would like to trace this down abit more :3
    Get out. Seriously, do it.

  6. #6
    Wire Noob schmoller's Avatar
    Join Date
    Sep 2009
    Posts
    11

    Default Re: WireLib, get if a input is wired

    There's no function, tbh i was disappointed too , but I found that code in the WireLib file. It should work as long as the entity you use it on has the base type "base_wire_entity"

  7. #7
    Wiremod Helper Donkie's Avatar
    Join Date
    May 2008
    Location
    Sweden
    Posts
    1,661

    Default Re: WireLib, get if a input is wired

    Oh, it must be a table value then.
    Get out. Seriously, do it.

  8. #8
    Wire Noob schmoller's Avatar
    Join Date
    Sep 2009
    Posts
    11

    Default Re: WireLib, get if a input is wired

    yes, I believe so

+ Reply to 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