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
I can execute a server command, but cannot capture the outputCode:var tod = rust.env.time;
Code:var tod = rust.RunServerCommand("env.time");
Solved Time of day variable in JavaScript?
Discussion in 'Rust Development' started by Darwin, Jun 9, 2015.
-
Wulf Community Admin
You'd need to dig into Rust's Assembly-CSharp.dll to find what you are looking for.
-
I don't even know what that means. So I guess that's the end of that.
-
Wulf Community Admin
-
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);
Last edited by a moderator: Jun 9, 2015