Voz-Duh / Mindustry_CodeToLogic

Converter from code to mindustry logic

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Constants

#mind_code_lines

Current number of mindustry processors code lines.

Operators

<-

Move line to end of last line.

Example

    var x = 2
    <- * 2

    //x = 4

->

Line separator.

Example

    var x = 2 ->var y = 1

    //x = 2
    //y = 1

<< and <<<

Read.

Example

    var x = @shooting << duo1
    var y = 0 <<< cell1

    //x = is duo1 shooting
    //y = 0 index from cell1

=>

Read.

Example

    var y = (@type << wall1) => @copper_wall

    //y = wall1 is copper_wall

#inv

Inverse number.

Example

    var x = #inv 10

    //x = -10

Keywords

if

Basic if.

Example

            if(true){
                //if
            }else->if(){
                //else if
            }else{
                //else
            }

for

Basic Java/C#/C++ for.

Example

            for(var i = 0; i < 2; i++){
                //code
            }

var

Basic variable definition.

Example

            var x = 0
        
            //x = 0

class

Class definition.

Example

            class x(cell1) = { x: 0, y: 1 }
            //x_x = 0 index from cell1
            //x_y = 1 index from cell1
        
            x.x = 10
            //write 10 to 0 index in cell1

#macro

Macro definition.

Example

            #macro setx: var x = 0
        
            setx
            //x = 0
            #macro setx: var x = 2
            setx
            //x = 2

print_flush

Print flush.

Example

            print("Hello!")
            print_flush message1
            //Now we have "Hello!" in message1

draw_flush

Draw flush.

Example

            draw_clear(0, 0, 0)
            draw_flush display1
            //Now we have black display1

write

Write value to cell index.

Example

            write 10 >> cell1 >> 0
            //Now cell1 have 10 on 0 index

wait

Processor wait.

Example

            wait 1
            //Now processor waiting 1 second

flush_notify

Flush notify.

Example

            flush_notify

flush_mission

Flush mission.

Example

            flush_mission

flush_announce

Flush announce.

Example

            flush_announce 1
            //Flush announce to 1 second

flush_toast

Flush toast.

Example

            flush_toast 1
            //Flush toast to 1 second

unit_bind

Bind unit to processor.

Example

            unit_bind @dagger
            //Now all daggers binded to processor

unit_unbind

Unbind unit from processor.

Example

            unit_unbind

unit_idle

Set binded unit to idle.

Example

            unit_idle

unit_stop

Stop binded unit.

Example

            unit_stop

unit_pay_drop

unit_pay_drop

Binded unit drop payload.

Example

            unit_pay_drop

unit_pay_enter

Binded unit enter.

Example

            unit_pay_enter

cutscene_stop

Stop cutscene.

Example

            cutscene_stop

cutscene_zoom

Cutscene zoom.

Example

            cutscene_zoom 10

stop

Stop processor.

Example

            stop

end

End processor.

Example

            end

goto

go to label.

Example

            :test
            
            goto test

Label

Definition of label.

Example

            :test

Functions

World

get_flag(name)

get_block(x, y)

get_building(x, y)

get_ore(x, y)

get_floor(x, y)

spawn(team, unit, x, y, rot)

fetch_build(team, block, link)

fetch_core(team, link)

fetch_player(team, link)

fetch_unit(team, link)

fetch_build_count(team, block)

fetch_core_count(team)

fetch_player_count(team)

fetch_unit_count(team)

color(r, g, b, a)

distance_radar(from, order, type0, type1, type2)

health_radar(from, order, type0, type1, type2)

shield_radar(from, order, type0, type1, type2)

armor_radar(from, order, type0, type1, type2)

max_health_radar(from, order, type0, type1, type2)

unit_distance_radar(order, type0, type1, type2)

unit_health_radar(order, type0, type1, type2)

unit_shield_radar(order, type0, type1, type2)

unit_armor_radar(order, type0, type1, type2)

unit_max_health_radar(order, type0, type1, type2)

unit_get_block(x, y, type, floor)

unit_inside(x, y, radius)

unit_locate_ore(ore, out x, out y)

unit_locate_build(type, enemy, out x, out y, found)

unit_locate_spawn(out x, out y, found)

unit_locate_damaged(out x, out y, found)

not(bool)

Math

max(a, b)

min(a, b)

angle(x, y)

len(x, y)

noise(x, y)

abs(number)

log(number)

log10(number)

floor(number)

ceil(number)

sqrt(number)

rand(number)

sin(angle)

cos(angle)

tan(angle)

asin(angle)

acos(angle)

atan(angle)

Operations

print(values...)

set_color(unit, color)

set_config(unit, b)

set_enabled(unit, bool)

shoot_to(unit, x, y, bool)

shoot_unit(unit, to, bool)

draw_clear(r, g, b)

draw_rgba(r, g, b, a)

draw_color(color)

draw_stroke(value)

draw_line(x1, y1, x2, y2)

draw_rect(x, y, x_size, y_size)

draw_line_poly(x, y, sides, radius, rotation)

draw_poly(x, y, sides, radius, rotation)

draw_line_rect(x, y, x_size, y_size)

draw_triangle(x1, y1, x2, y2, x3, y3)

draw_image(x, y, texture, size, rotation)

unit_move(x, y, [range])

unit_boost(bool)

unit_shoot_to(x, y, b)

unit_shoot_unit(unit, b)

unit_item_drop(to, amount)

unit_item_take(from, item, amount)

unit_pay_take(block)

unit_mine(x, y)

unit_flag(flag)

unit_build(x, y, block, rot, config)

set_block(team, block, x, y, rot)

set_ore(block, x, y)

shock_unit(unit)

boss_unit(unit)

apply_status(status, unit)

remove_status(status, unit)

spawn_wave(x, y, nat)

set_map_area((x, y, w, h)

set_rule(rule, value)

set_team_rule(team, rule, x)

cutscene_pan(x, y, speed)

explosion(team, x, y, radius, damage, flying, ground, pierce)

set_flag(flag, b)

About

Converter from code to mindustry logic

License:GNU General Public License v3.0


Languages

Language:Python 100.0%