Skip to content
Mist edited this page Jul 4, 2025 · 8 revisions

v8 interpreter

This version is exclusive to the OASM extension (found here), and allows all variables to be replaced with named variables

variables

setv var1 data - set the variable at the var int

svto var1 var2 - copies the data at var2 into var1

chav var1 var2 - set var1 to var1 + var2

subv var1 var2 - set var1 to var1 - var2

mulv var1 var2 - set var1 to var1 * var2

divv var1 var2 - set var1 to var1 / var2

modv var1 var2 - set var1 to var1 % var2

sqrt var - set var to the square root of itself

sinv var - set var to the sine of itself

cosv var - set var to the cosine of itself

tanv var - set var to the tangent of itself

copy

copy var1 var2 - copies the data in a varname inside var2, into var1

setv my_var hi
setv var1 my_var
setv new_var
copy new_var var1
prnt new_var

This prints "hi" because it looks inside var1 to find "my_var" and then looks inside "my_var" to find "hi"

strings

leng var1 var2 - finds the length of the data in var1 and sets var2 to the result

lter var1 var2 out_var - finds the letter at the var in var1 of var2 and sets out_var to the result

setv var 2
setv string hello!
setv out
lter var string out
prnt out

The above code would return "e"

join var1 var2 out_var - joins var1 and var2 and sets out_var to the result

jumps

labl name - creates a label that can be jumped to

jump line/label_name - always jump to a line no matter what

gthn var1 var2 line/label_name if the data in the var at var1 is greater than the data in the var at var2, jump to line

lthn var1 var2 line/label_name if the data in the var at var1 is less than the data in the var at var2, jump to line

equl var1 var2 line/label_name if the data in the var at var1 is equal to the data in the var at var2, jump to line

ngth var1 var2 line/label_name if the data in the var at var1 is not greater than the data in the var at var2, jump to line (equivalent to less than or equal)

nlth var1 var2 line/label_name if the data in the var at var1 is not less than the data in the var at var2, jump to line (equivalent to greater than or equal)

rendering

pend - places the pen on the canvas

penu - lifts the pen from the canvas

pene - clears the canvas

penc var1 - sets the pen colour to a variable var (supports hex codes)

pens var1 - sets the pen size to a variable var

setx var1 - makes the pen go to a x position at a variable var

sety var1 - makes the pen go to a y position at a variable var

setp var1 var2 - set position (makes the pen go to a x,y position)

input

getd mousepos var1 var2 - puts the mousex and mousey into var1 and var2 respectively

getd mouseclick var1 - puts whether the mouse left button is down into var 1 (value of 1 if mouse down, value of 0 if mouse up)

getd line var1 - puts the current line number into the variable you pass it

getd timer var1 - puts the time since originOS was booted into the variable you selected

getd timestamp var1 - puts the current timestamp into the variable you selected

getd key_a var1 - puts whether the a key is pressed into var1 (value of 1 if key pressed, value of 0 if key not pressed)
^^ this works with any key

output

prnt var - print the data in a variable to console

originOS Wiki

Wiki Views:
:views

OSL | RSH | ICN

Clone this wiki locally