Expression 2 Core - wiremod/wire GitHub Wiki

Expression 2: Core Functions

Function Returns Description
first() Number Returns 1 if the expression was spawned or reset
duped() Number Returns 1 if the expression was duplicated
dupefinished() Number Returns 1 when the contraption has finished duping. (Only triggers on Adv Duplicator, not the normal duplicator)
inputClk() Number Returns 1 if the expression was triggered by an input
reset() Reset the expression itself as if it was just spawned, stops execution
exit() Stops the execution of any code after it
runOnLast(Number) Number 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.
last() Number Returns 1 if this is the last execution.
removing() Number Returns 1 if this is the last() execution and caused by the entity being removed.
ops() Number Returns how many ops are used every execution on average
cpuUsage() Number Returns the average cpu usage in seconds. Multiply it by 1000000 to get the same number you see in E2's overlay text.
opcounter() Number Returns how many ops have been used so far in this execution plus the amount of hard quota used
minquota() Number The ops left before soft quota is used up
maxquota() Number The ops left before hard quota is exceeded and the expression shuts down
softQuota() Number Returns the size of the soft quota
hardQuota() Number Returns the size of the hard quota
perf() Number If used as a while loop condition, stabilizes the expression around <maxexceed></maxexceed> hardquota used.
perf(Number) Number Same as perf(), where Number is the percentage of the soft quota the E2 will stabilise at.
⚠️ **GitHub.com Fallback** ⚠️