COWMODSКаталог модов

Create: Logic

Safe scripting language for Create automation, instead of redstone.

Автор: ggg36985963обновлён 15 июл. 2026 г.
Механики игрыТехнологии

Описание

A create automation with using own programming language, naming "Metal". Place a computer, right click, enter code, press save, shift+right click for toggle run.

Coding: Declare 2 Systems (System is just like function), "INIT" and "TICK" like that:

SYSTEM(INIT): START;

init code here

END_SYSTEM;

SYSTEM(TICK): START;

tick (loop) code here

END_SYSTEM;

API: There is some functions to work with Metal.

built-in functions:

MAKE_VAR(VAR_TYPE,$name,start_value); - making a global variable (global variable MUST start with '$', ONLY in INIT)

MAKE_ITEM_VAR($name,item_id); - making a INT variable by minecraft item number id (ONLY in INIT)

SET($name,value); - set new value for variable

ADD/SUB/MUL/DIV($name,value); - operations with variables

WAIT(ms); - delaying script (ONLY in TICK)

CONTINUE(); - return to the current System begin (ONLY in TICK)

RERUN(); - return to the main System of current script (ONLY in TICK), REMOVED since 0.0.7

EXIT_STACK(); - exit entire stack of System calls and returns to the point of stack start. REMOVED since 0.0.7

RETURN(); - exit 1 System of stack of System calls, since 0.0.7 can actually return values to SYSTEM call

ABORT(); - forcibly terminate current script (Doesn't turn off computer)

CALL_SYSTEM(name, args...); - call System (max stack size is 16), cannot call Systems-EntryPoints (INIT, TICK), args is ONLY in in 0.0.3+ mod version, since 0.0.7, can return values

IF(condition): START; - Base IF operator (closing - "END_IF;")

ELSE(): START; - Base ELSE operator (between IF and END_IF), since 0.0.7 can be called without "()"

BIND_ARGS_TO_SYSTEM(name, args...); ONLY in INIT, args must be like "#var:INT", setting arguments to system call (CALL_SYSTEM), ONLY in 0.0.3+ mod version

MAKE_LOCAL_VAR(VAR_TYPE,#name,start_value); - making a local variable (local variable MUST start with '#') ONLY in 0.0.3+ mod version

ACCEPT_INVOKES(); - allow invoke non-reserved systems by integrations ONLY in INIT, for 0.0.4+ mod version

PRINT(args...); - INFO Output (white) ONLY in 0.0.6+ mod version

WARN(args...); - WARN Output (yellow) ONLY in 0.0.6+ mod version

ERROR(args...); - ERROR Output (red) ONLY in 0.0.6+ mod version

EVALUATE(str); - calculates the expression, added since 0.0.7

EVAL(code); - executes the code like a new SYSTEM, added since 0.0.7

FUNC((args),{ body }); - Creates a MetalFunction, can be called with .invoke(args), added since 0.0.7

CAUSE_HARD_ERROR(message); - Stops the script, log stack and info to console. added since 0.0.7

WHILE(condition, { body }); Runs while condition is true, added since 0.0.7

FOR(#i,start,end, { body }); Runs from #i = start to end - 1, added since 0.0.7

LIST(TYPE); - Creates a MetalList, elements limit is 1024, added since 0.0.7

SET_CATCH_MODE(); ONLY in INIT, now, some of errors won't stop the script, just log with "Error catched!", added since 0.0.7.

SENDER($name,"item1", "item2"); - ONLY in INIT, makes RedstoneLinker (MetalObject) with sending mode, better than old functional method (CONNECT_LINK_SENDER) added since 0.0.7.

RECEIVER($name,"item1", "item2"); - ONLY in INIT, makes RedstoneLinker (MetalObject) with receiving mode, better than old functional method (CONNECT_LINK_RECEIVER) added since 0.0.7.

MAKE_PROCESS(SYSTEM_NAME); - makes second ticking entrypoint, can be called once. ONLY in INIT. added since 0.0.7.

end of built-in functions

Java Functions (registered outside of a Metal):

CONNECT_LINK_SENDER(id,item1,item2); - making a transmitter connection (for two last arguments recommends use MAKE_ITEM_VAR, id is any value, doesn't used before), ONLY in INIT. NOTE: since 0.0.7 use SENDER($sender,item1name,item2name) instead.

CONNECT_LINK_RECEIVER(id,item1,item2); - making a receiver connection (use MAKE_ITEM_VAR variables for two last arguments) ONLY in INIT. NOTE: since 0.0.7 use RECEIVER($receiver,item1name,item2name) instead.

SEND_LINK(id,power); - send power to Create Redstone Link (use with id, used in CONNECT_LINK_SENDER). NOTE: since 0.0.7 use $sender.send(power) instead.

RECEIVE_LINK(id); - receive power from Create Redstone Link (use with id, used in CONNECT_LINK_RECEIVER). NOTE: since 0.0.7 use $receiver.receive() instead.

RANDOM(min,max); - returns random INT between min and max

RAND(); - returns random DOUBLE between 0.0 - 1.0

SIN(value); - returns sin of the value (use radians)

COS(value); - returns cos of the value (use radians)

TAN(value); - returns tan of the value (use radians)

SQRT(value); - returns sqrt of the value

DTR(value); - degrees to radians

RTD(value); - radians to degrees

GET_PI(); - returns PI

MIN(args...); - returns MIN of all arguments

MAX(args...); - returns MAX of all arguments

CLAMP(value,min,max); - returns limited value in range

ABS(value); - returns module of value

POW(value,pow); - returns exponentiation of the value

GET_OPS(); - returns completed operations of this script - 0.0.5+

end of Java Functions;

Tips:

ADD,SUB, etc using ONLY in modification of value for example:

ADD($x,1); = x += 1;

In brackets:

IF($x + 1 > $y): START;

code

END_IF;

And, ": START" is not necessarily, but recommended, you also can use

SYSTEM(INIT); ...

IF(condition); ...

etc.

Current variable types: INT, DOUBLE, POWER, BOOL. Since 0.0.7 - STRING, OBJECT.

TICK EntryPoint (System) running in the other thread 1000 times per second.

INTEGRATION: Since 0.0.4 you can call non-reserved systems from Computer Craft mod, its looks like: Metal: SYSTEM(INIT): START; ACCEPT_INVOKES(); BIND_ARGS_TO_SYSTEM(SUM,#first:DOUBLE,#second:DOUBLE); END_SYSTEM; SYSTEM(SUM): START; RETURN(#first + #second); END_SYSTEM; SYSTEM(TICK): START;

END_SYSTEM;

CC Lua: local metal = peripheral.find("metal"); if metal then print(metal.callSystem("SUM",5,10)); -- output: 15 else print("Cannot find Metal Computer"); end

Since 0.0.5 you can use SYSTEM(NAME,args...): START; instead of BIND_ARGS_TO_SYSTEM

example:

SYSTEM(SET_POWER,#f:POWER,#s:POWER): START;

SEND_LINK(1,#f);

SEND_LINK(2,#s);

END_SYSTEM;

"**" instead of "POW(val,pow);" "%" operator

Since 0.0.6, in output functions you can use literals, just like that:

PRINT(~Hello World);

Hello World

or, with variable:

MAKE_VAR(INT,$test,150);

PRINT(~counter: ,$test);

counter: 150

OBJECTS:

MetalList: $list.add(value); $list.get(index); $list.getFirst(); $list.getLast(); $list.remove(index); $list.removeFirst(); $list.removeLast(); $list.clear(); $list.size(); $list.maxSize(); $list.hasIndex(index); $list.forEach(MetalFunction);

MetalFunction: $func.invoke(args); $func.getTypes();

RedstoneLinker: SENDER: $sender.send(power); $sender.toggle(active); RECEIVER: $receiver.receive(); $receiver.isActive();

since 0.0.8 variables can be assigned like that:

TYPE $global_var = ...;

TYPE #local_var = ...;

changing:

var++; (increment)

var--; (decrement)

var+=...; (add)

var-=...; (sub)

var%=...; (mod)

var*=...; (mul)

var/=...; (div)

var**=...; (pow)

var=...; (set)

Галерея

Flashing lamp codeFlashing lamp

Последние версии

Все версии →
alpha

Create: Logic 0.0.8

0.0.8
15 июл. 2026 г.226Minecraft: 1.21.1neoforge
Скачать
Что нового
ADDED: Operators: ++ (increment) -- (decrement) += (add) -= (sub) /= (div) *= (mul) %= (mod) **= (pow) = (set) NOW, possible to assign variables like that: INT $anInt = 10; or BOOL #anBool = TRUE; FIXED: little bug with executing without brackets
alpha

Create: Logic 0.0.7

0.0.7
14 июл. 2026 г.20Minecraft: 1.21.1neoforge
Скачать
Что нового
Added: STRING type with "string" OBJECT type MetalFunction OBJECT: Creation: MAKE_VAR(OBJECT,$func,FUNC((#arg:INT,#arg2:BOOL),{ body })); Methods: $func.invoke(args); $func.getTypes(); - STRING LIST with all argument types MetalList OBJECT Creation: MAKE_VAR(OBJECT,$list,LIST(INT)); Methods: $list.add(50); $list.get(0); $list.remove(0); $list.getFirst(); $list.getLast(); $list.removeLast(); $list.removeFirst(); $list.hasIndex(0); $list.isEmpty(); $list.clear(); $list.size(); $list.maxSize(); - 1024 $list.forEach(FUNC((#i:INT,#v:INT),{ PRINT(#i + ": " + #v); })); RedstoneLinker OBJECT Creation: SENDER($sender,"diamond","iron_ingot"); RECEIVER($receiver,"redstone","stone"); Methods: with SENDER: $sender.send(power); $sender.toggle(true); $sender.isWorking(); $sender.isTransmitting(); with RECEIVER: $receiver.receive(); - power $receiver.isActive(); - power > 0 $receiver.isWorking(); $receiver.isListening(); FOR function WHILE function SENDER function RECEIVER function CAUSE_HARD_ERROR function SET_CATCH_MODE function MAKE_PROCESS function EVAL function EVALUATE function FUNC function BREAK function (in LOOPS) Changes: Stack limit size 16 -> 32 Now, redstone connections limit is 128 CONTINUE function will skip iteration in LOOPS, and can call without "()" CALL_SYSTEM now can return values Removed: EXIT_STACK and RERUN functions, bc them buggy
alpha

Create: Logic 0.0.6-hotfix-2

0.0.6-hotfix-2
11 мая 2026 г.124Minecraft: 1.21.1neoforge
Скачать
Что нового
FIXED: MAKE_ITEM_VAR, PRINT, WARN, ERROR doesn't show correctly in client with DEDICATED_SERVER (metal_modules doesn't load on client, if he on DEDICATED_SERVER, and that functions marked red)
alpha

Create: Logic 0.0.6-hotfix

0.0.6-hotfix
10 мая 2026 г.18Minecraft: 1.21.1neoforge
Скачать
Что нового
FIXED: - Editor cursor drawing out of bounds - Client doesn't receive console clear - Editor and console text drawing on extra line (out of bounds)
alpha

Create: Logic 0.0.6

0.0.6
10 мая 2026 г.12Minecraft: 1.21.1neoforge
Скачать
Что нового
ADDED: - Syntax highlighting - Console - PRINT, WARN, ERROR functions FIXED: - CALL_SYSTEM can now contain inline function calls warning: that version can contain bugs, bc there is a lot of changes
alpha

Create: Logic 0.0.5-hotfix

0.0.5-hotfix
6 мая 2026 г.58Minecraft: 1.21.1neoforge
Скачать
Что нового
FIXED: EXIT_STACK(); function INIT operations limit now is 4000
alpha

Create: Logic 0.0.5

0.0.5
6 мая 2026 г.15Minecraft: 1.21.1neoforge
Скачать
Что нового
FIXED: LOGGER spam at evaluate. ADDED: "**" operator (POW) "%" operator SYSTEM arguments instead of BIND_ARGS_TO_SYSTEM (u still can use BIND_ARGS_TO_SYSTEM, but you can directly set arguments list in SYSTEM declaration, which is more convenient)
alpha

Create: Logic 0.0.4

0.0.4
2 мая 2026 г.48Minecraft: 1.21.1neoforge
Скачать
Что нового
Added: ComputerCraft Integration (Optional); ACCEPT_INVOKES(); FIXED: BIND_ARGS_TO_SYSTEM bugs
alpha

Create: Logic 0.0.3

0.0.3
1 мая 2026 г.26Minecraft: 1.21.1neoforge
Скачать
Что нового
ADDED: local variables; CALL_SYSTEM arguments; BIND_ARGS_TO_SYSTEM - binding arguments to System; MAKE_LOCAL_VAR - making local variable (can be used anywhere, unlike MAKE_VAR); FIXED: called system start with second action; RETURN function.
alpha

Create: Logic 0.0.2

0.0.2
1 мая 2026 г.12Minecraft: 1.21.1neoforge
Скачать
Что нового
FIXED: computer block recipe computer block drop removed useless command