Skip to content

This is library for convenient (subjectively) convert python code to the Mindustry logic commands. This is project was created for my needs, so maybe i be improving this.

Notifications You must be signed in to change notification settings

Nawot/pyndustry

Repository files navigation

Hey, this is lib can like this:

from pyndustry.pyndustry import *

storage = CommandsStorage()
Mprint('Hello world!', 'message1')
storage.convert()

Output:

printflush message1
print "Hello world!"

and like this:

from pyndustry.pyndustry import *
from pyndustry.memory import *

storage = CommandsStorage()
mem = MemoryStorage('cell1')
Mif(mem[0] > 10,
	Function(lambda :
		Mprint('Wow', 'message1'))) \
.apply()
End()
storage.convert()

Output:

read memoryStorageResult__cell1 cell1 0
jump 3 greaterThan memoryStorageResult__cell1 10
jump 5 always x false
printflush message1
print "Wow"
end

and

from pyndustry.pyndustry import *
from pyndustry.graphics import *

storage = CommandsStorage()
display = Display('display1')
display.bind()
display.drawGameSprite(0.5, 0.5, sprites.blocks.router, 16, byCoefficient=True)
storage.convert()

Output:

drawflush display1
draw image 40.0 40.0 @router 16 0 0

About

This is library for convenient (subjectively) convert python code to the Mindustry logic commands. This is project was created for my needs, so maybe i be improving this.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages