🐐 SCRIPTA

This commit is contained in:
2026-04-21 22:00:19 +02:00
parent e61009b6ef
commit 80d430970a
9 changed files with 250 additions and 4 deletions

View File

@@ -1152,6 +1152,28 @@ class BuiltIn(Node):
raise CentvrionError("DORMI requires a number or NVLLVS")
time.sleep(seconds)
return vtable, ValNul()
case "LEGE":
if "SCRIPTA" not in vtable["#modules"]:
raise CentvrionError("Cannot use 'LEGE' without module 'SCRIPTA'")
path = make_string(params[0], magnvm, svbnvlla)
with open(path, "r") as f:
return vtable, ValStr(f.read())
case "SCRIBE":
if "SCRIPTA" not in vtable["#modules"]:
raise CentvrionError("Cannot use 'SCRIBE' without module 'SCRIPTA'")
path = make_string(params[0], magnvm, svbnvlla)
content = make_string(params[1], magnvm, svbnvlla)
with open(path, "w") as f:
f.write(content)
return vtable, ValNul()
case "ADIVNGE":
if "SCRIPTA" not in vtable["#modules"]:
raise CentvrionError("Cannot use 'ADIVNGE' without module 'SCRIPTA'")
path = make_string(params[0], magnvm, svbnvlla)
content = make_string(params[1], magnvm, svbnvlla)
with open(path, "a") as f:
f.write(content)
return vtable, ValNul()
case _:
raise NotImplementedError(self.builtin)