Skip to content
Factorio mod library
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode update project settings Mar 22, 2019
data
script
.gitattributes
.gitignore update project settings Mar 22, 2019
License.md init Mar 19, 2019
changelog.txt
data.lua consolidate structure Mar 20, 2019
info.json Squashed commit of the following: Apr 15, 2019
readme.md

readme.md

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: 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

You can’t perform that action at this time.