NBBOT FAQ

Answers to frequently asked questions


Credits

NBBOT is primarily the creation of Adron, and of the [RIP] guild. He is currently WoLF`Adron[RIP] and we are honored to consider him a WoLF brotherhood member and friend. There isn't a nicer person or better soul on battle.net.

Adron's NBBot home page

According to Adron, this NBBOT was created to answer the need for a chat interface for people who wanted to converse in languages requiring the use of high ASCII characters. Blizzard was unwilling or unresponsible to their needs, so Adron and [RIP] accepted the challenge.


INSTALLATION

How do I install it?

  1. Create a directory, for this example, C:\NBBOT, copy all the files into that directory.
  2. Make sure the Diablo executables are in your path. If Diablo is in C:\DIABLO, add the following command to your autoexec.bat file:

    SET PATH=%PATH%;C:\DIABLO

  3. To check your path, open a DOS prompt and type PATH. It should be similar to this:

    PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\DIABLO

  4. You may need to reboot after doing #2 before #3 will work.

Now what?

Although you have done everything necessary to get the NBBOT.EXE to run, it will not be of any use to you until you personalize it. You will want to put in your own user names, idle strings, and home channel. It will also be necessary to set yourself up as an owner or operator if you want to control it from other user names. So security groups must be set.

What are all these files about?

ACCOUNT.LOG
this file contains all account numbers which were created by battle.net for your bots when the bots attempted to log on without specifying one itself. We will use this file later to set advanced features like a designate list.

*.DLL, *.MPQ
these files are libraries required to perform certain functions and are automatically downloaded from battle.net if they do not exist. You will not be editing these files.

NBBOT.CFG
this is the configuration file where you will do most of your editing. It provides controls for nearly every feature of Adron’s NBBOT. Set up your usernames and custom commands here.

NBBOT.EXE
the program executable application. This is what you run to start the program.

NBBOT.USR
the security file for NBBOT. In the USR file you will define groups and users.

This looks hard! How will you teach me?

We are going to learn the sections of the CFG and USR files. This will be a task-oriented instruction set, where we set a goal, think about what we need, change the CFG and USR file, run the bot and test our changes, and examine the results.

Why not just give me a working CFG and USR file?

Your bot would be running and you would start asking questions like "How do I do a safe list?", "How do I get it to listen to my commands?", and "How do I get it to auto-designate people?" This lesson’s approach just short-circuits your questions by teaching you how to perform the tasks and why they work. Soon you will be self-sufficient on 95% of your configuration needs.

Wait! How do I read the entries in the CFG file?

OK. The following is a brief primer on the NBBOT.CFG file, so we have some common ground for discussing how to perform the tasks.

Command Reference

Your CFG file may include the following entries. This is a list of commands available for you to program the behavior of your bots. At this time they are only listed. Discussion will come later.


THE BASICS

The next few sections take you through the prerequisites to becoming an NBBOT programmer. While you do not have to memorize every command or syntax, you do need to understand how each part is used.

Commands:


Environment Variables

Even though it says "config file commands" for the following entries, they are more closely related to your DOS environment variables. Only, they apply just to your NBBOT. Discussion of the important ones will occur at the appropriate time.

Config file commands


Event Filters

This section describes the behavior of your bot. It is in the event filters where you define how the bot should respond when certain things occur in specified ways. For example, you could program the bot to say "hello, master" every time it saw you join the channel.

The event filters section in the config file make the assumption that you understand the event types. You are unlikely to understand event types unless you have spent some time in telnet or programming your own bot for battle.net. Here is a sample screen from a telnet session to battle.net:

2010 NAME WoLF`GRoK~{RC} 1007 CHANNEL "Blizzard Chat 3"
1001 USER Guest20 0010 [CHAT]
1001 USER WoLF`GRoK~{RC} 0010 [CHAT]
1018 INFO "Welcome to Battle.net!"
1018 INFO "This server is hosted by Mindspring."
1018 INFO "There are currently 45422 users online, in 11181 games and 3055 channels."
1018 INFO "Check out the Sorceress unleashing a Blizzard on"
1018 INFO "some Zealots and Zombies in the Diablo II"
1018 INFO "Screenshot of the Week at www.blizzard.com. Spin"
1018 INFO "the Wheel in the Starcraft Map of the Week at"
1018 INFO "www.blizzard.com."
/who death
1019 ERROR "That channel does not exist."
1019 ERROR "(If you are trying to search for a user, use the /whois command.)"
1002 JOIN-=ForsakeN=- 0010 [CHAT]
1003 LEAVE-=ForsakeN=- 0010
1002 JOIN Ruffbot4 0010 [CHAT]
1005 TALK Ruffbot4 0010 "Ruffbot4"
1005 TALK Ruffbot4 0010 "cow"
/who the loft
1018 INFO "Users in channel the loft:"
1018 INFO"-=^P$Y]3oT-7^= -,-=^P$Y]3oT-3^=-, "
1018 INFO "~Un4GiVeN^ArMy~,-=^P$YcHoTiC^=-, "
1018 INFO "Su[]Der`$iZe,-=^P$Y]3oT-A^=-, "
1018 INFO"-=^P$Y]3oT-9^=-, [SU[]DER[]DE$'|'], "
1018 INFO "Su[]Der`l3oVVl, Su[]Der`l3a|{eD, "
1018 INFO"[-=^P$Y]3OT-2^= -],-=^An|maL^=-"
/me test
1023 EMOTE WoLF`GRoK~{RC} 0010 "test"
1003 LEAVE Ruffbot4 0010
1002 JOIN Sod_Bot 0010 [CHAT]
1003 LEAVE Sod_Bot 0010
/w wolf`grok~{RC} whisper to self
1010 WHISPER WoLF`GRoK~{RC} 0010 "whisper to self"
1004 WHISPER WoLF`GRoK~{RC} 0010 "whisper to self"
/join grok
1007 CHANNEL "grok"
1001 USER WoLF`GRoK~{RC} 0010 [CHAT]
1009 USER WoLF`GRoK~{RC} 0012
/who
1018 INFO "Users in channel grok:"
1018 INFO "[WOLF`GROK~{RC}]"

Notice that on almost every line of listing is a number from 1001 to 1023. The first line is 2010 and the lines that do not begin with a number show my typing into the session.

NBBOT subtracts 1000 from the event number to get its event filter number. The following table shows the battle.net event numbers and their description. This list can be found in the greetbot source file.


Battle Net Event IDs

1001 SHOWUSER

You have joined a channel and battle.net is listing the users. In the example telnet session above, I joined channel grok and it listed the users in the channel, prefaced by 1001 for each user:

1001 USER WoLF`GRoK~{RC} 0010 [CHAT]

1002 JOIN

Someone has joined the channel you are in. In the telnet session,-=ForsakeN=- joined first:

1002 JOIN-=ForsakeN=- 0010 [CHAT]

1003 LEAVE

Someone has left the channel you are in. In the telnet session,-=ForsakeN=- left immediately after his arrival:

1003 LEAVE-=ForsakeN=- 0010

1004 WHISPER

This Whisper code is really WHISPER RECEIVED. It indicates an incoming whisper from another user on battle.net. Whenever you get whispered, this is an event 1004.

1004 WHISPER WoLF`GRoK~{RC} 0010 "whisper to self"

1005 TALK

Every time someone chats normally in the channel, it appears as a 1005 TALK event in telnet.

1005 TALK Ruffbot4 0010 "Ruffbot4"

1006 BROADCAST

Ever get a message from battle.net saying that a certain server was about to be reset? That is a broadcast. They don’t happen much, the information is useless to your bots, and we will not be using it in any examples.

1007 CHANNEL

When a battle.net user joins a channel, that user receives a 1007 CHANNEL event showing the name of the channel he has successfully joined.

1007 CHANNEL "grok"

1009 USERFLAGS

This event is received when a user has had a status change and the battle.net server just wants to inform you. For example when someone gets a hammer in the channel, a.k.a. ops, all users in the channel are sent a 1009 event. The same is true when users are squelched/unsquelched, but only the affected users are sent the message.

1010 WHISPERSENT

You receive this event when you have whispered someone and the server has successfully forwarded the whisper to the destination username.

1010 WHISPER WoLF`GRoK~{RC} 0010 "whisper to self"

1013 CHANNELFULL

This event occurs when you try to join a channel that your battle.net server sees as having the maximum users allowed. Currently this number is 40. Note: For whatever reason Blizzard decided not to implement this event code. Channel full messages come to you through 1019 ERROR messages. So you will not be using 1013, 1014, or 1015.

1014 CHANNELDOESNOTEXIST

Not implemented. Blizzard uses 1019 ERROR "Channel does not exist" (or similar) instead.

1015 CHANNELRESTRICTED

Not implemented. Blizzard uses 1019 ERROR "You are banned from that channel" (or similar) instead.

1018 INFO

Information that battle.net sends to you. Most of these you have no need to act upon. Example:

1018 INFO "Welcome to Battle.net!"
1018 INFO "This server is hosted by Mindspring."

Sometimes 1018 gives useful info, like a /who channelname:

1018 INFO "Users in channel the loft:"
1018 INFO"-=^P$Y]3oT-7^= -,-=^P$Y]3oT-3^=-, "
1018 INFO "~Un4GiVeN^ArMy~,-=^P$YcHoTiC^=-, "
1018 INFO"[-=^P$Y]3OT-2^= -],-=^An|maL^=-"

In the 2nd example, knowing what users are in a channel may be useful.

Programming the bot to respond to that information is the challenge.

1019 ERROR

This event occurs in response to a large number of triggers, such as full channel, restricted channel, invalid username you tried to whisper, and so on.

1019 ERROR "That channel does not exist."
1019 ERROR "(If you are trying to search for a user, use the /whois command.)"

1023 EMOTE

This event occurs when someone in the channel expresses an emotion using the ‘/me’ command.

/me screams
1023 EMOTE WoLF`GRoK~{RC} 0012 "screams"
1018 INFO "No one hears you."

2010 NAME

This event is received from your battle.net server to tell you the name it has given you when you log on. Why? If you log on and another user already has your name, your server appends a 2 to your name to make it unique. The 2010 NAME event is the server’s way of telling you the new name.


Defining Usernames and Passwords

Each unique username you wish to load on a battle.net server must be defined by a section in the nbbot.cfg file. A section is described as a friendly name surrounded by square brackets. [grok]

[grok]
username=WoLF`GRoK~{RC}
password=mypassword
[bot1]
username=WoLF`aLpHa`MaLe
password=hispassword
[bot2]
username=WoLF`Cu|3
password=thatpw


The only required entry in a user section is the username. Let’s say I have 3 bot names that all have the same password. I define the password before the username sections, and it remains constant for all:

password=mybotpass
[bot1]
username=WoLF`aLpHa`MaLe
[bot2]
username=WoLF`Cu|3
[bot3]
username=WoLF`FaNGs
[grok]
username=WoLF`GRoK~{RC}
password=mypassword


Each bot- 1, 2, and 3 will use ‘mybotpass’ to log on. By including the password= variable for grok, it does not use ‘mybotpass’ for WoLF`GRoK~{RC}. Instead, password is defined in the section local to grok.


Getting on the right server

You can define a server for each username to log on. In this example, 3 bots log on the same server.

server=207.138.34.3
[bot1]
username=WoLF`aLpHa`MaLe
[bot2]
username=WoLF`Cu|3
[bot3]
username=WoLF`FaNGs


In this next example, each bot logs on a different server.

[bot1]
username=WoLF`aLpHa`MaLe
server=207.69.194.189
[bot2]
username=WoLF`Cu|3
server=216.32.73.174
[bot3]
username=WoLF`FaNGs
server=209.67.136.170



Load Em Up!

What now? We have defined 4 section names for users: grok, bot1, bot2, bot3. How do I load them? This is what the [_load] section is all about. Put the [_load] section after your user sections. I keep this load section last in my cfg file.

[_load]
spawn=bot1
spawn=bot2
spawn=bot3
spawn=grok


Starting the bot with this load section will cause bot1, bot2, and bot3 user sections to be processed and those users logged on.

The grok section will not be loaded because we have commented it out by putting a space before the spawn= command.


PROGRAMMING NBBOT

So you know the basics of how to log them on .. what now?

Before you go any further, you will want to create some usernames on battle.net for your bots, if you have not already. You probably have. This NBBOT is not for sissies, so if you are still reading you have probably done some channel warfare with other bots and have usernames already created. Otherwise, go create the names now and edit your CFG file with those names and passwords.

Event triggers: How do I read them? It is all numbers and symbols!!

At first glance lines like the following look daunting:

&4&£&p2&%1: Password 2 OK
&4&$&setpriv &:setuserpriv %3
&4&£&rename &:renameuser %3
&4&£&merge &:joinuser %3


But, as we go through this, it will become clear how to not only read those lines, but modify them to suit your purposes and create new ones just for you.

Syntax is the ‘structure’ of any language. Using proper syntax when you speak allows the listener to properly separate the sentences into words. The same is true in computer languages and in NBBOT-speak.

An NBBOT event trigger always has EXACTLY four parts. Adron defines them as:

<type number>
<user name match>
<text match>
<action>


However I prefer to call them by these names:

<event trigger>
<user name filter>
<text filter>
<action>


NBBOT command event syntax:

&<event trigger>&<user name filter>&<text filter>&<action>

Notice that an ampersand(&) goes BEFORE each part of the command. The only required part is the event trigger itself. All other parts are optional, though it makes no sense to leave off the <action>.

<Event Trigger>

Earlier you were told about the different battle.net event codes and their meanings. For all the 1000-series event codes, like 1001 USER and 1002 JOIN, 1005 TALK and so on, to find the NBBOT event trigger number just subtract 1000.

&1 traps when a username has been told to you after you joined a channel
&2 traps when a username has joined the channel you are in
&3 traps when a username has left the channel you are in
&5 traps when the bot has received a 1005 TALK message from battle.net
&7 traps when the name of the channel you have entered
&9 traps when a user has had their flags change
&10 traps when you have sent a whisper
&18 traps when battle.net is giving you info
&19 traps when battle.net is informing you of an error condition
&23 traps when a user did an emotion


<User Name Filter>

For discussion purposes, lets say we received a type 5 event, which is a TALK event, meaning someone in the channel said something. So far we can trap that event with the &5 event trigger. Now suppose we want to respond to that if the username is ‘guest’. How do we do that? The 2nd part of the command, <user name filter> is the way.

&5&"guest"
means username of ‘guest’ said something by talking normally.
&5&guest
means username that has ‘guest’ somewhere in it talked in the channel normally.
&5&"guest
means username that begins with ‘guest’ talked.
&5&guest"
means username that ends with ‘guest’ talked.
&5&@Friends
means a username that is in the group "Friends" talked.

<Text Filter>

So far we know that guest said something. The 3rd part of the command lets us respond when we saw a particular set of words in the speech or other event string.

In this example we will look for when someone laughs in the channel by saying ‘LOL’.

&5&&"LOL"
means someone, anyone, said "LOL" on a line by itself.
&5&&LOL
means someone said "LOL" anywhere in their talking.

In this example we look for someone whispering to us "ban <someone>", and so we ban them(seguey to <action> description).

&4&&"ban &/ban %3

<Action>

This 4th part describes how the NBBOT will react when parts one, two, and three are all true. There are two possibilities for the <action> part. You can either provide text for the bot to type, or you can use one of the many NBBOT stored commands. NBBOT stored commands begin with a colon( : ) character.

This example listens for WoLF`GRoK~{RC} to say "join grok", and then it joins that channel.

&5"WoLF`GRoK~{RC}"&"join grok"&/join grok

But that is not very flexible. Let us change it so that it responds to anyone in group Operators who tells it to join any channel. To do this we introduce a new feature: variables.

&5&@Operators&"join &/join %3

The "@Operators" indicates anyone in group operators. The %3 is a variable which is filled by NBBOT with the text following whatever you matched for in the <text filter> part of the command. We matched for "join " which means any string beginning with the word join (there is a space after join). %3 will equate to the text after join(space).

For example, if an operator says:

join dark realm

and if <text filter> is "join(space) then %3 will be "dark realm"
How is that useful? It enables us to write this command: /join %3

And the bot will actually say:

/join dark realm

Another example is if someone joins your channel who is on your shitlist. You filter the 2 event(join), their username against the Shitlist group, and if they match, you ban them automatically.

&2&@Shitlist&&/ban %1

where %1 is the name variable after NBBOT reads the line.


Variables


Well I suppose that’s enough to get you started!

Before this NBBOT can work real well for you, it is necessary for you to understand the NBBOT.USR file. Right now I do not have time to describe it for you, but will at a later date/time.

That is all for now.

-WoLF`GRoK~{RC}