1. Can anyone tell me where I can find an example or tell me how to get the time of day as a variable in javascript? I've been lookg for a couple of hours at other plugins, api docs, Google, the source code for Oxide and still cannot seem to find any way to get time. I see some lua example but am unsure how that would be written in Javascript.

    something like
    Code:
    var tod = rust.env.time;
    I can execute a server command, but cannot capture the output
    Code:
    var tod = rust.RunServerCommand("env.time");
     
  2. Wulf

    Wulf Community Admin

    You'd need to dig into Rust's Assembly-CSharp.dll to find what you are looking for.
     
  3. I don't even know what that means. So I guess that's the end of that.
     
  4. Wulf

    Wulf Community Admin

    You can use a program such as JustDecompiler or dotPeek, and open RustDedicated_Data/Managed/Assembly-CSharp.dll in it. You'll be able to find any and all Rust functions and methods you'd like in there. The majority of what you can do in is found in the DLL. The DLL is needed especially when nobody has documented or used what you are looking for already.
     
  5. Thanks for your explanation. I'm looking in to that now.
    [DOUBLEPOST=1433826457][/DOUBLEPOST]I was able to use m-time, the oxide rust javascript example on git hub, and dotPeek to get the following working:

    Code:
    var global = importNamespace("");   
    var sky = global.TOD_Sky.get_Instance();
    var hour = sky.Cycle.Hour;
    var isDay = sky.IsDay;
    var isNight = sky.IsNight;
    print(sky);
    print(hour);
    print(isDay);
    print(isNight);
    
    Thanks for your help Wulf!
     
    Last edited by a moderator: Jun 9, 2015