Updated Terminal: Adding Commands (markdown)
parent
b1d9dd41bd
commit
86eba769dc
|
@ -1,17 +1,27 @@
|
||||||
# Terminal: Adding Commands
|
# Terminal: Adding Commands
|
||||||
|
<!-- Todo: update this documentation more -->
|
||||||
|
## Adding Commands Permanently
|
||||||
The terminal, which runs on JavaScript, can have commands added to it.
|
The terminal, which runs on JavaScript, can have commands added to it.
|
||||||
|
|
||||||
## Step 1
|
### Step 1
|
||||||
|
Open the terminal file. It is located at `terminal/terminal.js`
|
||||||

|

|
||||||
Add the name of your command to the list (around line 25).
|
|
||||||
|
|
||||||
## Step 2
|
Add the name of your command to the list.
|
||||||

|
|
||||||
Add your code using the basic framework above (around line 152). It should look like this:
|
### Step 2
|
||||||
`case 'mycommand':
|
<!-- Todo: Readd a new image without the "brake;" issue that I somehow didn't notice. -->
|
||||||
|
Add your code using the basic framework below. It should look like this:
|
||||||
|
`
|
||||||
|
case 'mycommand':
|
||||||
//Your code goes here
|
//Your code goes here
|
||||||
brake;`
|
break;
|
||||||
|
`
|
||||||
|
Make your modifications and save the file.
|
||||||
|
|
||||||
## Step 3
|
### Step 3
|
||||||
Load up the terminal and run the command by typing its name. You should also be able to see it when running "help"
|
Open the terminal and run the command by typing its name. You should also be able to see it when running "help".
|
||||||
|
|
||||||
|
## Adding Commands Temporarily With Modules
|
||||||
|
<!-- Maybe todo: Combine modules with this documentation. -->
|
||||||
|
Modules are a way of temporarily adding functions to DremJS. Documentation on it can be found [here](https://github.com/sparrdrem/DremJS/wiki/Modules).
|
Loading…
Reference in a new issue