Перевод файла tcl-commands.txt
из документации к ботам EGGDROP 1.6.x
<<<
вернуться в раздел TCL/IRC на
bot.net.ru
Здесь находится переведенное на русский язык описание функций, которые
можно использовать при создании скриптов на языке TCL. Всего существует
2 типа команд: встроенные в сам TCL (независимый язык программирования)
и команды, доступные для TCL-скриптов на ботах. Взять эту станицу в
виде .TXT файла можно по адресу http://bot.net.ru/tcl-commands.rus.html
Перевод выполнен: . . . . . . . . . . Дмитрий Бородин (www.bot.net.ru)
Канал по PHP/TCL: . . . . . . . . . . . . . . #PHPclub, eu.undernet.org
ПОСЛЕДНЕЕ ИЗМЕНЕНИЕ: . . . . . . . . . . . . . . . . . . . 05.11.2002
Перевод был: . . . . . . . . . . . . . . . . . . . . начат 20.06.2001
закончен 04.06.2002
Свежую версию и другую документацию можно скачать на сайте поддержки
ботов: http://bot.net.ru/. Есть вопросы или предложения? Заходите
в форум на сайте.
Примечание к переводу:
1. Функции со словами EXEMPT/INVITE/JUPED не применяют в обычных ИРЦ
сетях (например UNDERNET), поэтому назначение их мне не известно,
перевода нет. Эти функции требует от IRC сервера особых флагов
+e и +I, чего в большинстве сетей нет. Все остальные функции
переведены.
2. Хоть это и не описано, но большинство функций генерируют TCL ошибку,
если попытаться произвести операцию с несозданным каналом или
несуществующим пользователем. Не забывайте проверять наличие канала
функцией validchan и существование юзера -
validuser
3. Это не сухое/краткое/непонятное изложении теории. Я стараюсь по
дороге объяснять многие сопутствующие вещи, так что это не формальный
перевод документации, а статья об использовании всех функциий бота
и недокументированных особенностей, которые мне самому приходилось
открывать, чтобы добиться работоспособности программ. Существует
великое множество ограничений и тонкостей в привлекательном
на первый вид TCL в ботах EggDrop.
4. Существует русский перевод документации самого TCL. Если у вас
тоже проблемы с английским, то изучить сам TCL без русского мана
будет весьма трудно... Ссылка на русский ман TCL см. на
http://bot.net.ru/bot.php
5. Данный файл криво выглядит из Оперы. Если у вас Опера - просто
сохраните на диск и переименуйте в ".txt". В NN или IE никаких проблем.
*************************************************************************
/ Краткое содержание вступления: /
Здесь находится полный список всех TCL команд, добавленных в eggdrop.
Важно: этот список корректно работает только на ботах версии 1.5 и
выше! Скрипты написанные для ботов 1.3/1.4 должны быть немного
изменены, чтобы быть работоспособными на новых ботах.
СКРИПТЫ НАПИСАННЫЕ ДЛЯ БОТОВ ВЕРСИЙ 0.9, 1.0 ИЛИ 1.1 НЕ БУДУТ РАБОТАТЬ
БЕЗ СУЩЕСТВЕННЫХ ИЗМЕНЕНИЙ.
#########################################################################
#########################################################################
### ###
### Функции для отправки серверу или в логи команд/сообщений ###
### ###
#########################################################################
#########################################################################
putserv [options]
sends text to the server, like 'dump' (intended for direct server
commands); output is queued so that you won't flood yourself off
the server
options are:
-next push messages to the front of the queue
returns: nothing
Послать текст серверу. Сообщение откладывается в очередь,
т.к. вы не должны (случайно/нарочно) зафлудить сервер
(если бы не было очереди, бота бы постоянно отключало с сообщением
Excess flood). Если на очереди более одного сообщения (скажем, 10),
то бот сначала отсылает первых 3 сообщения с паузой 0.5 сек,
далее по сообщению через каждые 1.9 секунд. Эта и следующие
очереди имеют размер примерно в 2-5 тысяч сообщений.
*опции:
-next поместить сообщение в начало очереди
*везврат: ничего
puthelp [options]
sends text to the server like 'putserv', but uses a different queue
(intended for sending messages to channels or people)
options are:
-next push messages to the front of the queue
returns: nothing
послать текст серверу, подобно функции putserv, но используюя другую
очередь (предполагается для отправки сообщений в канала или человеку,
т.е. для какой-то не важной информации). Приоритет у функции ниже, чем
у putserv, а сами собщения из очереди отсылаются не чаще одного
раза в 2.0 секунды.
*опции и возврат: см. putserv
putquick [options]
sends text to the server, like 'dump' (intended for direct server
commands); output is queued so that you won't flood yourself off
the server, using the MODE queue (should be alot faster)
options are:
-next push messages to the front of the queue
returns: nothing
послать текст серверу (предполагается для прямых серверных команд);
вывод откладывается в очередь "MODE". Приоретет у этой функции
выше, чем у putserv. Если в очереди более одного сообщения, то бот
отсылает мгновенно первых 4 (с мизерной паузой в 0.1 сек), затем с
частотой, не быстрее одного сообщения в 1.9 секунды, рассылает остаток.
Как видно из трех функций для отправки текста из бота в IRC ваша
программа не сможет никакими способами зафлудить сервер. Однако во время
лага с сервером явление "Excess flood" возможно (и изредка наблюдается).
*опции и возврат: см. putserv
putkick [reason]
sends kicks to the server and tries to put as many nicks into
one kick command as possible.
returns: nothing
послать серверу команды для киков нескольких ников
putlog
sends text to the log for any channel, marked as 'misc' (o)
returns: nothing
записать в лог текст, который классифицируется как 'misc' ("o" - флаг
для отлавливания таких сообщений)
putcmdlog
sends text to the log for any channel, marked as 'command' (c)
returns: nothing
послать текст в лог, маркируемый флагом 'c' (используется для лога
выполнения команд)
putxferlog
sends text to the log for any channel, marked as 'file-area' (x)
returns: nothing
послать текст в лог, маркируемый флагом 'x' (используется для лога
выполнения команд в файловой области бота)
putloglev
sends text to the log, tagged with all of the valid levels given (use
"*" to indicate all log levels)
returns: nothing
послать текст во все логи (которые кто-то ловит) используя первый
параметр как набор флагов. "*" замещает любой флаг (текст отразиться
во всех логах). "Ловить логи" могуть только 2 объекта: боты, которые
выполняют инструкцию от команды logfile и складывают все в соотв. файлы,
и люди, которые с помощью ".console ххх" в боте настроили себе прием
логов определенного типа - комбинации из флагов и названии канала
(либо "*" - чтобы принять все).
dumpfile
dumps out a file from the help/text directory to a user on IRC via
msg (one line per msg); the user has no flags, so the
flag bindings wont work within the file.
послать содержимое файла из каталога help/text человеку, используя
/msg $nick ... (одна строка - одно /msg сообщение)
queuesize [queue]
returns: the number of msgs in all queues. If a queue is specified, only
the size of this queue is returned. valid queues are: mode, server,
help.
вернет кол-во сообщений в очереди. Если очередь особая, то вернет ее
размер. Очереди бывают: mode, server, help (см. соотв. putquick/pushmode,
putserv, puthelp). Возьмите себе за правило, не выполнять какие-то
общедоступные команды типа !ping или !seen, если очередь сообщений
больше определенного размера (скажем, в 5 накопившихся и еще
неотправленных сообщений).
clearqueue
returns: number of deleted lines from the specified queue
очистить очередь по кодовому имени (mode/serv/help), вернет кол-во
удаленных строк. Это не документировано, но при использовании
'clearqueue all' очищаются сразу все очереди.
#########################################################################
#########################################################################
### ###
### Функции для работы с базой пользователей ###
### ###
#########################################################################
#########################################################################
countusers
returns: number of users in the bot's database
вернет кол-во юзеров в базе
validuser
returns: "1" if a user by that name exists; '0' otherwise
вернет 1, если ханд (юзер) существует, иначе 0
finduser
finds the user record which most closely matches the given user@host
returns: the handle found, or "*" if none
вернет первую найденный ханд по маске и "*" в противном случае
userlist [flags]
returns: a list of the handles of users on the bot
you can use the new flag matching system here,
usage: [global]{&/|}[chan]{&/|}[bot]
matchs the flags relvantly, (chan matches vs anywhere), & specifies
and when match, | specifies or, only the first of these is relevant
the default is or.
вернет список хандов, флаги которых удовлетворяют маске. Правила
использования комбинации флагов см. в ФАКе. Например, флаг
"o|" - глобал опы/мастера/вледельцы, "|m-n" - мастеры каких-то
каналов, "|mf" - люди с флагом "m" или "f" (операция ИЛИ),
"&mf" - люди с флагами и "m" и "f" (операция И).
passwdok
checks the password given against the user's password
check against the password "" (a blank string) or "-" to find out
if a user has no password set.
returns: "1" if password matches for that user; "0" if not
проверит, что у ханда верный пароль (получить пароль юзера нельзя,
только можно сверить его с чем-нибудь) и вренет 1, иначе 0
getuser [extra info]
this is a generic interface to the new generic userfile support, it
return info specific to each entry-type, valid entry types are:
BOTFL - returns the current bot-specific flags for the user
(if it's a bot :)
BOTADDR - (another bot-only thing :) returns a list containing
the bots address, the bots telnet port, and it's relay port.
HOSTS - returns a list of the host for the user
LASTON - returns a list containing the unixtime last seen,
and the last seen place.
OR LASTON #channel returns the time last seen on
the channel or 0 if no info
INFO - returns the user's global info line
XTRA - returns the old xtra info
COMMENT - returns the master-visible only comment for the user
EMAIL - returns the users email address
URL - returns the users url address
HANDLE - returns the users handle as it is saved in the userfile
это главная функция по получению информации о ханде
BOTFL - флаги бота (ханд должен быть ботом)
У ботов присутствуют и обычные флаги, что и у юзеров.
BOTADDR - вернет адрес бота, его телнет и бот порты (см.
".help +bot" для подробностей)
HOSTS - вернет список хостов
LASTON - вернет 0, если бот никогда юзера не видел, либо список
из времени(unixtime) и места. Место - название канала
или partyline.
INFO - вернет глобал инфо-строку
XTRA - вернет дополнительный параметр (getuser XTRA <имя>,
см. описание ниже)
COMMENT - вернет комментации, которые видны по .whois только мастерам
Информацию в поле записывает сам бот, если кому-то мстит
из-за опций защиты себя(бота) или друзей
EMAIL - вернет поле е-мейла
URL - вернет поле УРЛ
HANDLE - вернет имя, под которым юзер записан в базе
setuser [extra info]
this is the counterpart of getuser, it lets you set the various values
extra ones not supported about :
PASS - use this to set a users password (no 3rd arg will clear it)
HOSTS - for setting hosts, no extra info = clear, otherwise
*1* hostmask is added :P
LASTON - 2 forms:
setuser laston
sets global laston time
setuser laston
sets global laston time, leaving the place field empty
setuser laston
will set a users laston time in a channel record
(if it already exists)
установка информации о пользователе, аналогичная фунция
PASS - установить пароль. Физически пароль шифруется и заисывается
в юзер лист. Шифровка гарантирует, что без полного перебора
разных паролей угадать оригинальный пароль невозможно,
см. описание функций encpass и md5.
HOSTS - если 3й параметр не задан - очистить список хостов
если задан, то он является хостом, который добавится к
списку хостов юзера (setuser HOSTS <новый хост>)
существует возможность писать что-угодно (value) под любым
имем (name) в специальные поля:
setuser XTRA
Это не документировано, но максимальная длина 'name'+'value' где-то
в районе не менее 500 символов. Часто бывают ошибки, когда программа
пишет очень длинные строки, которые бот обрезает при записи. Данный
способ очень удобен, чтобы хранить вечные переменные, да еще и
привязанные к каким-то пользователям. Если установить "", переменная
стирается. Чтобы хранить большие переменные (также вечно) и не
волноваться о их длине см. http://bot.net.ru/tcl-rus.php
Чтобы читать такую переменную используйте getuser XTRA ,
описана выше.
setuser botattr address [botport] [userport]
Недокументированные возможности setuser: эта функция может изменить
не только PASS, HOSTS и LASTON, а так же и другие поля (см. getuser).
Изменить адрес (+порт) уже у существующего бота может только эта
функция. Можно, конечно, удалить бот и сразу создать, но иногда
удалять невозможно, т.к. можно потерять какую-либо информацию
(аксесс бота на каналах). Из чата бота изменить адрес легко (комнда
.chaddr). Собственно в поисках измения адреса бота без удаления и открыта
данная возможность.
| chhandle
| changes a user's handle
| returns: "1" on success; "0" if the handle is already used, the handle
| is invalid, or the user can't be found
переименовать юзера. Вернет 1 в лучае успеха и 0 при неудачи (попытка
изменить свое имя на уже существующего юзера или др. ошибки)
chattr [changes [channel]]
changes the attributes for a user record, if you include any -- changes
are of the form "+f", "-o", "+dk", "-o+d", etc; if a channel is
specified, the channel-specific flags for that channel are altered
you can now use the +o|-o #channel format here too.
returns: new flags for the user (if you made no changes, returns current
flags); if a channel was specified, the global AND the channel-specific
flags for that channel are returned in the format of the new flagging
system (globalflags|channelflags) -- returns "*" if that user does not
exist
устновить флаги для пользователя, либо глобальные (канал не нужно писать),
либо на канале (3 параметра). Понимает комбинации флагов. Чтобы не
перепутать локальные и глобальные флаг, всегда у локальных прав
ставьте черту: chattr |+o <#channel> (иначе будет глобал-флаг!)
*везврат: если указать флаги, вернет новое состояние
флагов (глобальных или локальных), если не указать никаких флагов,
например chattr |- <#chan>, то вернет текущи флаги, ничего не
меняя.
botattr [changes [channel]]
similar to chattr except for bot attributes rather than normal user
attributes, this includes the channel-specific +s share flag
тоже, но для бота (у ботов совершенно другой набор глобальных флагов
и флагов канала)
matchattr [channel]
returns: "1" if the specified user has the matching flags.
(using the new matching system)
главная функция по проверке доступа юзера (глабально или в канале)
Правила комбинирования флагов см. в chattr & userlist.
adduser
creates a new user entry with the handle and hostmask given (with no pass-
word, and the default flags)
returns: "1" if successful, "0" if it already existed
добавить юзера, хостмаска параметр не обязательных (хоть в документации
написано обязательно). Новый юзер не имеет ни пароля, ни хостов, ни флагов
(вернее, устанавливаются флаги по умолчанию - см.eggdrop.conf)
*возврат: 1 в случае успеха, 0 - если юзер уже существует
addbot
creates a new bot entry with the handle and bot linking address given
(with no password and no flags)
returns: "1" if successful, "0" if it already existed
аналогична команде adduser, за исключением формата address. Его формат
см. ".help +bot". Пример: "addbot ИмяБота {АдресБота БотПорт ЮзерПорт}"
*возврат: 1 в случае успеха, 0 - если бот уже существует
deluser
attempts to erase a user record with that handle
returns: "1" if successful, "0" if no such user exists
удалить юзера или бота (без разницы)
*возврат: 1 в случае успеха, 0 - если юзера несуществует
delhost
deletes a hostmask from a user's hostmask list
returns: "1" on success, "0" if that hostmask wasn't in the list or the
user does not exist
удалить хост из списка хостов у юзера. Используйте
"setuser HOSTS" для удаления всех хостов сразу.
*возврат: 1 в случае успеха, 0 - если хоста такого несуществовало
addchanrec
add a channel record for the user
returns: "1" on success, "0" if the user does not exist or if there
isn't such a channel
добавить запись о канале, где храняться права и инфо-строка для канала.
Создается автоматически, если добавить на какой либо канал права юзеру.
delchanrec
removes a channel record for the user; this includes all associated
channel flags
returns: "1" on success, "0" if the user does not exist or if there
isn't such a channel
удалить запись о канале с правами и инфо строкой
getchaninfo
returns: info line for a specific channel (behaves just like 'getinfo')
получить инфо-строку у юзера для канала
setchaninfo
sets the info line on a specific channel for a user
if info is "none" it will be removed.
returns: nothing
установить юзеру инфо-строку для конкретного канала. Будьте
осторожны, строка весьма короткая. Чтобы установить
глобал-инфо-строку: setuser INFO . ГлобалИнфо
показывают при входе в чат бота ("[$nick] ..info.." идет в партилайн)
newchanban [lifetime] [options]
adds a ban to the enforced ban list of a channel; creator is given
credit for the ban in the ban list; lifetime is specified in
minutes; if lifetime is not specified, ban-time (usually 60) is
used; setting the lifetime to 0 makes it a permanent ban; valid
options are:
sticky forces the ban to be always active on a channel, even
with dynamic bans on
none (no effect)
returns: nothing
создать новый бан на канале.
ban - хост маска для бана,
creator - кто установил бан,
comment - комментарий (возможно, его используют при кике),
lifetime- время жизни бана в минутах, если не задано то время
по умолчанию (eggdrop.conf). Если время рано 0, то
это вечный бан
опции:
sticky - бот будет держать бан постоянно активным. Если кто-то
(кроме мастера канала) попытается снять бан, бот его
переустановит. Помните о лимите банов в одном канале
Если сделать деоп+оп боту, бот выставит все баны повторно
(т.е. будет следить за активностью бана).
none - по умолчанию, бан не будет активным, а только
при необходимости, когда кого-то надо выкинуть.
Время, через которое бан будет снят (не из памяти, а с
канала) устаналивается в eggdrop.conf, по умолчанию -
2 часа.
newban [lifetime] [options]
adds a ban to the global ban list (which takes effect on all channels);
other arguments work exactly like newchanban
returns: nothing
добавить глабал бан (как будто бы вы создали локальные баны на всех
каналах сразу). Формат см. выше.
newchanexempt [lifetime] [options]
adds a exempt to the enforced exempt list of a channel; creator is
given credit for the exempt in the exempt list; lifetime is specified
in minutes; if lifetime is not specified, exempt-time (usually 60) is
used; setting the lifetime to 0 makes it a permanent exempt; valid
options are:
sticky forces the exempt to be always active on a channel, even
with dynamicexempts on
none (no effect)
returns: nothing
N.B. The exempt will not be removed until the corresponding ban has been
removed. For timed bans once the time period has expired the exempt will
not be removed until the corresponding ban has either expired or removed
newexempt [lifetime] [options]
adds a exempt to the global exempt list (which takes effect on all
channels); other arguments work exactly like newchanexempt
returns: nothing
newchaninvite [lifetime] [options]
adds a invite to the enforced invite list of a channel; creator is
given credit for the invite in the invite list; lifetime is specified
in minutes; if lifetime is not specified, invite-time (usually 60) is
used; setting the lifetime to 0 makes it a permanent invite; valid
options are:
sticky forces the invite to be always active on a channel, even
with dynamicinvites on
none (no effect)
returns: nothing
N.B. The invite will not be removed until the channel has gone -i.
newinvite [lifetime] [options]
adds a invite to the global invite list (which takes effect on all
channels); other arguments work exactly like newchaninvite
returns: nothing
stick [channel]
makes a ban sticky, or if a channel is specified, then it is set sticky
on that channel. returns: "1" is successful, "0" otherwise
unstick [channel]
makes a ban no longer sticky, or if a channel is specified, then it is
unstuck on that channel. returns: "1" is successful, "0" otherwise
| stickexempt [channel]
| makes an exempt sticky, or if a channel is specified, then it is set
| sticky on that channel. returns: "1" is successful, "0" otherwise
| unstickexempt [channel]
| makes an exempt no longer sticky, or if a channel is specified, then it
| is unstuck on that channel. returns: "1" is successful, "0" otherwise
| stickinvite [channel]
| makes an invite sticky, or if a channel is specified, then it is set
| sticky on that channel. returns: "1" is successful, "0" otherwise
| unstickinvite [channel]
| makes an invite no longer sticky, or if a channel is specified, then it
| is unstuck on that channel. returns: "1" is successful, "0" otherwise
killchanban
removes a ban from the enforced ban list for a channel
returns: "1" if successful, "0" otherwise
удалить бан канала по его номеру (все баны нумеруются автоматически),
либо по самой маске. Бан при удалении снимается с канала (если он там был).
Невозможно поставить бан на существующую маску (например, с целью
добавить времени), не сняв его предварительно. При операции удаления
бана этой функции и мгновенной установки того же бана, в канале
наблюдается побочный эффект (бот снимает бан).
killban
removes a ban from the global ban list
returns: "1" if successful, "0" otherwise
удалить глобальный бан по номеру или маске
killchanexempt
removes a exempt from the enforced exempt list for a channel
returns: "1" if successful, "0" otherwise
killexempt
removes a exempt from the global exempt list
returns: "1" if successful, "0" otherwise
killchaninvite
removes a invite from the enforced invite list for a channel
returns: "1" if successful, "0" otherwise
killinvite
removes a invite from the global invite list
returns: "1" if successful, "0" otherwise
ischanjuped [channel]
returns: "1" if the channel is juped and bot is unable to join, "0"
otherwise
isban [channel]
returns: "1" if that ban is in the global ban list, "0" otherwise; if
a channel is specified, that channel's ban list is checked too
установлен ли бан (маска) как глобальный или в канале (не в реальном
ИРЦ-канале, а в памяти бота для банов)
ispermban [channel]
returns: "1" if that ban is in the global ban list AND is marked as
permanent, "0" otherwise; if a channel is specified, that channel's
ban list is checked too
тоже, что и isban, с условием: является ли бан вечным
см. newchanban
isexempt [channel]
returns: "1" if that exempt is in the global exempt list, "0" otherwise; if
a channel is specified, that channel's exempt list is checked too
ispermexempt [channel]
returns: "1" if that exempt is in the global exempt list AND is marked as
permanent, "0" otherwise; if a channel is specified, that channel's
exempt list is checked too
isinvite [channel]
returns: "1" if that invite is in the global invite list, "0" otherwise; if
a channel is specified, that channel's invite list is checked too
isperminvite [channel]
returns: "1" if that invite is in the global invite list AND is marked as
permanent, "0" otherwise; if a channel is specified, that channel's
invite list is checked too
isbansticky [channel]
returns: "1" if that ban is a sticky ban in the global ban list, "0"
otherwise; if a channel is specified, that channel's ban list is checked
too
тоже, что и isban, с условием: является ли бан постоянным
см. newchanban
isexemptsticky [channel]
returns: "1" if that exempt is a sticky exempt in the global exempt list,
"0" otherwise; if a channel is specified, that channel's exempt list is
checked too
isinvitesticky [channel]
returns: "1" if that invite is a sticky invite in the global invite list,
"0" otherwise; if a channel is specified, that channel's invite list is
checked too
matchban [channel]
returns: "1" if that user address matches a ban in the global ban list,
"0" otherwise; if a channel is specified, that channel's ban list is
checked too
проверить, попадает ли юзер с хостмаской под глобальный бан или бан
в канале
matchexempt [channel]
returns: "1" if that user address matches a exempt in the global exempt
list, "0" otherwise; if a channel is specified, that channel's exempt
list is checked too
matchinvite [channel]
returns: "1" if that user address matches a invite in the global invite
list, "0" otherwise; if a channel is specified, that channel's invite
list is checked too
banlist [channel]
returns: list of global bans, or (if a channel is specified) list of
channel-specific bans; each entry is itself a list, containing:
hostmask, comment, expiration timestamp, time added, last time
active, and creator (the three timestamps are in unixtime format)
вернет глобальный список банов или баны канала (не реальных ИРЦ каналов,
а из памяти бота)
exemptlist [channel]
returns: list of global exempts, or (if a channel is specified) list of
channel-specific exempts; each entry is itself a list, containing:
hostmask, comment, expiration timestamp, time added, last time
active, and creator (the three timestamps are in unixtime format)
invitelist [channel]
returns: list of global invites, or (if a channel is specified) list of
channel-specific invites; each entry is itself a list, containing:
hostmask, comment, expiration timestamp, time added, last time
active, and creator (the three timestamps are in unixtime format)
newignore [lifetime]
adds an entry to the ignore list; creator is given credit for the
ignore; lifetime is how many minutes until the ignore expires and
is removed; if lifetime is not specified, ignore-time (usually 60)
is used; setting the lifetime to 0 makes it a permanent ignore
returns: nothing
добавить хостмаску для игнора. Люди с такими масками будут игнорироваться
ботом при отправке /msg и публичных команд, ctcp, etc.
creator - кто добавил
comment - комментарий
lifetime - время в минутах или 0 - для вечного игнора
см. ".+ignore"
Если вы хотите вставить защиту от множества флуд ботов (с небольшим
числом флуд ботов ваш бот сам справиться), то на странице
http://bot.net.ru/irc.php описаны 2 типа игноров: всего текста
со всех каналов и всех сообщений (/msg bot). Дело в том, что на
IRC под каждого юзера (бота/человека) заведен буфер входных сообщений,
примерно в 64Кбайта. Если на канал входит сотня флуд-ботов и каждый в
бесконечном цикле шлет в канал сообщение (максимум 510 букв), то
данный буфер быстро переполняется и бота отключают от IRC с сообщением
"Send maxQ". Ботам на крутых выделенных линях это не грозит, т.к.
как бы быстро не наполнялся бы буфер, по хорошей линии все сообщения
еще быстрее уйдут к боту и переполнения не будет. Хотя если командой
"/stats k" запросить от сервер список активных серверных банов (K-LINES),
то сам сервер поместит в буфер очень много информации, заметит переполнение
и тут же отключит. Более подробно - по указанному адресу.
killignore
removes an entry from the ignore list
returns: "1" if successful, "0" otherwise
удалить хостмаску из игнор-листа
см. ".-ignore"
ignorelist
returns: list of ignores; each entry is itself a list, containing:
hostmask, comment, expiration timestamp, time added, and creator
(the three timestamps are in unixtime format)
получить игнор-лист хостмасок
см. ".ignore"
isignore
returns: "1" if the ignore is in the list, "0" otherwise
проверить, ялвяется ли хостмаска элементом списка игнор-листа
save
writes the userfile to disk
returns: nothing
сохранить базу юзеров и список каналов с настройками в файлы на диске.
Это происходит автоматически, раз в 10 минут.
см. ".save"
reload
loads the userfile from disk (replacing whatever's in memory)
returns: nothing
уничтожить базу юзеров и списки каналов и загрузить их из созранных
ранее файлов
см. ".reload" - это своеобразный откат базы данных. Можно что-либо
сделать и откатить изменения.
backup
makes a simple backup of the userfile that's on disk
returns: nothing
записать базу юзеров в файл "~bak" (сделать копию базы
в запасном файле)
getting-users
returns: "1" if the bot is currently downloading a userfile from
a sharebot (and hence, user records are about to drastically
change), "0" if not
вернет 1, если в данный момент проиходит загрузка юзерлиста
с расшаренного мастер-бота (если вы не в курсе про это - то
вам это и не надо)
#########################################################################
#########################################################################
### ###
### Функции для управления каналами ###
### ###
#########################################################################
#########################################################################
channel add
adds a channel record for the bot to monitor; the full list of possible
options is given in the "eggdrop.complete.conf" sample config file; note
that the channel options must be in a list (enclosed in {})
returns: nothing
добавить канала. Чтобы ознакомиться с форматом параметров (это
необязательый параметр), см. примеры в eggdrop.conf. Так же, как и в
eggdrop.conf, перечисляйте параметры через пробел или \n, заключив
все в кавычки или фигурные скобки. Описание параметров канала
на русском языке: http://bot.net.ru/flags.html
Примеры:
channel all #PHPclub
channel all #PHPclub +inactive - создать канал, но не позволить
боту туда сразу же войти
channel set
sets options for the channel specified; the full list of possible
options is given in the "eggdrop.conf" sample config file
returns: nothing
тоже, что и 'channel add', но уже для существующего канала
channel info
returns: list of info about that channel record: enforced mode, idle
kick limit, need-op script, need-invite script, and then various
+/- options as seen in the config file
получить параметры канала, см. 'channel add'
channel remove
destroys a channel record for the bot and makes the bot no longer
monitor that channel
returns: nothing
удалить канал
savechannels
saves the channel settings to the channel-file if one is defined.
returns: nothing
сохранить базу каналов в файл каналов, см. 'save'
loadchannels
reloads the channel settings from the channel-file if one is defined.
returns: nothing
загрузить базу каналов из файл каналов, см. 'load'
channels
returns: list of the channels the bot is monitoring (or trying to)
вернуть список каналов, которые мониторит бот (но не обязательно, что
бот сидит на канале)
| channame2dname
| chandname2name
| These two functions are important to correctly support !channels. The
| bot differentiates between channel description names (chan dnames) and
| real channel names (chan names). The chan dnames are what you would
| normally call the channel, e.g. `!channel'. The chan names are what
| the IRC server uses to identify the channel, they consist of the chan
| dname prefixed with an ID, e.g. `!ABCDEchannel'.
|
| For bot functions like isop, isvoice, etc. you need to know the chan
| dnames. If you communicate with the server, you usually get the chan
| name though. That's what you need the channame2dname function for.
|
| If you only have the chan dname and want to directly send raw server
| commands, you need the chan name. Use the chandname2name function for
| that case.
|
| NOTE: For non-!channels, chan dname and chan name are the same.
isbotnick
returns: "1" if the nick matches the botnick; "0" otherwise
вернет 1, если ник совпадает с ником бота (его самого)
Примеры:
имя бота TAHK, но в канале ASD: isbotnick TAHK -> 0
isbotnick ASD -> 1
имя бота TAHK и в канале TAHK: isbotnick TAHK -> 1
isbotnick ASD -> 0
botisop
returns: "1" if the bot is an op on that channel; "0" otherwise
вернет 1, если бот в накале и имеет там оп
botisvoice
returns: "1" if the bot is has a voice on that channel; "0" otherwise
вернет 1, если бот в канале и с "голосом"
botonchan
returns: "1" if the bot is on that channel; "0" otherwise
вернет 1, если бот находится на канале
isop
returns: "1" if someone by that nickname is on the channel and has chop;
"0" otherwise
вернет 1, если ник в канале и имеет оп
| wasop
| returns: "1" if someone that just got opped/deopped in the chan had op
| before the modechange; "0" otherwise
isvoice
returns: "1" if someone by that nickname is on the channel and has voice
(+v); "0" otherwise
аналогично isop
onchan
returns: "1" if someone by that nickname is on the bot's channel; "0"
otherwise
вернет 1, если ник в канале
nick2hand [channel]
returns: handle of on
if is not specified, bot will check all of its channels
if not found, returns ""
if found but unknown, returns "*"
вернет ханд по нику. Параметр #chan необязательный.
Если ник вообще не найден, вернет пустую строку "". Если ник
найден, но не соответствует ни одному ханду - "*".
handonchan
returns: "1" if the the user@host for someone on the channel matches
for the handle given; "0" otherwise
вернет 1, если кто-то на канале подходит под ханд, сравнивая
всех по user@host.
hand2nick [channel]
returns: nickname of the first person on the whose user@host
matches that handle, if there is one; "" otherwise
if is not specified, bot will check all of its channels
вернет ник по ханду. Параметр #chan необязательный. Если никто не
найден, вернет "". Поиск осуществляется по user@host.
ischanban
returns: "1" if that is a ban on the bot's channel
вернет 1, если на канале (ИРЦ канале, а не в памяти бота) установлен
бан (требуется точное совпадение)
ischanexempt
returns: "1" if that is an exemption (+e mode) on the bot's channel.
this is only useful on networks that support +e
ischaninvite
returns: "1" if that is an invitation (+I mode) on the bot's channel.
this is only useful on networks that support +I
chanbans
returns: a list of the current bans on the channel, each element is
of the form {ban bywho age} age is seconds from the bots POV
вернет список банов канала. Каждый элемент списка - это список из
3х элемнтов: {бан кто_поставил время}, время в секундах. Важно: это
не время unixtime, а кол-во секунд назад, когда был поставлен бан.
chanexempts
returns: a list of the current exemptions (+e mode) on the channel,
each element is of the form {exemption bywho age} age is seconds
from the bots POV. this is only useful on networks that support +e
chaninvites
returns: a list of the current invitations (+I modes) on the channel,
each element is of the form {invitation bywho age} age is seconds
from the bots POV. this is only useful on networks that support +I
resetbans
removes all bans on the channel that aren't in the bot's ban list, and
refreshes any bans that should be on the channel but aren't
returns: nothing
снять на калале все баны, которые не являются банами самого бота. Т.е.
те баны, что установили бругие боты или люди будут сняты. Список
банов бота не меняется.
resetexempts
removes all exemptions on the channel. this is an IRCNET feature.
resetinvites
removes all invitations on the channel. this is an IRCNET feature.
resetchan
rereads in the channel info from the server
returns: nothing
записать для канала настройки по умолчанию, из eggdrop.conf, см.
'channel add'
getchanhost [channel]
returns: user@host of
if is not specified, bot will check all of its channels
if is not on the channel(s), returns ""
вернет user@host по нику, если канал не указан - поиск ника на всех
каналах, если указан - только на указанном. Если ник не найден,
вернет "".
getchanjoin
returns: timestamp of when that person joined the channel
вернет время (unixtime) входа ника в канал. Если юзера там вообще нет,
вернет TCL ошибку.
onchansplit
returns: "1" if that nick is split from the channel; "0" otherwise
вернет 1, если ник покинул данный канал из-за сплита (о том, что
человек ушел по сплиту сообщает сервер)
chanlist [flags[&chanflags]]
flags are any flags that are global flags, the '&' denotes to look for
channel specific flags. Examples:
n (Botowner)
&n (Channel owner)
o&m (Global op, Channel master)
now you can use even more complex matching of flags, including +&- flags
and & or | (and or or) matching
returns: list of nicknames currently on the bot's channel that have all
of the flags specified; if no flags are given, all of the nicknames
are returned
Please note, that if you're executing chanlist after a part or sign bind,
the gone user will still be listed so you can check for wasop, isop, etc.
получить список людей канала, возможно отфильтровав по общему правилу
задания флагов
getchanidle
returns: number of minutes that person has been idle; "0" if the speci-
fied user isn't even on the channel
получить время неактивности (ничего не сказал) человека в канале.
getchanmode
returns: string of the type "+ntik key" for the channel specified
получить текущие флаги канала в виде стандартной строки (там
может быть ключ и лимит). Примеры: "+" (пусто), "+n", "+ntm", "+ntk key",
"+l 10", "+ntkl key 10".
jump [server [port [password]]]
jumps to the server specified, or (if none is specified) the next server
in the list
returns: nothing
переконнектиться к другому ИРЦ серверу. Если сервер не указан, то
выбрать следующий из списка серверов (eggdrop.conf)
pushmode [arg]
sends out a channel mode change (ex: pushmode #lame +o goober) through
the bot's queueing system; all the mode changes will be sent out at
once (combined into one line as much as possible) after the script
finishes, or when 'flushmode' is called
послать серверу команду изменения mode, это удобнее, чем использоваться
putserv "MODE $chan : ....". Используется системная очередь сообщений
(mode). Это значит, что если боту позволено комбинировать mode команды,
то бот будет преобразовывать команды из очереди к наименьшему
возможному числу команд, для конечной отправки IRC серверу.
Например, если сказать 'pushmode $chan $nick +o' и сразу добавить
флаг '+v' второй командой, то реально получиться только одна
IRC-команда. Если вы попробуете забанить и кикнуть человека, то скорее
всего из-за описанных особенностей вам это не получится, вернее
сначала IRC сервер получит от бота КИК, а только потом БАН. Очевидно,
что жертва бота может войти за это время. Чтобы такого не произошло,
не используйте pushmode для установки кик/бана. Это можно сделать так:
putquick "mode $chan -o+b <ник> <маска>", затем кик putquick "kick .."
В остальных случаях (установка опа/других флагов, снятие банов и т.п.)
функцию рекомандуется к применению.
flushmode
forces all previously pushed channel mode changes to go out right now,
instead of when the script is done (just for the channel specified)
немедленно отправить очередь mode-команд, сформированных pushmode,
на сервер. В противном случае бот сделает это не сразу, а когда
сам решит (но "не сразу" - не значит через час :-). На "глазок" бот
ждет после первого вызова pushmode 0.1-0.5 секунд, только потом
комбинирует разные pushmode к наименьшему числу команд.
topic
returns: string of the current topic on the specified channel
получить топик канала
validchan
checks if the bot is monitoring that channel
returns: 1 if the channel exists, 0 if not
проверить, мониторит ли бот канал. Если использовать большинство
функций данного раздела и не проверять на их существование
данной функцией, кроме случаев, когда канал точно существует,
все такие фукции будут возвращать TCL ошибку
isdynamic
returns: 1 if the channel is an existing dynamic channel, 0 if not
вернет 1, если канал является динамическим. Все каналы делят на
динамические и статические. Статические каналы задают в файле
eggdrop.conf и их не нужно удалять командами -chan.
Динамические каналы - это те, которые создаются в процессе
работы бота и храняться в файле. Имеено такие каналы
можно свободно создавать и удалять командами ".+chan" (см.
'channel add').
setudef
Description: initializes a user defined channel flag or integer setting.
You can use it like any other flag/setting. IMPORTANT: Don't forget to
reinitialize your flags/settings after a restart, or it'll be lost.
Returns: nothing
Module: channels
renudef
Description: renames a user defined channel flag or integer setting.
Returns: nothing
Module: channels
deludef
Description: deletes a user defined channel flag or integer setting.
Returns: nothing
Module: channels
#########################################################################
#########################################################################
### ###
### Функции для DCC каналов ###
### ###
#########################################################################
#########################################################################
---------------------------------------------------------------------
Здесь и далее под словами 'idx' / 'DCC' / 'канал' подразумевается
идентификатор DCC-канала. Это похоже на файл или сокет. Каждый
присоединившийся к боту другой бот или юзер занимает по каналу.
Каналы бывают разного типа:
lstn - бот открыл порл для соединения
dns - для DNS модуля
serv - коннект к серверу
bot - коннект к другому боту
chat - коннект к юзеру
и т.д.
Любое соединение (например, к веб-серверу из бота) или с ботами/людьми
является каналом, куда можно писать и иногда читать.
---------------------------------------------------------------------
putdcc
sends text to the dcc user indicated
returns: nothing
послать текст в DCC канал по его номеру
dccbroadcast
sends your message to everyone on the party line on the bot net, in the
form "*** " for local users, and "*** [Bot] " for
users on other bots
послать текст всем людям в партилайне, в т.ч. и на других ботах
(формат сообщения см. выше)
dccputchan
sends your message to everyone on a certain channel on the bot net, in
a form exactly like dccbroadcast does -- valid channels are 0 thru 99999
returns: nothing
послать текст в чат-канал (это не IRC каналы, а типа канала для партилайна)
boot [reason]
boot's a user from the partyline
returns: nothing
попытаться прибить юзера на своем или чужом боте, аналогична команде
'.boot'
restart
rehash's the bot and kills all timers
note that as this will also unload and reload all the modules, your bot
will also jump servers.
returns: nothing
перезапустить бота, стереть всю память и освободить занятые ресурсы
(закрыть файлы, очистить таймеры и прочее) и отключиться от IRC сервера.
При запуске будет загружены все модули и скрипты. Бот не будет
выкидывать людей из DCC-чата и разрывать линки с другими ботами.
rehash
rehash's the bot
returns: nothing
перезапустить скрипты бота. Память не очищается, некоторые ресурсе
освобождаются (файлы закрываются, хотя таймеры не уничтожаются).
dccsimul
simulates text typed in by the dcc user specified -- note that in v0.9,
this only simulated commands; now a command must be preceded by a '.'
to be simulated
returns: nothing
сказать за человека какую-либо фразу. Все будут думать (и сам бот тоже),
что это сказал человек. Например, он мог написать команду.
hand2idx
returns: the idx (a number greater than or equal to zero) for the user
given, if she is on the party line in chat mode (even if she is currently
on a channel or in chat off), the file area, or in the control of a
script; "-1" otherwise -- if the user is on multiple times, the oldest
idx is returned
вернуть по ханду юзера номер его DCC канала. Поиск идет везде:
в обычном партилайне, в чатах (внутри последнего) и в файловой области.
Вернет -1, если человека нет и последний найденный номер (человек
может открыть к боту сразу несколько DCC чатов)
idx2hand
returns: handle of the user with that idx
по номеру DCC канала получить имя юзера
valididx
returns: "1" if the idx currently exists; "0" if not
проверить, существует ли такой канал на боте
getchan
returns: the current party line channel for a user on the party line --
"0" indicates he's on the group party line, "-1" means he has chat off,
and a value from 1 to 99999 is a private channel
setchan
sets a party line user's channel rather suddenly (the party line user
is not notified that she is now on a new channel); a channel name
can be used (provided it exists)
returns: nothing
console [channel] [console-modes]
changes a dcc user's console mode, either to an absolute mode (like "mpj")
or just adding/removing flags (like "+pj" or "-moc" or "+mp-c"); the
user's console channel view can be changed also (as long as the new
channel is defined in the bot)
returns: a list containing the user's (new) channel view, and (new)
console mode, or nothing if that user isn't currently in dcc chat
установить "консоль" в одном из своих каналов. Консоль - это набор
флагов и либо "*", либо указание на канал. Флаги указывают,
какого типа лог-сообщения и с какого канала нужно выдавать в
некий DCC-канал. Таким образом, каждое лог-сообщение имеет 2 признака:
принадлежность к каналу (либо отсутствие таковой) и тип (буква/флаг),
что задает правила рассылки логов. Более подробно - <.help console>
echo [status]
turns a user's echo on or off; the status has to be a 1 or 0
returns: new value of echo for that user (or the current value, if
status was omitted)
вкл/выкл эхо (повторять ли юзеру его собственные сообщения),
см. <.help echo>. Для большинства людей не нужно, т.к. их клиенты итак
отображают сообщения при наборе.
putbot
sends a message across the bot-net to another bot; if no script intercepts
the message on the other end, the message just vanishes
returns: nothing
послать боту сообщение. Общение в ботнете разделено на 2 части:
1. скрытый обмен служебными сообщениями, боты сообщают друг другу
о том, что юзеры что-то говорят, пингуют друг друга, сообщают версии
и т.п.
2. обмен сообщениями, которые создаются в TCL скриптах бота
Таким образом, все, что говорят люди на ботах, преобразуется во
внутреннюю команду и рассылается межлу ботами, а для программирования
существует открытый канал.
Не документировано: максимальная длина сообщения - около 400 символов,
все длиннее будет обрезано.
putallbots
broadcasts a message across the bot-net to all currently connected bots
returns: nothing
тоже самое, для всех ботов
killdcc
kills a party-line or file area connection, rather abruptly
returns: nothing
закрыть DCC канал
bots
returns: list of the bots currently connected to the botnet
вернуть список ботов в ботнете
botlist
returns: a list of bots currently on the botnet; each item in the list
will be a sublist with four elements: bot, uplink, version, sharing
status.
bot : the bot's nickname
uptlink: who the bot is connected through
version: its current numeric version
sharing: a "+" if the bot is sharing, "-" otherwise/
вернуть список о всех ботах ботнета, где каждый элемент это список
из имени бота, имени бота, куда залинкован первый, версии, и
признака расшаривания юзерлиста
islinked
returns: "1" if the bot is currently linked, "0" otherwise
находиться ли бот в ботнете
dccused
returns: number of dcc connections currently in use
количество открытых DCC каналов, см. <.dccstat>
dcclist ?type?
returns: a list of active connections, each item in the list will be a sublist
of six elements:
{ {} }
the types are: chat, bot, files, file_receiving, file_sending,
file_send_pending, script, socket (these are connections that have not
yet been put under 'control'), telnet, and server.
получить список о всех DCC каналов где элементы это список из
1 - номера канала
2 - имя, если такое можно получить (например, у открытого сокета имя
"(users)" или "(bots)", у сервера - (server) и т.д.)
3 - хост, если его можно получить (см. оговорку выше)
4 - тип канала: telnet (открытый сокет), dns, bot, server, chat (юзер)
5 - прочие параметры: у сокетов - порт, у ботов/юзеров - флаги,
у сервера - текущий лаг и т.п. особенности разных типов каналов
6 - время создания
whom
returns: list of people on the botnet who are on that channel (0 is
the default party line); each item in the list will be a sublist
with six elements: nickname, bot, hostname, access flag ('-', '@',
'+', or '*'), minutes idle, and away message (blank if the user is
not away)
if you specify a channel of * every user on the botnet is returned
with an extra argument indicating the channel the user is on
получить список параметров людей в ботнете или чатах. Параметр -
либо номер чата в боте, либо "*" (или "0"), чтобы получить список всех
людей ботнета. Элемент списка это параметры: ханд человека,
бот, на котором тот сидит, хост, доступ ("-" никто, "@" оп,
"+" мастер, "*" владелиц <-- все это либо о каком-то канале, либо
о всем боте), idle (время неактивности) в минутах, away сообщение
(если юзер поставил себе <.away msg>). Если вызвать "whom *", то это
выдаст инфо о всех каналах, в результате еще в самом конце списка будет
число - номер канала. При вызове "whom 0" последнего числа нет. Канал 0 -
это общий канал всего ботнета.
getdccidle
returns: number of seconds the dcc chat/file system/script user has
been idle
получить idle в секундах DCC канала
getdccaway
returns: away message for a dcc chat user (or "" if the user is not
set away)
получить away-сообщение DCC канала (могут поставить только люди
у себя в партилайне) или "" - если нет сообщения
setdccaway
sets a party line user's away message and marks them away; if set to
"", the user is marked un-away
returns: nothing
установить юзеру в DCC канале режим отсутствия away и соотв. сообщение
connect
makes an outgoing connection attempt and creates a dcc entry for it;
a 'control' command should be used immediately after a successful
'connect' so no input is lost
returns: idx of the new connection
установить соедининие с удаленным хостом в инете (хост:порт) и
вернуть номер созданного DCC канала. Управление делится на 2 варианта:
можно что-нибудь написать (putdcc ) и сразу отключиться (например,
вызвав некую www-страницу), либо с помощью команды TCL 'control'
установить функцию, которая будет отвечать за созданное соединнение.
Эту функцию будут вызывать каждый раз, когда удаленный хост будет
слать команды, а функция должна их обрабатывать и реагировать
(слать ответ через putdcc, убить соединение через killdcc и т.п.).
Примеры такого использования: www.bot.net.ru, далее ссылка
'TCL/IRC/BOT-программирование'
listen [options] [flag]
opens a listening port to accept incoming telnets; type must be one of
"bots", "all", "users", "script", or "off":
listen bots [mask]
accepts connections from bots only; the optional mask is used to identify
permitted bot names; if the mask begins with '@' it is interpreted to
be a mask of permitted hosts to accept connections from
returns: port #
listen users [mask]
accepts connections from users only (no bots); the optional mask is used
to identify permitted nicknames; if the mask begins with '@' it is
interpreted to be a mask of permitted hosts to accept connections from
returns: port #
listen all [mask]
accepts connections from anyone; the optional mask is used to identify
permitted nicknames/botnames; if the mask begins with '@' it is
interpreted to be a mask of permitted hosts to accept connections from
returns: port #
listen script [flag]
accepts connections which are immediately routed to a proc; the proc
is called with one parameter: the idx of the new connection
flag may currently only be 'pub', which makes the bot allow anyone to
connect.
returns: port #
listen off
stop listening at a port
returns: nothing
dccdumpfile
dumps out a file from the text directory to a dcc chat user;
the flag matching that's used everywhere else works here too
#########################################################################
#########################################################################
### ###
### Прочие функции ###
### ###
#########################################################################
#########################################################################
bind [proc-name]
adds a new keyword command to the bot; valid types are listed below; the
are the flags that a user must have to trigger this command;
the for each type is listed below; is the
name of the Tcl procedure to call for this command (see below for the
format of the procedure call); if the proc-name is omitted, no binding
is added -- instead, the current binding is returned (if it's stackable,
a list of the current bindings is returned)
yes, you can use the new flag binding method here too, and this is
where it becomes truely phearfull since you may never need to check
attr's inside functions again...imagine:
bind pub -o&+o command command_proc
to only allow channel-spec ops to use it! no problem! works fine!
returns: name of the command that was added, or (if proc-name was omitted),
a list of the current bindings for this command
добавить функцию, которая будет вызываться при некоторых условиях.
Другими словами, заставить бота реагировать на некие события. Это
весьма сложная для описания фукнция, зато понять ее легко.
У каждого сообщения есть тип, например: DCC - команда в DCC чате,
PUB - фраза на каком-то канале, KICK - соотв. событие в канале,
BOT - получение команды от другого бота, TIME - настроить вызов
функции в определенное время (например по четвергам в 23:59 или каждые
2 минуты) - похоже на крон в Юникс компьютерах и т.п... Список всех типов
приведен ниже в этом разделе (рекомендуется с ним ознакомиться, очень
интересно). У большого числа событий причина - это действие пользователя
в канале/сообщении/чате (некоторые собития не имеют такого признака,
например событие наступающего 'die'). Если причиной события является
человек (бот), то с помощью набор флагов глобального и локального
(в канале) уровня можно ограничить доступ к ней. Проверка принадлежности
идет по простому сравнению хоста человека с юзерлистом бота.
Затем, так же у большого числа событий бывает некая текстовая часть.
Например, в чате - начало сообщения. Такую часть (это первое слово
всего сообщения) называют командой и ее можно использовать, чтобы поставить
событие только для нужной команды. Последни параметр - имя функции,
которая будет вызвана для обработи события. Формат функций
(кол-во и назначение аргументов) отличается и описан в этой главе ниже.
На одно и тоже событие может быть повешано много функций-обработчиков,
они будут вызваны все по очереди. Очередность должен задать программист,
в зависимости от требуемого порядка.
unbind
removes a previously-made binding
returns: name of the command that was removed
удалаить созданное ранее событие, нужно перечислить теже самые
параметры, чтобы указать на нужное событие: тип, флаги, команду и
имя функции-обработчика
| binds ?type/mask?
| returns: a list of tcl binds, each item in the list will be a sublist of
| five elements:
| {