mindustry logic execution, map- and schematic- parsing and rendering
Diffstat (limited to 'items.py')
-rw-r--r--items.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/items.py b/items.py
new file mode 100644
index 0000000..922cc30
--- /dev/null
+++ b/items.py
@@ -0,0 +1,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})")