Bot settings
After installation and localisation adjustment (and profiles) it is reversible to other options of script. The majority of them are clear at once. To begin describe all options of MySettings array in main script:
- BotName - bot name. Can change voluntarily, observing rules for nicks;
- FName - bot folder path. About it it has been written in section of installation;
- PathSeparator - path divider fo files and folders. On PtokaX under Windows it is possible to use "\\" or "/";
- CmdPrefix - template of the symbols meaning a prefix for commands. The template for symbols is by default set "!", "+" and "/". Pay attention that Ekzekutor divides prefixes for commands of the Operator and the User (in style Verlihub). It automatically processes flag {prefix} in menu files, replacing it with corresponding symbol for the given profile of the user. Though under privileges according to prefixes the Bot does not make any division;
- BotDesc - bot description;
- BotEmail - bot E-Mail;
- MenuName - the name of menu. Necessarily after the name there should be double backslash, for example: "Main Menu\\". It is possible to leave an empty line, for example "" to place the menu without the main root point. In files of the menu flag {menuname} replaced with this value;
- IsOPLIstenGags - mode of audibility by Hub Operators of maskgagged (imperceptible mutes). 1 - yes, 0 - no;
- IsMGLIsten - mode of audibility of general chat by maskgagged. 0 - yes, 1 - no;
- LastMsgChat - to send or not the list of last messages of chat at connection (1-chat, 2-PM, 0-off);
- LastMsgCount - last remembered messages of chat count;
- isShow - whether to show bot in the list of users on the Hub (1-yes, 0-no);
- txtSeek - check commands on presence in folder txt the file, with name of an entered command with extention ".txt" (at presence it will be opened also contents it is sent the user) (1-yes, 0-no);
- txtType - type of sending contents of text files (0 - chat, 1 - PM);
- isWelcomInfo - whether to send at an login an information greeting from files with localisation name in folder welcome (1-chat, 2-PM, 0-off);
- RestartOnError - script reboot at error occurrence (on PtokaX) (1-yes, 0-no);
- ShowClock - show time and date in the list of users (1-yes, 0-no);
- AllowedChars - list of the resolved nick symbols;
- Birthday - contains seconds count, the past at the moment first start of script from "the epoch" beginning.
At loading of plugins their configuration variables from file Config.lua also are added in the general configuration table of the Bot. After the first start is created the configuration file Config.cfg, from which all options are then loaded of the configuration table MySettings.
Constants which are adjusted in the script:
- localization - localisation (server) type;
- DefaultLang - language by default (two lowcase letters from table EkzekutorLangs, should be supported by all plugins);
- isMultilingual - is multilingual functions active (1-yes, 0-no);
- isSendBotMenu - whether to send to users of the Bot menu from file BotMenu.lua (1-yes, 0-by demand, -1-off);
- isSendHubMenu - whether to send to users of the Hub menu from file HubMenu.lua (1-yes, 0-by demand, -1-off);
- isMixMenus - combine Bot and Hub menus for send (1-yes, 0-no);
- isShellEnable - here is underlined the password for access to Shell and LUA console (for Admins). If the password is not set (an empty string, ""), this function will be disabled;
- sCodePagesEncoding - name of the used encoding page. This coding specifies, what file of code pages will be loaded (in the folder PLUGINS should be file with the name CodePages_[codepage_name].lua);
- sUnicodeHTMLChars - name of Unicode HTML-entities encoding. This coding specifies, what file of HTML-entities tables will be loaded (in the folder PLUGINS should be file with the name UnicodeHTMLChars_[codepage_name].lua);
- iMenuDividerFactor - rows count in one portion of the menu for a smooth delivery.
If constant isSendBotMenu or isSendHubMenu sets to 0, corresponding menu will be sent only by inquiry, by command !getbotmenu or !gethubmenu. If sets to -1, menu disabled.
In Bot folder in API files witn name <localisation_name>.lua present constant UseLocalCodePages. If to this constant sets value 1 local (own) table of codings will be applied to codepages transformation (CodePages). On Verlihub (under UNIX) possible to use value 0. Then will be used the console utility iconv.
In file verlihub.lua for localisation verlihub also present constant UseLuaSocket, in which is set the mode of using LuaSocket (1-yes, 0-no).
Other variables and constants are office and updatings are not subject. The variables stored in file MySettings are loaded at start of script from file Config.cfg. Here variables of active plugins register. If this file is not found, options by default are used, and file Config.cfg remains in bot folder. For these options there are corresponding commands and menu points.
Let's pay attention to files in which the menu is stored: these are files BotMenu.lua, HubMenu.lua, Menu.lua (in folder of plugin with corresponding localisation) (the Bot menu, Hub menu and the plugin menu accordingly). It is not recommended to change the Bot menu and plugins menu (if do not know that do). In these menus contain commands which concern exclusively a bot. And here in the Hub Menu any other commands at will of the manager can contain. At the adjusting distribution kit there are four variants of the menu of hub for four types of localisation. Simply rename necessary in HubMenu.lua. At the first start if the Hub menu is not renamed yet, the boat itself will try to find and rename corresponding to the set localisation of the menu. In technical sense between files of the menu of the Bot and the Hub there are no distinctions. In a menu file simultaneously with the menu the help information by command contains, And also permissions by classes of users and localisations. Thus, this file is simultaneously and the contained menu, the inquiry and permissions on classes for commands. The inquiry on commands is formed automatically on the basis of contents of these files and deduced in the personal message (if write in PM or take advantage of corresponding line of the menu). And this inquiry considers a class of the user.
As it was already marked, in folder welcomewith name <localisation_name>.lua files-scripts of an information greeting which is shown at an login to hub are stored. For each class can be individual greeting witn name <localisation_name>_<class>.lua. In a folder txt text files with name which you wish to use as a command are stored. Contents sebd to the user when it will enter a command with name of text file containing in this folder (extention .txt is not considered, but the file should contain it).
I will tell as menu files are arranged. In the table BotMenu, HubMenu or Menu (in plugins) elements - the tables as which key the command name serves contain. An example:
Menu = {
["testcommand"]={
["PROFILES"]={
["verlihub"]={
[3]=1,
[4]=1,
[5]=1,
[6]=1,
[7]=1,
[8]=1,
[9]=1,
[10]=1,
},
["ptokax04"]={
[0]=1,
[1]=1,
[2]=1,
[3]=1,
},
["rushub"]={
[0]=1,
[1]=1,
[2]=1,
[3]=1,
},
["eximius"]={
[0]=1,
[1]=1,
[2]=1,
[3]=1,
},
},
["HELP"]="
- TEST COMMAND",
["COMMANDS"]={
"{menuname}TEST MENU\\Test
command$<%[mynick]>
{prefix}testcommand",
},
},
}
As you can see, in the command table ["testcommand"] three tables contain: profiles (["PROFILES"]), commands (["COMMANDS"]) and help string (["HELP"]). The line of the help is a line which is deduced as the help on command in PM from Ekzekutor when listing of accessible commands is deduced. In the table ["COMMANDS"] the list of lines of the menu which can be as much as necessary, through a comma, in the form of line values contains. Lines of the menu are elements of the table of commands. Thus pay attention to flags {menuname} and {prefix}, which are replaced with the name of the main point of the menu from options of script and corresponding to profile of the user prefix of commands. For language localization used flag {gl:type_index}, where type - indication of the language localization file, for example, Bot (for Bot language localisation file), Hub or plugin's name; index - element index in the specified file language localization.
In the table of profiles ["PROFILES"] the list of tables with the name of localisations in which the given command will be involved contains. In the table with the localisation name there is list of the profiles resolved for this command. If in the list of profiles there is no profile of the user using a command, Ekzekutor will answer that the command is not resolved for its profile. If for command the block of permissions is not set or there is no current localisation permissions for a command are not checked. If the profile is present at the list, but with value 0, to user it will not be sent the menu of this command.
Also in the files Vars.lua of plugins present any constants with settings.