Skip to content
CoreyLee Hassell edited this page Jul 22, 2019 · 1 revision

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.

Expression 2 ⚛️

Tutorials (In learning order) 🎓

Extras ❔

Tools 🛠️

Click To Expand

Advanced

Beacon 💡

Control 🎛️

Data 💿

Detection 👀

Display 💻

Render

I/O 🔌

Physics 🚀

Utilities 🛠️

RFID

Wireless 🛜

Gates 🚥

Click To Expand

TBD

Clone this wiki locally