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:

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:

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.


<<< back | print | To main...
PhazaSoft© Ekzekutor©
Hosted by uCoz