e2 docs core - wiremod/wire GitHub Wiki

Jump to table of contents

Core

Number = first()

Returns 1 if the expression was spawned or reset (1 ops)

Number = duped()

Returns 1 if the expression was duplicated (1 ops)

Number = inputClk()

Returns 1 if the expression was triggered by an input (1 ops)

String = inputClkName()

(1 ops)

Number = last()

Returns 1 if it is being called on the last execution of the expression gate before it is removed or reset. This execution must be requested with the runOnLast(1) command (1 ops)

Number = dupefinished()

Returns 1 when the contraption has finished duping. (1 ops)

Number = removing()

Returns 1 if this is the last() execution and caused by the entity being removed (1 ops)

runOnLast(Number Activate)

If set to 1, the chip will run once when it is removed, setting the last() flag when it does (1 ops)

exit()

Stops the execution of any code after it (2 ops)

error(String Reason)

Shuts down the E2 with specified script error message (2 ops)

assert(Number Condition)

If the argument is 0, shut down the E2 with an error message (2 ops)

assert(Number Condition, String Reason)

If the first argument is 0, shut down the E2 with the given error message string (2 ops)

reset()

Reset the expression itself as if it was just spawned, stops execution (100 ops)

Number = ops()

Returns how many ops are used every execution on average (1 ops)

Number = Entity:ops()

(1 ops)

Number = opcounter()

Returns how many ops have been used so far in this execution plus the amount of hard quota used (1 ops)

Number = cpuUsage()

Returns the average time per tick the server spends running this E2, in seconds (multiply it by 1000000 to get the same value as is displayed on the E2 overlay) (1 ops)

Number = Entity:cpuUsage()

Returns the average time per tick the server spends running the specified E2, in seconds (multiply it by 1000000 to get the same value as is displayed on the E2 overlay) (1 ops)

Number = perf()

If used as a while loop condition, stabilizes the expression around hardquota used (1 ops)

Number = perf(Number N)

If used as a while loop condition, stabilizes the expression around specified number (in %) (1 ops)

Number = minquota()

The ops left before soft quota is used up (1 ops)

Number = maxquota()

The ops left before hard quota is exceeded and the expression shuts down (1 ops)

Number = softQuota()

Returns the size of the soft quota (1 ops)

Number = hardQuota()

Returns the size of the hard quota (1 ops)

Number = timeQuota()

Returns the time quota in seconds (1 ops)

Gtable = select(Number Index, Gtable Argument1, ...)

Returns the Nth value given after the index, gtable's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

WireLink = select(Number Index, WireLink Argument1, ...)

Returns the Nth value given after the index, wirelink's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

RangerData = select(Number Index, RangerData Argument1, ...)

Returns the Nth value given after the index, ranger's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

ComplexNumber = select(Number Index, ComplexNumber Argument1, ...)

Returns the Nth value given after the index, complex's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Tracedata = select(Number Index, Tracedata Argument1, ...)

Returns the Nth value given after the index, tracedata's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Effect = select(Number Index, Effect Argument1, ...)

Returns the Nth value given after the index, effect's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

String = select(Number Index, String Argument1, ...)

Returns the Nth value given after the index, string's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Array = select(Number Index, Array Argument1, ...)

Returns the Nth value given after the index, array's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Vector2 = select(Number Index, Vector2 Argument1, ...)

Returns the Nth value given after the index, vector2's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Entity = select(Number Index, Entity Argument1, ...)

Returns the Nth value given after the index, entity's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Matrix = select(Number Index, Matrix Argument1, ...)

Returns the Nth value given after the index, matrix's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Table = select(Number Index, Table Argument1, ...)

Returns the Nth value given after the index, table's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Vector = select(Number Index, Vector Argument1, ...)

Returns the Nth value given after the index, vector's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Matrix4 = select(Number Index, Matrix4 Argument1, ...)

Returns the Nth value given after the index, matrix4's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Vector4 = select(Number Index, Vector4 Argument1, ...)

Returns the Nth value given after the index, vector4's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Matrix4 = select(Number Index, Matrix4 Argument1, ...)

Returns the Nth value given after the index, matrix2's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Number = select(Number Index, Number Argument1, ...)

Returns the Nth value given after the index, number's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Stcontrol = select(Number Index, Stcontrol Argument1, ...)

Returns the Nth value given after the index, stcontrol's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Bone = select(Number Index, Bone Argument1, ...)

Returns the Nth value given after the index, bone's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Ftrace = select(Number Index, Ftrace Argument1, ...)

Returns the Nth value given after the index, ftrace's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Quaternion = select(Number Index, Quaternion Argument1, ...)

Returns the Nth value given after the index, quaternion's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)

Angle = select(Number Index, Angle Argument1, ...)

Returns the Nth value given after the index, angle's zero element otherwise. If you mix types, the behaviour is undefined (5 ops)