| Add
Topic Reply |
[1] |
| Adds a topic and corresponding reply to
Darkbot's database. |
| Command |
ADD | REMEMBER | SAVE | STORE |
|
|
|
|
|
Syntax |
<DB> ADD <topic> <reply> |
|
|
Example |
<BotUser>:
DB add test This is a simple topic and reply
<DB>: Okay
<BotUser>: DB, test
<DB>: BotUser, This is a simple topic
and reply |
|
|
|
|
|
|
uses
'+' as words separator |
|
|
Syntax |
<DB>
ADD <topic+topic> <reply> |
|
|
Example |
<BotUser>:
DB add word1+word2 This is a multiple word
topic test
<DB>: Okay
<BotUser>: DB, word1 word2
<DB>: BotUser, This is a multiple word
topic test |
|
|
|
|
|
|
uses
'?' to substitute 1 character and '*' for
anything in that place of the word or phrase |
|
|
Syntax |
<DB>
ADD <topic|*|?> <reply> |
|
|
Example |
<BotUser>:
DB add wil?card This is a wildcard topic
example using ?
<DB>: Okay
<BotUser>: DB, wildcard
<DB>: BotUser, This is a wildcard
topic test using ?
<BotUser>: DB add *wildcard This is a
wildcard topic example using *
<DB>: Okay
<BotUser>: DB, show me wildcard
<DB>: BotUser, This is a wildcard
topic example using * |
|
|
|
|
|
|
|
|
Syntax |
<DB> ADD <topic>
<data-N~|C~|T~|B~|Q~|R~|!~|S~|P~|V~|W~|
H~|h~|t~|BAN|TEMPBAN> |
|
|
Example |
<BotUser>:
DB add variables Hi N~, welcome to C~. I'm
glad you asked now (T~) about "Q~"
as R~ witnessed. I can tell you that I'm
running V~ on server S~, port P~ and you can
learn how this can be done at W~ or by
typing !~Q~ and me, B~, will display Q~
<DB>: Okay
<BotUser>: DB, variables
<DB>: Hi BotUser, welcome to #darkbot.
I'm glad you asked now (Sun Jul 1 02:41:56
2001) about "variables" as UserABC
witnessed. I can tell you that I'm running
Darkbot 6.f.6 on server irc.superchat.org,
port 6667 and you can learn how this can be
done at http://darkbot.info
or by typing !variables and DB will display
variables |
|
|
|
|
|
|
uses a '+' right before the reply |
|
|
Syntax |
<DB> ADD <topic> <+><data> |
|
|
Example |
<BotUser>: DB add test +reply with an
action
<DB>: Okay
<BotUser>: DB, test
*DB reply with an action |
|
|
|
|
|
|
uses '?action' right before the
topic and '?' or '*' right after the topic to match on those places
regular IRC CTCP action sufix and prefix |
|
|
Syntax |
<DB> ADD <?><action><topic><?|*>
<reply> |
|
|
Example |
<BotUser>: DB add
?action+test? topic
must start with ?action+ and finish with a wildcard (* or ?)
<DB>: Okay
*BotUser test
<DB>: BotUser, topic must start with ?action+ and finish
with a wildcard (* or ?) |
|
|
|
|
|
|
uses raw IRC commands
PRIVMSG,
NOTICE, TOPIC, KICK, BAN and MODE prefixed by "-" |
|
|
Syntax |
<DB> ADD <topic> <-><Raw IRC
command> <N~ | C~> <:><data> |
|
|
Example |
(full
examples/replies are not shown here, so add the instructions
and try yourself)
<BotUser>: DB add test -PRIVMSG N~ :this is a reply using
prefix '-' and IRC command PRIVMSG which sends a private message
to the user
<BotUser>: DB add test -NOTICE C~ :this is a reply using prefix
'-' and IRC command NOTICE which sends a notice to all users in
the channel
<BotUser>: DB add test -TOPIC C~ :this is a reply using prefix
'-' and IRC command TOPIC which changes channel's topic
<BotUser>: DB add test -KICK C~ N~ :this is a reply using
prefix '-' and IRC command KICK which applies a kick to the user
on the channel
<BotUser>: DB add test -BAN C~ N~ :this is a reply using
prefix '-' and IRC command BAN which applies a ban to the user on the channel
<BotUser>: DB add test -MODE C~ :+tn (this is a reply using
prefix '-' and IRC command MODE which changes channel's modes -
needs to be defined in defines.h) (DO NOT USE THIS COMMAND. Not
active) |
|
|
|
|
PRIVMSG data reply as action |
|
|
uses $char(01) right before
ACTION. To do _ type a space followed by $chr(01) and press key
TAB - delete the space afterwards |
|
|
Syntax |
<DB> ADD <topic> <-><PRIVMSG>
<N~ | C~> <$chr(01)><ACTION> <data> |
|
|
Example |
<BotUser>: DB add test
-PRIVMSG C~ :.ACTION
(to do the code before ACTION type a space followed by $chr(01)
and press TAB. Delete the space afterwards) |
|
|
|
|
|
|
uses '|' (pipe) to separate multiple
instructions of raw IRC commands PRIVMSG, NOTICE, TOPIC, KICK and
MODE. First instruction must be prefixed by "-" |
|
|
Syntax |
<DB> ADD <topic> <-><Raw
IRC command> <N~|C~> <:><data> <|> <Raw
IRC Command> <N~|C~> <:><data> |
|
|
Example |
<BotUser>: DB add test
-PRIVMSG C~ :1st
line needs '-' before the redirection command | PRIVMSG C~ :line2
<DB>: Okay
<BotUser>: test |
|
|
|
| Related Messages |
(if no topic is added):
DB: Add what, BotUser?
(if no reply is added):
DB: BotUser: What info to be added for test1?
(if already exists an entry for the topic):
DB: Sorry, there is an existing
entry under keyword test1
(if there is an error opening info2):
DB: Unable to open dat/info2.db
:( |
| Related Procedures |
Check
defines.h file [#define
REQ_ACCESS_ADD]
if you want to change the required user access level to add help topics
(default is 1)
The max length of each reply in info2.db (default is
400 characters) can be changed in darkboc.c [#define MAX_DATA_SIZE
400] (if you are loading your data from ram and the replies are all
less than 400 chars you can save some ram).
You can also change the
max topic length in [#define MAX_TOPIC_SIZE] (default is 50 characters);
Modify [#define EXISTING_ENTRY "Sorry, there is an existing entry
under keyword"] if you want to change the default message for existing
entries in topics. |
| See also:
Replace Reply
- Recall
Topic - Delete Topic/Reply - variables
|
| ILC |
[1] |
| ILC = Is Lamer Channel. This function is implemented
to give channel helpers, operators or IRC operators a way of having
a quick and brief background information about a given channel, as
well as the date and mask of who wrote it. (Check Obs.) |
| Command |
ILC |
| Syntax |
<DB> <ADD|REMEMBER|SAVE|STORE> <ILC><+>[#]<channel>
<description> |
| Example |
BotUser: DB add
ilc+#channelABC known for spamming bots.
DB: Okay BotUser :)
UserABC: ILC #channelABC
DB: UserABC, ([Thu Sep 13 08:47:40 2001] BotUser!ident@host.domain.org):
known for spamming bots. |
| Related Messages |
(if there is no ILC in Darkbot's database):
'DB: BotUser, I found no matching ILC for that channel.'
|
| Obs. |
As more people is using Darkbot for purposes other than a robot
to support general help channels, some commands can be adapted to
accomplish different tasks without the need of changing the code.
It's a matter of BotUser's imagination. For instance, because you
can perform ILC without '#' prefix, you can register information about
users; rename in your mind ILC's acronym for Identity Lamer Check
and add user information instead of channel.
Example:
BotUser: DB ADD ILC+UserABC UserXYZ did a mass flood
to #mychannel
DB: Okay BotUser :)
UserABC: ILC UserXYZ
DB: UserABC, ([Thu Sep 13 08:47:40 2001] BotUser!ident@host.domain.org):
UserXYZ did a mass flood to #mychannel |
| Random
Topic/Replies |
[2] |
| (RANDOMFILE
commands) Adds topics that give random replies. These topics
start with ~. |
| Command |
basically the same commands for managing
single topics and randomstuffs plus rdb status commands. |
| Explanation |
How it works? Lets say instead of having only one
reply for each keyword (topic) you want to have several ones. For
instance, you want DB to randomly reply to 'hi" with 'Hi Nick
;)', 'Hello Nick ;)' and 'Hey Nick ;)'. First is necessary to create
a topic with the correspondent link to the rdb file. Ex: DB add hi
~hi. (DB adds an entry 'hi ~hi' to dat/info2.db and creates a file
hi.rdb in /dat directory). Next you need to add random replies. Ex:
'DB randstuff ~hi Hi N~ ;)', 'DB randstuff ~hi Hello N~ ;)' and 'DB
randstuff ~hi Hey N~ ;)'. (DB will add those entries in hi.rdb). When
someone writes 'Hi', DB will read from dat/info2.db which file is
linked to 'Hi' (hi ~hi = hi.rdb), picks randomly one of the 3 entries
from hi.rdb and displays it to the user. You can link more topics
to the same random reply file, display, delete and see status of rdb
files.. |
|
|
|
To add random topic/files |
|
|
Commands |
ADD | REMEMBER | SAVE | STORE |
|
Syntax |
<DB> ADD <random_topic> <~random_link_entry) |
|
|
Example |
BotUser: DB add hi ~hi
DB: Okay, BotUser :) |
|
Related Messages |
-(if there are no replies set for that
topic):
DB: Sorry, I cannot answer that topic because DB random
text file (rdb) "dat/hi.rdb" was not found. |
|
|
|
|
|
|
Commands |
RANDSTUFF | RANDOMSTUFF |
|
Syntax |
<DB> RANDSTUFF <~random_link_entry> <reply> |
|
|
Example |
BotUser: DB randstuff ~hi Hi N~ ;)
DB: Done, there is 1 topic under dat/hi.rdb
BotUser: DB randstuff ~hi Hello N~ ;)
DB: BotUser, done. There are now 2 randomstuffs
BotUser: DB randstuff ~hi Hey N~ ;)
DB: BotUser, done. There are now 3 randomstuffs.
(now DB replies randomly (Hi N~, Hello N~ and Hey N~) to hi) |
|
|
|