mindustry logic execution, map- and schematic- parsing and rendering
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import re
from sys import argv
import pyperclip

string = pyperclip.paste()
reg = re.compile(r"with\((.+)\)\);")
match = reg.search(string)[1].replace("Items", "")  # .replace(",", ":")
out: str = ""
i: int = -1
j: int = 0
while i < len(match) - 1:
    i += 1
    if match[i] == ".":
        out += match[i + 1].upper()
        i += 1
        continue
    if match[i] == ",":
        j += 1
        if j % 2 != 0:
            out += ":"
            continue
    out += match[i]
pyperclip.copy(f"cost!({out})")