Documentation - MortyHub/DIVI-Interpreter GitHub Wiki

Documentation


Things you need to know

  • This language is only supported with python
  • This language is object oriented
  • data grabbing only prints into the console
  • shell objects will be created with a new file

Basics

This language is not hard to learn, i tried to make it as simple as possible so anyone even new to programming should be able to learn this

Built in objects

  • Shells, these can be created and opened with shell.create('shell name') this will create a shell object and the file will be stored in Divi/src/compiler/Shells command for opening items like this is shell.site('object')
  • Sprite Bodys, these can be created using Create.Object('') then attach a sprite using object.setSprite('sprite.png')

Helpful setting commands

  • multiline() this allows you to create multiple lined scripts

Divi v1.5.0 (default, Nov 28 2021, 15:34:10)
Divi >> multiline()
Type: end, to end the the script
1 >> shell.log('Hello, World!')
2 >> shell.log('Oh, this is multiple lines')
3 >> end
Hello, World!
Oh, this is multiple lines
Divi >>
  • update() This will update the version to the latest updated repo

Basic Commands

  • shell.log('Hello, World!') This will print items into the console
  • shell.stop() This will close the shell
  • multiline() this allows you to create multiple lined scripts
  • help('command') This is the help menu

Setting Data

  • object.setSprite('duck.png') This will set the sprite of a image object created with Create.Object('object')
  • object.public() This will make the shell object capable of being accessed without the key required, aka it can be required via name or url
  • object.private() This will make the shell object incapable of being accessed with name and url, only will be able to be accessed with key`
  • object.setDat(';-;') This will make the shell object have selected data

Interacting with divi files

  • shell.site('object') This will open the object file you made by creating objects, it will run the script you put in there
  • The default.txt file is a default script file, it will open that as soon as you open main.py, all objects of code should be separated by line
  • object.private() This will make a script object private and it can not be ran, shell.site('object') won't work and will return with This object is private. You can check all of your private objects with shell.privates()
  • object.public() This will make your script object public and will be capable of being ran with shell.site('object'). This will not return an error unless the object is not defined or does not exist.
  • All object are defaulted to private

Working with GUI's

  • You can render a graphical site by running renderHTML("<h1>Hello World!</h1>", "title") double quotes required, this will take the html you input into the double quotes and display it on screen, commas are not valid items and double quotes will start an error so avoid those characters, \ wont help in such a situation
  • image bodies will soon be able to be displayed with the following command: object.render(100, 100) digits for x and y coordinates

Script Examples

Hello World

Print Out Text

shell.log('Hello, World!')

GUI

renderHTML("<h1>Hello World!</h1>", "Hello World")

Playing With Objects

shell.create('crane', 'A@Snh3%#rI$TT61sp*A7i8i')

Going to DIVI/src/compiler/Shells/crane.divi

shell.log('Hello World')

Going back to shell program

shell.site('crane')

Output >> Hello World

Variable Creation

Variables are items of data in your code that you can call for later. They can be used in if then statements which will be brought up in the next section.
Use:var.create('name', 'value')

If-Then Statements

If then statements are essential when writing more advanced programs, if statements look like if varname==varname:, all if then statements must have the variable names connected with the operator. The way they end is by using the symbol ;, once this symbol is on its own in a new line it will stop detecting lines of code kind of like using:

if(1 == 1)
{
console.log('it works')
}

Except it would be:

var.create('var1', '1')
var.create('var2', '1')

if var1==var2:
shell.log('')
;

⚠️ **GitHub.com Fallback** ⚠️