-
Notifications
You must be signed in to change notification settings - Fork 0
Addons
Xshell now has support for addons
Beta Service |
---|
This service is a beta service and may not wok correctly |
To make an addon you need to make a file in the addons folder located in system/system64/addons
cd system/system64/addons
makefile example.py
$ nano example.py
You can use any editor you want in this example we are using nano
Every addon is called when a user types the name of the addon but first we need to script the addon
when a addon is called the `main()` function is called
```python
def main(command):
print(command)
in this example the variable command in the function is called when the user adds more data to the command
<addon_name> <command>
Lets say we make an addon called time.py
with the code:
def main(command):
import time
print(time.time())
To run this addon we type
time
using the return
function will not do anything because Xshell addons will ignore all returns
You may have noticed the variable command
in the demo script and other addons
This is so that a user can send a second bit of data or argument to the addon
for example lets make a addon called add2.py
def main(command):
print(int(command)+2)
In this example we have the command
variable that is defined by the user so this would return:
add2 5
7
Welcome to the Xshell Wiki