Skip to content

0ptera/Opteras-Library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Optera's Library

A library of functions I often use and got tired of maintaining in every mod.

Usage:

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()

Data Stage Functions

data/utilities

copy_prototype
create_icons
get_energy_value
multiply_energy_value

Control Stage Functions

script/misc

get_distance
get_distance_squared
ticks_to_timestring
compare_tables

script/train

get_main_locomotive
get_train_name
rotate_carriage
get_train_composition_string
open_train_gui

script/logger

log
print
tostring
settings
add_debug_commands