Info scripts
Contents |
About this article
This article is part of the Eggdrop module wiki. It holds a list of dictionary modules and a short description and setup guide. At the moment this article is quite short, but it will grow overtime when users add their experiences with content filtering modules for eggdrop.
What is an info script?
Info scripts are a handy addition to eggdrop bots which are present in help channels. They can store information on commonly discussed topics or can act as automatic anwering machines for commonly asked questions. Within the dictionary modules, we can distinguish two user modes, dictionary mode and chatter mode. Dictionary mode requires a command to be given to the bot in order to display the information, while chatter mode works without commands. Here is an example of a typical question/answer cycle for both modes :
Dictionary mode :
<n00b> Do you know the answer to this FAQ?
<Regular> !dic FAQ
<bot> FAQ is a frequently asked question.
Whereas in chatter mode :
<n00b> Do you know the answer to this FAQ?
<bot> Did you know FAQ is a frequently asked question?
For help channels, chatter modes can be very helpful because it does not require any knowledge on how to operate the dictionary system. However, it can lead to the bot producing more erronous messages or improper reactions if the bot has not been programmed with careful forethought.
List of available info scripts
Egghelp, the online resource for Eggdrop, has a wide range of third party modules for eggdrop available. It offers a comprehensive list of info scripts here
Egg-Fu
Introduction
Egg-Fu is a script written by ch3mical. At the time of writing, there are 2 commonly used versions, version 2.0.2 and 2.0.11. Since 2.0.11 is harder to set up and both have nearly the same feature set, I'll stick to version 2.0.2 which can be downloaded here. Version 2.0.11 is available from its sourceforge page. Some of the features that Egg-Fu offers :
- Can work in both dictionary or chatter mode;
- Has a range of configurable triggers for setting, modifying and retrieving information from within the channel;
- You can configure the user modes from which user the bot can learn from;
- Has a number of options for reply modes;
- Can remember more than 1 answer for a certain keyword and will alternate between them;
- You can configure the user modes from which user the bot can learn from;
- birth certificate from the bot first run;
- Support for wildcards and variables;
- You can setup which channels the bot should be active on.
Modes of operation
Because of its versatility in setup, this script can be used for a number of applications. When set without trigger commands and accessible for all users, the bot can be a comical addition to a channel, learning from users statements and repeating them. The bot will remember anything before an is statement as the trigger for everything that comes after it :
<user1> The admin is away for the weekend.
...
<user2> Has anybody seen the admin?
<bot> Someone told the admin is away for the weekend.
While fun for a mindless chatter bot, this mode is less useful for a system where the information content should be trusted. For this mode, its better to work with the trigger commands :
<user1> !set FAQ is a frequently asked question.
...
<user2> !ask FAQ
<bot> Isn't FAQ a frequently asked question?!
In this mode, you can also the bots replies with modes of reply and variables.
Installation
To install this script, edit the egg-fu_2.0.2.tcl file to personalize it and copy it to your scripts directory. When you are done, add the following line to your eggdrop.conf file :
source scripts/egg-fu_2.0.2.tcl
If you have changed the path name of the brain.txt file, make sure it exits.
After restarting your bot, the module should be loaded.
Programming the bot behavior
You can program the bots reactions manually by either using commands in the channel or editing the brain.txt file directly. Either way makes it possible to make use of the modes, wildcards and variables which make it possible finetune the bots behaviour.
When programming the bot from within the channel, there are typically a number of (user-configurable) commands you can use :
Save a new entry in the dictionary :
!set keyword is explanation
Forget an entry from the dictionary :
!forget keyword
Freezing an entry from the dictionary, preventing the value gets changed accidentally :
!freeze keyword
Lock an entry from the dictionary, erasing it and making it unaccessible for future use :
!lock keyword
Unlock a previously locked keyword :
!unlock keyword
Setting a karma value for a certain keyword :
!karma set keyword number
Displaying a karma value for a certain keyword :
!karma for keyword
Erasing a karma value for a certain keyword :
!karma reset keyword
Assosications
The bot makes its associations from the following format :
keyword1 is explanation
Which leads to the following line in brain.txt :
keyword => explanation
Keywords can have more than one word :
keyword1 keyword2 => explanation
In which the bot will react to either of these keywords.
To have multiple explanations, use the | separator :
keyword => explanation1 | explanation2
Wildcards
You can make use of wildcards in keywords, for example when you define :
*keyword => explanation
Explanation will be triggered by mykeyword.
Reply modes
The script has 3 reply modes : simple, reply and action :
A simple association is defined like this :
keyword => explanation
This association will yield :
<user2> !ask FAQ
<bot> I think FAQ is a frequently asked question.
The formatting of the anwer will vary from the definitions made in the proc randy section of the script.
A seply association is defined like this :
keyword => <reply> explanation
This association will yield :
<user2> !ask FAQ
<bot> explanation
This mode makes it possible to omit the asked question from the answer.
An action association is defined like this :
keyword => <action> explanation
This association will yield :
<user2> !ask FAQ
*bot explanation
Similar as when a user types the /me command.
Variables
The script has a number of variables you can use to randomize replies and make them less monotone :
$date : displays the date, based on unix date.
$month : Displays a random month defined in proc anymonth.
$day : Displays a random defined in proc anyday.
$animal : Displays a random animal defined in proc anyanimal.
$color : Displays a random color defined in proc anycolor.
$nick : Displays a random nick from the channel.
$item : Displays a random item defined in proc anyitem.
$adj : Displays a random adjective defined in proc anyadj.
$birthday : Displays the bots birthday as defined in its birth certificate.
$age : Displays the bots age as defined in its birth certificate.
$sex : Displays the bots gender as defined in its birth certificate.
$who : Displays the nickname of the person who triggered the bot.
It is also possible to create your own extra variables by making a new block in the proc area and adding an entry to the list of available variables (advanced users only).
These variables can be inserted anywhere after the => sign as in this example :
todays lucky color => $color, $who
Would then yield :
<user> !ask todays lucky color
<bot> Hmm. I think todays lucky color is purple, user.