Skip to main content

Plugins

🔗 Original page — Source of this material


Description

Plugins are actions created by the user. Essentially, they are templates with a ❗→ bot interface (BotUI) saved in a special way. Plugins have the .zpg extension and can return the result of their work.

image-20200811-062811

Every input field supports ❗→ variable macros.

Plugins are very similar to a ❗→ project within a project, but they're much more convenient:

  • you can create an easy-to-use interface for passing values to it (if you use project-in-project, you have to map variables from the main template to the called one, which often means switching to the sub-template just to remember why a certain ❗→ variable is used)
  • plugins are installed once and then available in all projects as ❗→ standard actions (with project-in-project you have to specify the complete path to the called template every time, and if you move or rename the sub-template accidentally or intentionally, all projects calling it will break)
  • you can ❗→ sell a template with unlimited plugins for just $12 (while using embedded projects increased the cost depending on the number of sub-templates)

Where can this be used?

You can pack any repetitive actions into a plugin:

  • for example, if you need to search for videos on YouTube and save their links. You already have a group of actions (or even a separate template) for this, and they're working great. To add this functionality to another template, you either use ❗→ project-in-project or copy and paste the actions where you need them. At first glance, copy-paste seems easy and convenient, but imagine you have 6 places in your template where you need to search for videos—so you copy the necessary actions 6 times. Everything works fine... but then you want to update the video search functionality. Now you must find all the places where you previously inserted those actions and update them (and if there are not one but 10-20-33 templates...). On the other hand, you can pack all this into a plugin and just call it. If you need to change how it works, you'll only need to update the plugin and reinstall it.
  • sending notifications to Telegram/VK/other services. If you're only sending text, you can use a single ❗→ GET or ❗→ POST request block. But then you'll want to send formatted text, add images, audio files, and other attachments. Over time, one ❗→ action grows into a large group of blocks, and that's another great time to convert it into a plugin.
  • take a random line from a given text file. For this, you need to create a separate list, link it to a file (preferably with a check to make sure the file exists), and get a random line from the list—at least three actions. Maybe you'll want all letters to be uppercase, or lowercase, or to trim the line to 80 characters. All this can be packed into a plugin.
  • Any template can be made into a plugin. The only limit to using plugins is your imagination.

Installing plugins in ProjectMaker

There are several ways to install ready-made plugins:

  1. The simplest way is to double-click the plugin file. If a plugin with the same file name is already installed, a dialog box will ask if you want to replace it. If this is the first time installing the plugin, you'll see a message about successful installation.
  2. Add via ❗→ settings. The advantage of this method is that you can select multiple files and install them all at once. If you try to add a plugin whose filename matches one that's already installed, a window will appear listing plugins that couldn't be installed. After adding, plugins are immediately ready to work.
  3. Copy the plugins to the local directory on your computer (by default: C:\Users\[user_name]\Documents\ZennoLab\Plugins\Local). After that, you need to restart ProjectMaker.

Removing plugins

  1. Through ❗→ settings:

image-20200811-062943

  1. The second way is to delete the files from the local directory on your computer (in this case, it's best to restart ProjectMaker afterwards).

How do I add plugins to a project?

There are several ways:

image-20200811-064934

How do I work with plugins?

Working with custom plugins is almost the same as working with standard ❗→ actions—you add the plugin to your project in whatever way is convenient, fill in ❗→ input settings (here you can use ❗→ project variables)

Saving a template as a plugin

How to save

There are several ways to save a template as a plugin:

  • From the top menu, select File–Publish Project (or use the hotkey Ctrl+Alt+P). The project publication window appears; in the dropdown list "What to do", select Save as Plugin.

image-20200811-065059

  • In the same top menu, select File–Save Project as Plugin
  • Right-click the tab of the required project in the projects window and choose Save Project as Plugin from the context menu

image-20200811-065213

Save Settings

Main window and "Plugin Settings" tab

image-20200811-065723

Tip

If you hover over an input field or its name, a tooltip for that field will show up.

Where to save

Choose where on your computer the plugin file will be saved.

Tip

When you install the plugin in the program, this file is copied to the Installed Plugins Directory.

Encrypt project

This option allows you to encrypt the entire project file. If embedding external libraries is enabled, they will also be encrypted.

Caution

When selling plugins, they should not be encrypted, as re-encryption is not possible. That is, you won’t be able to resell a plugin you bought yourself.

Name

Set the plugin name (this is how it will be shown in ProjectMaker).

Tip

ProjectMaker allows saving plugins with the same name, but to avoid confusion try to give a unique name each time.

Version

Set your desired plugin version.

Icon

Upload an icon for your plugin.

Supported formats: png, ico, bmp; size: 16x16 up to 128x128. If your plugin has its own icon, it'll be easier to visually find it among other ❗→ actions.

Log plugin errors

If this checkbox is checked and the template finishes with an unhandled error, the log will contain the error text (for example: "No HTML element found for the search criteria"). Otherwise, the log will only record "Plugin processing error".

"Advanced" tab

image-20210503-140540

It's a good idea to fill out this tab if you plan to sell your plugin or share it with others. Here you can enter your email for feedback, add a description, extra contact info, and a link to the plugin's forum thread at http://zennolab.com (if you want to add the plugin file to the thread, you can first create and style the thread, publish it, add the link to the plugin, and then edit your post to add the plugin file itself).

Preview and publish

Before saving the plugin, you can click Preview to see how its description will look.

image-20200811-070128

After you click "Publish", the project will be checked and compiled as a plugin. If no errors occur during compilation, two new buttons will appear:

  • Open folder with plugin
  • Add to ProjectMaker

image-20200811-070726

Selling projects with plugins

For more details, see ❗→ Selling bots with plugins

Plugin input settings

Input settings for plugins are created using ❗→ BotUI. But when creating settings for plugins, there are some extra options—Mapper and return value.

Mapper

This control lets you pass ❗→ lists, ❗→ tables, or ❗→ Google spreadsheets from the main template to the plugin.

Caution

Any changes made inside the plugin to the passed list/table will also affect the list/table in the main template!

image-20200811-070958

To add a *Mapper in the *Bot interface editor, scroll the toolbar all the way down and drag the control onto the main window. Click the added control and set up its settings (on the right):

  1. DataType – type of the object being passed. Possible values:

  2. ❗→ List

  3. ❗→ Table (simple table)

  4. ❗→ GoogleSpreadsheet

  5. BindingElement – the internal object (list or table) where data from the external template will be passed (this object must already exist when creating settings).

Now you can easily pass a list into the plugin:

image-20200808-145927

Return value

A plugin can return the result of its work. To enable this feature, in the Bot interface editor, in the main window where you add controls, click in any empty space and check the Return value (Plugin Mode) checkbox on the right:

image-20200808-150555

There are several types of return values:

  1. ❗→ Variable
  2. ❗→ List
  3. ❗→ Table
  4. Variables (you can also add a *description for each variable to help users of the plugin understand what they are for)

How the settings look when CREATING a plugin (returning multiple variables)

image-20200808-151836

How the settings look when CALLING a plugin (returning multiple variables)

image-20200808-152236

When choosing any return value type, you need to map it to an internal object where the returned value will be stored.

Examples of user plugins from the ZennoLab forum

Caution

Do not run plugins obtained from unreliable sources—they can harm your computer!

Open-source:

Closed-source: