SphtBot - version 3.00 build 464

Changes since 2011

Bot now supports local version checking for all products, making BNLS entirely optional. This can be enabled via the Battle.net configuration window. Storm.dll required.

Improved handling of duplicated and phantom users, and updated namespace change from @ to #.

A "duplicated" user is when a username collision has occurred and somebody in the channel has the exact name as another user. This typically happens when servers for the particular gateway become desynchronized.

A "phantom" user is typically a disconnected user that the server is still reporting as present, likely also due to server desynchronization. In the past it could also indicate the bot has detected an invisible Battle.net admin in the channel.

Added registry setting "Show chat bubble" (DWORD) to display a chat bubble next to active users in the channel.

Added registry setting "Combine events" (DWORD). When enabled, if a user joining the channel is entering with an immediate flag and/or stats update, the bot will combine those events into one notification.

Added registry setting "Stay home" (DWORD). When enabled, bot will periodically check to ensure it's in the configured home channel. Useful if home channel may sometimes become unavailable for whatever reason and bot is left unattended for extended periods of time.

Added registry setting "Allow dynamic pings" (DWORD). When enabled, bot will allow user's ping to change dynamically in-channel. This should be left disabled, unless using certain third party servers which behave this way.

Added registry setting "Force old logon" (DWORD). When enabled, bot will always use the old logon system (X-SHA1) regardless of what Battle.net specifies. This may be useful on certain third party servers.

Added registry settings "SOCKS" (String) and "SOCKS method" (DWORD) to configure a SOCKS address and method (4 or 5). SOCKS address can be comma-delimited and bot will attempt the next address if the first fails.

Added global registry setting "Server restart date" (String). Allows you to manually set a Battle.net server (or server mask) restart date so the bot can display an accurate server uptime upon login. This is a simple visual option that will have to be manually updated when servers restart. Eg: 199.108.55.* 2017-12-05 17:38:00,12.129.236.* 2017-12-05 17:38:00 (sets a restart date for all addresses on the USEast and USWest gateways).

Added global registry setting "Gateways" (String). This is another visual option to title the various gateways.

Added a stripped-down D2GS client for transferring items/perm'ing characters. Use /mcpmakegame to create a game with a computed static name/password. Use at your own risk!

Added support for Diablo II and classic stylized chat colors.

Added Discord-like display on the user-input box when chat/whisper lock is enabled.

Improved IRC support. Added a visual channel/user list. /# will now send message to last IRC channel. Also, /emote, /whisper, /whois will send to IRC if chatlock is enabled for #channel.

Various minor fixes and improvements throughout bot.

Installation and notes

Download and extract the contents of the zip to your personal SphtBot directory. If SphtBot fails to launch, you may be missing some required run-time DLLs. Download and install.

The first time you run SphtBot, you will be prompted for various information that is required for the Battle.net connection. You should fill in the information that is relative to the product(s) which you intend to log on as. Please note that SphtBot stores a separate CD-key for every product, so you should select a product from the dropdown before entering a CD-key for it.

Enable "Connect to Battle.net" to automatically connect to Battle.net when the bot starts up. /forceconnect is a useful command to override any delays caused by subsequent failed connection attempts.

You can enter multiple comma-delimited addresses for Battle.net and BNLS, and bot will randomly choose an address each time.

Use /display to configure basic color settings to your likings. If colorful names is enabled, a unique color is computed for each user and IRC #channel which is consistent for all iterations of SphtBot.

Navigate the registry to access many additional settings (HKEY_CURRENT_USER\Software\Valhalla's Legends\Spht\SphtBot). When making changes to the registry, /reload will be sufficient for most options, but generally the bot should be restarted.

Bot will download and use icons.bni and icons_STAR.bni if it is available. You can also use legacy_icons.bni, war3_icons.bni, and w3xp_icons.bni for additional icons. Open the About dialog to view all icons that are currently loaded into memory.

Supports logging on with a pre-hashed password (X-SHA1 logon protocol only). To use this, you must specify a password in the format SHA1:<40 hex characters>. Use /randsha1 to generate a random password.

The official Battle.net Logon Server (BNLS) is no longer active, so you should use a trusted and reliable third-party server. BNLS is optional and only used for version checking so users need not worry about juggling and updating game files. CD-key and password hashing is performed locally for all products so sensitive information is never transmitted plain-text over the network.

Creating a profile

Launching the executable directly (with no command-line) will open the default profile. Simply run SphtBot with the command-line "myprofile" (no spaces) to create or launch a separate configuration profile, where "myprofile" (in quotes) is the name of your profile. For your convenience, I recommend creating a Windows shortcut to SphtBot with the necessary command-lines for each profile you've created. You DO NOT need to create multiple copies of the exe to access additional profiles.

About

SphtBot was primarily designed to be an efficient Battle.net chatter bot, with a BotNet layer for clan and database management, which supports logging on to Battle.net as StarCraft, Brood War, Japan StarCraft, Warcraft II, Diablo II, Lord of Destruction, Warcraft III, and The Frozen Throne; as well as the classic games Diablo, Diablo Shareware, and StarCraft shareware.

Offers a basic, but highly useful and functional Internet Relay Chat (IRC) client. The different client layers all operate concurrently within the bot, so as long as all layers aren't simultaneously busy, then it should be an enjoyable experience and easy to differentiate where activity is coming from. If you intend to connect the IRC client in several active channels, while also on Battle.net, you may want to set up a separate profile for IRC-only to reduce on-screen clutter.

Supports rendering backward and forward-order icons.bni. Skywing's IconView will allow you to modify the icons file. Also supports all the Warcraft III (including World Cyber Games), StarCraft, Warcraft II, and classic Diablo icons.

Known issues

Bot may sometimes appear out of sight when using multiple monitors. Close the bot, locate and edit registry setting "Window options" (KEY_CURRENT_USER\Software\Valhalla's Legends\Spht\SphtBot) and set it to 4 or 5, whichever works best.

There has been several changes to classic Battle.net's infrastructure over the past couple years:

The official Battle.net servers now use a new logon method for StarCraft involving Blizzard accounts which is currently not supported.

Battle.net's new anti-spam system will sometimes drop messages arbitrarily without notifying the user, even if you aren't necessarily "spamming". There is currently no implemented solution to determine on the fly when this is happening. Tip: It currently appears that you will always get messages from users on your /friends list.

Your CD-key may still be "in use" after reconnecting. CD-key usage tends to linger sometimes for a couple minutes after disconnecting.

You can only use one non-Warcraft3 CD-key at a time on Battle.net now (instead of one per gateway), and the 8 connection limit is no longer per-gateway either. Also, CD-key spawning has been disabled for Warcraft II.

There are several new restrictions, autobans, server-specific temporary CD-key/account bans, etc. I recommend entering multiple comma-delimited Battle.net servers for the bot to choose from to automatically evade some of these problems. Eg: 199.108.55.57, 199.108.55.58, 199.108.55.59 instead of useast.battle.net since the DNS can often resolve to the same IP for hours at a time.

You may sometimes get IP banned from Battle.net through no fault of your own. My sincerest apologies for the immense sense of acute hopelessness you feel when this happens.

Battle.net Product Setup

Download and extract Storm.dll to your SphtBot installation directory. Depending on which product(s) you want to log on as, the following files will need to be copied into the appropriate directories (you may setup SphtBot to work with multiple products):

Special thanks

Skywing, for his expert advice and leadership. For development of the Battle.net Logon Server, BotNet server, BinaryChat plugin API, WebChannel ISAPI, and many more innovations and standards. Furthermore, as is quite obvious from the start, I've used many of the conventions set in place by BinaryChat when developing SphtBot.
Yoni, for co-development of the Battle.net Logon Server.
Kp, for co-development of the BotNet server.
Adron, without him this bot would not have been possible. His revolutionary NBBot paved the way for Battle.net bots and got me interested in programming for Battle.net in the first place.
Chewbacca, for truly setting the standard for Battle.net bots. Chewbacca's bot went far beyond any other Battle.net bot of the time.
DarkMinion, for introducing me to Clan [vL] and supporting my membership.
Soulburner, his DamnBot proved to be a great inspiration to me.
The members of Valhalla Legends and all the wonderful people who beta tested the bot despite poor documentation and precious little tech support.

oper.dll is a BinaryChat plugin that will transform SphtBot into a full-fledged Battle.net channel moderation bot, designed to safeguard Clan channels.

This plugin was heavily inspired by Skywing's ZeroBot (the bot used to moderate Clan [vL]) and designed to be cross-compatible with its database and scripting system. If you are familiar with ZeroBot or NBBot you should have no problem using this plugin.

Features: A highly flexible custom command system (including userdefined variables and advanced conditionals), an intuitive flags-based access control system coupled with a limited form of regular expression wildcard matching, and a powerful set of channel moderation functionality.

Plugin Developer Reference

SphtBot supports the powerful BinaryChat plugin API that allows end-users to customize the program to a great degree. Allowing the user to transfer control to an external dll allows complete near customization of the bot for specialized purposes. Users are encouraged to develop their own plugin dlls for SphtBot. Following is the information required to use this plugin API in C/C++.

Managing plugins:To load a plugin, use the /loadplugin <Plugin path> command. The /unloadplugin <Plugin path> command unloads a plugin from memory, and the /listplugins command displays all active plugins. SphtBot will automatically load all plugins in its directory on startup.

Plugin format:BinaryChat plugins are regular Win32 DLL files with the .bcp extension. All BinaryChat plugins must export the function SetInterfaceInformation. This function receives a pointer to a PluginInformation structure. You should determine which PluginInformation version you are using through the dwSize member. Your plugin should take note of the addresses of various BinaryChat-supplied API functions for future reference. In addition, if you wish to install one of the provided hooks, you should set the corresponding function pointer (and, optionally, the 32-bit parameter associated with it) in the structure to the address of your hook function. By default, all of the hook functions are set to NULL, which indicates to BinaryChat that no plugin hook is present.