Avaliable Functions

  • "setvar (variable) (value)" will define a variable.

  • "if (var 1) (== or /= or >> or << or =< or >=) (var 2)" will execute all code from the if statement to the word "end" if the statement is true.

  • "wait ___" will wait the number of seconds given.

  • "loop ___" will loop all code between the loop and the word "end" the amount of times given.

  • "readinput" will get user input using the python input() function.

  • "slice (string variable) (index 1) (index 2)" will slice a string between the two indexes and set the string to the result.

  • "arrayset (array) (append/remove/lengthof/index/atindex) (modifier) (result var)" will handle and control arrays.

  • "pyrun" will execute Python code inline, use \ after each line of code to execute multiple lines.

  • "jsrun" will execute JavaScript code inline.

  • "find (result variable) (string) (subsring)" will return if substring is in string as boolean.

  • "usemod (filename) (function)" will use a ".mgarm" file or python file as a module and execute the given function from that file.

  • "searcher (string) (expression) (result variable)" will use the expression given as explained below, to get a substring from a string similar to regex. Expressions use the following:

    • "<*>" will match any non-whitespace character.
    • "<abc>" will match any letter.
    • "<123>" will match any number.
    • "<???>" will match any special character.
    • "{<word>}" will match the given word in the string.
    • "&&" will require all given arguments to match.
    • "!&" will require that none of the arguments match.
  • "math (+ or - or * or / or mod or exp or round) (result variable) (number 1) (number 2)" will perform arithmetic functions using the two numbers and save the result to the given variable.

  • "getcmd (var name)" will get the output of the last shell command and store it as a variable.

  • "concat (result var) (string 1) (string 2)" will concat two strings.

  • "getdata (result var) (url)" will make a REST API request the the url and save the result as a variable.

  • "senddata (variable) (url)" will make a POST REST API request to the given url using the given variable.

  • "hostdata (variable) (path)" will host the given variable on a flask REST API server.

  • "snip (function name) {code}" will make a small snippet of code similar to a function but without arguments.

  • "iterate (varname) (string to iterate) (function)" will iterate over a string similar to a for loop and execute the given snippet each time.

  • "setobj (name) (functions array) (variables array)" will create a object with set snippets and variables.

  • "getobjvar (obj name) (var name) (result var)" will get a set variable from a object and save the result to the given variable.