
A long, long time ago, there was a pretty useful little IRC bot for Windows called the [AnGeL] bot. It seems like nobody remembers it anymore, but it was born from the Anime / Sailor Moon scene back in the late 90s to early 2000s and developed by a German software engineer going by the name of [Benedikt Hübschen]. The bot was pretty widespread for a while, at least in the German speaking parts of the Internet, and it was extensible by writing VBScript code using Microsofts’ Windows Script Host.
So, essentially, it was what you’d have used if you couldn’t run UNIX or Linux with an eggdrop bot. And I sure couldn’t, because back then I barely even knew about the existence of such systems.
Recently, I ran into a small little problem though; I wanted the bot to create and maintain an SSL/TLS-only channel. So, an IRC channel that would let users join and chat with each other only if they’re connecting to the IRC server via an encrypted connection. This is usually done by setting the +z flag on the channel, which might be followed by the IRC server itself also setting the encryption indicator mode +Z automatically.
However, I found that the bot wouldn’t enforce +z at all. It wouldn’t even set the mode when asked to do so explicitly. It was possible to add it to the list of enforced modes, but it just wouldn’t work, with the same being true for +P (protect channel modes even when nobody is in the channel).
Luckily, Mr. Hübschen made the source code available under the GPL license (that’s what he told me personally) [here]! And yes, that is VisualBasic 6 code. And yes, VB6 is a part of the infamous Visual Studio 6, you might know the abbreviation “VC6” from C/C++ programs compiled with it. So I though I’d inspect the source code and attempt to fix this issue.
I fired up my Windows 2000 Pro SP4 virtual machine for that, installed Visual Studio 6 (thank you, MSDNAA/Dreamspark/Imagine) and its service pack 6, and then loaded the project file:
I identified the part of the code that would need changing, it’s in the public function ChangeMode() in SourceCode/Modules/Server/Server_Functions.bas. I simply copied some code and adapted it for my purpose, adding just +z and +P support for now:
Public Function ChangeMode(Should As String, Current As String) ' : AddStack "Routines_ChangeMode(" & Should & ", " & Current & ")"
Dim u As Long, CurMode As Long, Changes As String, InsertWhat As String
Dim CurPos As Long, LimitPos As Long, KeyPos As Long
' Added by GrandAdmiralThrawn (http://wp.xin.at/archives/4343):' modes +z (SSL/TLS enforce) and +P (permanent channel with' modes preservation even when empty):CurMode = GetModeChar(Current, "z")Select Case GetModeChar(Should, "z")
Case -1: If CurMode = 1 Then Changes = Changes & "-z"
Case 1: If CurMode = 0 Then Changes = Changes & "+z"
End Select
CurMode = GetModeChar(Current, "P")Select Case GetModeChar(Should, "P")
Case -1: If CurMode = 1 Then Changes = Changes & "-P"
Case 1: If CurMode = 0 Then Changes = Changes & "+P"
End Select
' End of modification by GAT.CurMode = GetModeChar(Current, "p")Select Case GetModeChar(Should, "p")
Case -1: If CurMode = 1 Then Changes = Changes & "-p"
Case 1: If CurMode = 0 Then Changes = Changes & "+p"
End Select
CurMode = GetModeChar(Current, "s")Select Case GetModeChar(Should, "s")
Case -1: If CurMode = 1 Then Changes = Changes & "-s"
Case 1: If CurMode = 0 Then Changes = Changes & "+s"
End Select
CurMode = GetModeChar(Current, "m")Select Case GetModeChar(Should, "m")
Case -1: If CurMode = 1 Then Changes = Changes & "-m"
Case 1: If CurMode = 0 Then Changes = Changes & "+m"
End Select
CurMode = GetModeChar(Current, "t")Select Case GetModeChar(Should, "t")
Case -1: If CurMode = 1 Then Changes = Changes & "-t"
Case 1: If CurMode = 0 Then Changes = Changes & "+t"
End Select
CurMode = GetModeChar(Current, "i")Select Case GetModeChar(Should, "i")
Case -1: If CurMode = 1 Then Changes = Changes & "-i"
Case 1: If CurMode = 0 Then Changes = Changes & "+i"
End Select
CurMode = GetModeChar(Current, "n")Select Case GetModeChar(Should, "n")
Case -1: If CurMode = 1 Then Changes = Changes & "-n"
Case 1: If CurMode = 0 Then Changes = Changes & "+n"
End Select
If InStr(ServerChannelModes, "c") Then
CurMode = GetModeChar(Current, "c")Select Case GetModeChar(Should, "c")
Case -1: If CurMode = 1 Then Changes = Changes & "-c"
Case 1: If CurMode = 0 Then Changes = Changes & "+c"
End Select
End If
If InStr(ServerChannelModes, "C") Then
CurMode = GetModeChar(Current, "C")Select Case GetModeChar(Should, "C")
Case -1: If CurMode = 1 Then Changes = Changes & "-C"
Case 1: If CurMode = 0 Then Changes = Changes & "+C"
End Select
End If
For u = 1 To Len(Should)
Select Case Mid(Should, u, 1)
Case "l": If GetModeChar(Should, "l") = 1 Then CurPos = CurPos + 1: LimitPos = CurPos + 1
Case "k": CurPos = CurPos + 1: KeyPos = CurPos + 1
Case " ": Exit For
End Select
Next uCurMode = GetModeChar(Current, "l")Select Case GetModeChar(Should, "l")
Case -1: If CurMode = 1 Then Changes = Changes & "-l"
Case 1If CurMode = 0 Then Changes = Changes & "+l": InsertWhat = " " & Param(Should, LimitPos)
If CurMode = 1 Then If Param(Current, 2) <> Param(Should, LimitPos) Then Changes = Changes & "+l": InsertWhat = " " & Param(Should, LimitPos)
End Select
CurMode = GetModeChar(Current, "k")Select Case GetModeChar(Should, "k")
Case -1: If CurMode = 1 Then Changes = Changes & "-k" & InsertWhat & " " & Param(Current, ParamCount(Current)): InsertWhat = ""
Case 1: If CurMode = 0 Then Changes = Changes & "+k" & InsertWhat & " " & Param(Should, KeyPos): InsertWhat = ""
End Select
Changes = CleanModes(Changes)
ChangeMode = Changes & InsertWhat
End Function
Honestly, I didn’t think it would actually compile at all. But just hit File \ Make AnGeL.exe, and it all builds just fine! And it’s fast as well. At least the building process is.
I chose to have VB6 “Optimize for fast code” and to have it “favor Pentium Pro(tm)”, whatever that means. But I assume it’s faster on P6 / i686 architectures now (Pentium Pro, Pentium II/III and other more modern chips). Probably also requires such a processor now, breaking compatibility with 586 and earlier chips, but I’m not sure whether that’s true.
I gave it the version number 1.6.3, with the latest I could ever find on the web before having been 1.6.2. You can download this version together with the source code here:
- [AnGeL bot v1.6.3][license] (with support for
+zand+Pchannel modes)
If you just want to run it instead of an existing one, all you need to do is to copy the AnGeL.exe over the one you have now, and that’s it. To edit the code, you need VisualBasic 6, just load the project file ANGEL.VBP and you can start to modify and recompile it.
Hah, changing the AnGeL bot and building its source code after so many years… felt a little bit like touching the holy grail or something. ![]()
My thanks fly out for Benedikt Hübschen for developing the AnGeL bot, and for open-sourcing it! Also, I would like to thank all the contributors to the project as well! I’ll continue to use the bot, probably for a long time to come. ![]()
Fixing and (re)compiling ancient software: The AnGeL IRC bot © 2017 by The GAT at XIN.at is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

