A library of functions I often use and got tired of maintaining in every mod.
Make whole module available:
local optera_lib = require("__OpteraLib__.script.misc")
optera_lib.get_distance()
Note: During data stage the library creates a global reference optera_lib, allowing direct access to functions:
optera_lib.copy_prototype()
Make single function available:
local get_distance = require("__OpteraLib__.script.misc").copy_prototype
get_distance()
copy_prototype
create_icons
get_energy_value
multiply_energy_value
get_distance
get_distance_squared
ticks_to_timestring
compare_tables
get_main_locomotive
get_train_name
rotate_carriage
get_train_composition_string
open_train_gui