🐐 SCRIPTA
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user