home *** CD-ROM | disk | FTP | other *** search
Wrap
Attribute VB_Name = "Module1" 'Option Explicit Dim BinChr As String: Dim xChr As String: Dim xResult As String: Dim Z As Integer: Dim NewChr As Integer: Dim xB As Integer: Dim xB2 As Integer Dim TmpStr As String: Dim NewBin As String: Dim C As Integer: Dim DD As Integer: Dim EE As Integer Dim BinArray(7) As String: Dim User As String: Dim Password As String: Dim i As Integer 'Declarations Dim Letters As String: Dim comm As String: Dim DataBuild As String Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long Private Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long Private Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long Const MF_BYPOSITION = &H400& Const MF_REMOVE = &H1000& Public Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean Public Const NIM_ADD = &H0 Public Const NIM_MODIFY = &H1 Public Const NIM_DELETE = &H2 Public Const NIF_MESSAGE = &H1 Public Const NIF_ICON = &H2 Public Const NIF_TIP = &H4 Public Const WM_MOUSEMOVE = &H200 Public Const WM_LBUTTONDOWN = &H201 Public Const WM_LBUTTONUP = &H202 Public Const WM_LBUTTONDBLCLK = &H203 Public Const WM_RBUTTONDOWN = &H204 Public Const WM_RBUTTONUP = &H205 Public Const WM_RBUTTONDBLCLK = &H206 Public Const HWND_TOPMOST = -1 Public nid As NOTIFYICONDATA Public Type NOTIFYICONDATA cbSize As Long hwnd As Long uId As Long uFlags As Long uCallBackMessage As Long hIcon As Long szTip As String * 64 End Type Global isWhois As Boolean Global LogFile As String Public Function xMenu(FormName As Form) Dim hSysMenu As Long, nCnt As Long hSysMenu = GetSystemMenu(FormName.hwnd, False) If hSysMenu Then nCnt = GetMenuItemCount(hSysMenu) If nCnt Then RemoveMenu hSysMenu, nCnt - 1, MF_BYPOSITION Or MF_REMOVE RemoveMenu hSysMenu, nCnt - 2, MF_BYPOSITION Or MF_REMOVE DrawMenuBar FormName.hwnd End If End If End Function Public Function Ascii(BinText As String) 'Convert Binary to ASCII For xB = 1 To Len(BinText) BinChr = Mid(BinText, xB, 8) Z = 128: NewChr = 0 For xB2 = 1 To 8 xChr = Mid(BinChr, xB2, 1) If xChr = "1" Then NewChr = NewChr + Z Z = Z / 2 Else Z = Z / 2 End If Next xB2 xResult = xResult & Chr(NewChr) xB = xB + 7 Next xB Ascii = xResult: xResult = "" End Function Public Function Binary(AscText As String) 'Convert ASCII to Binary For C = 1 To Len(AscText) DD = Asc(Mid(AscText, C, 1)): BinArray(7) = DD Mod 2 DD = DD \ 2: BinArray(6) = DD Mod 2 DD = DD \ 2: BinArray(5) = DD Mod 2 DD = DD \ 2: BinArray(4) = DD Mod 2 DD = DD \ 2: BinArray(3) = DD Mod 2 DD = DD \ 2: BinArray(2) = DD Mod 2 DD = DD \ 2: BinArray(1) = DD Mod 2 DD = DD \ 2: BinArray(0) = DD Mod 2 For EE = 0 To UBound(BinArray) TmpStr = TmpStr + BinArray(EE) Next EE NewBin = NewBin + TmpStr: TmpStr = "" Next C Binary = NewBin: NewBin = "" End Function Public Function Box(xPos As Integer, yPos As Integer, Width As Integer, Height As Integer, Border As Integer) 'Nifty function i made for creating ansi instructions for GUI, good for telnet servers. Dim TopLeft As String: Dim TopRight As String Dim BottomLeft As String: Dim BottomRight As String Dim AcrossTop As String: Dim AcrossBottom As String Dim DownLeft As String: Dim DownRight As String Dim TheBoxData If Border = 1 Then TopLeft = Chr(218): TopRight = Chr(191) BottomLeft = Chr(192): BottomRight = Chr(217) AcrossTop = Chr(196): AcrossBottom = Chr(196) DownLeft = Chr(179): DownRight = Chr(179) End If If Border = 2 Then TopLeft = Chr(201): TopRight = Chr(187) BottomLeft = Chr(200): BottomRight = Chr(188) AcrossTop = Chr(205): AcrossBottom = Chr(205) DownLeft = Chr(186): DownRight = Chr(186) End If If Border = 3 Then TopLeft = Chr(220): TopRight = Chr(220) BottomLeft = Chr(223): BottomRight = Chr(223) AcrossTop = Chr(220): AcrossBottom = Chr(223) DownLeft = Chr(221): DownRight = Chr(222) End If If Border = 4 Then TopLeft = Chr(219): TopRight = Chr(219) BottomLeft = Chr(219): BottomRight = Chr(219) AcrossTop = Chr(219): AcrossBottom = Chr(219) DownLeft = Chr(219): DownRight = Chr(219) End If TheBoxData = TheBoxData & Mv(xPos, yPos) & TopLeft For i = 1 To Width - 2 TheBoxData = TheBoxData & AcrossTop DoEvents Next TheBoxData = TheBoxData & Mv(xPos, Width + yPos - 1) & TopRight TheBoxData = TheBoxData & Mv(Height + xPos - 1, yPos) & BottomLeft For i = 1 To Width - 2 TheBoxData = TheBoxData & AcrossBottom DoEvents Next TheBoxData = TheBoxData & Mv(Height + xPos - 1, yPos + Width - 1) & BottomRight For i = 1 To Height - 2 TheBoxData = TheBoxData & Mv(xPos + i, yPos) & DownLeft DoEvents Next For i = 1 To Height - 2 TheBoxData = TheBoxData & Mv(xPos + i, Width + yPos - 1) & DownRight DoEvents Next Box = TheBoxData End Function Function Mv(xPos As Integer, yPos As Integer) Mv = "" & xPos & ";" & yPos & "H" 'ANSI code to move the cursors position. End Function Public Function l33t(ASCII_Code As String) 'A really stupid non-randomized not-so-slite speaker. Select Case ASCII_Code Case "a" l33t = Chr(229) Case "b" l33t = Chr(223) Case "c" l33t = Chr(231) Case "d" l33t = "╨" Case "e" l33t = Chr(235) Case "i" l33t = Chr(238) Case "l" l33t = Chr(163) Case "n" l33t = Chr(241) Case "o" l33t = Chr(248) Case "u" l33t = Chr(249) Case "x" l33t = Chr(215) Case "A" l33t = Chr(197) Case "C" l33t = Chr(199) Case "E" l33t = Chr(203) Case "N" l33t = Chr(209) Case "Y" l33t = Chr(165) Case "U" l33t = Chr(220) Case "I" l33t = Chr(207) Case "O" l33t = Chr(216) Case "?" l33t = Chr(191) Case "!" l33t = Chr(161) Case "0" l33t = Chr(186) Case "1" l33t = Chr(185) Case "2" l33t = Chr(178) Case "3" l33t = Chr(179) Case Else l33t = LCase(ASCII_Code) End Select End Function Public Function Elite(Text As String) 'Second routine for eliterizing For i = 1 To Len(Text) Letters = Letters & l33t(Mid(Split(comm, "; ")(1), i, 1)) Next Letters = Replace(Letters, "╪╪", "╥╓") Letters = Replace(Letters, "°°", "≥÷") Letters = Replace(Letters, "╧╧", "╠╧") Letters = Replace(Letters, "εε", "∞∩") Letters = Replace(Letters, "╦╦", "╚╦") Letters = Replace(Letters, "δδ", "Φδ") Letters = Replace(Letters, "┼╦", Chr(198)) Letters = Replace(Letters, "σδ", Chr(230)) Letters = Replace(Letters, "εrτ", "∞«⌐") Letters = Replace(Letters, "╧r╟", "∞«⌐") End Function Public Function LoadLists() 'Load the user lists LoadList Form4.AOP, "aop.ini" LoadList Form4.Admins, "admins.ini" LoadList Form4.Opers, "opers.ini" LoadList Form4.Users, "users.ini" End Function Public Function Msg(xChannel As String, Message As String) Msg = "PRIVMSG " & xChannel & " :" & Message End Function Public Function OP(xChannel As String, Nickname As String) OP = "MODE " & xChannel & " +o " & Nickname End Function Public Function DEOP(xChannel As String, Nickname As String) DEOP = "MODE " & xChannel & " -o" & Nickname End Function Public Function Voice(xChannel As String, xNickname As String) Send "MODE " & xChannel & " +v " & xNickname End Function Public Function Ban(xChannel As String, NicknameOrHost As String) Ban = "MODE " & xChannel & " +b " If IsNumeric(Mid(NicknameOrHost, 1, 2)) = True Then Ban = Ban & "*!*@" & NicknameOrHost Else Ban = Ban & NicknameOrHost End If End Function Public Function unBan(Channel As String, Nickname As String) unBan = "MODE " & Channel & " -b " If IsNumeric(Mid(Nickname, 1, 2)) = True Then unBan = unBan & "*!*@" & Nickname Else unBan = unBan & Nickname End If End Function Public Function Kick(xChannel As String, Nickname As String, Reason As String) Kick = "KICK " & xChannel & " " & Nickname & " :" & Reason End Function Public Function Send(Data As String) If Len(Data) < 500 Then Form1.Sock1.SendData Data & vbCrLf End If End Function Public Function Register() Send "USER " & Form1.txtUser & " ? * :" & Form1.txtEmail Send "NICK " & Form1.txtNick Send Msg("nickserv@services.dal.net", "identify " & Password) Send "JOIN #decode" End Function Public Function QUIT(QuitMessage As String) DoEvents Send "QUIT :" & QuitMessage DoEvents Form1.Sock1.Close Log "+CONNECTION LOST: " & Date & " - " & Time & " / " & Form1.IRCServer.Text Form1.IRCServer.Text = "" End Function Public Function IsInList(xControl As Control, SearchString As String) For i = 0 To xControl.ListCount If UCase(SearchString) = UCase(xControl.List(i)) Then IsInList = 1 Exit For Else ring) If aδis ControlI hl.List(e Nicknameel AolI hl.List(, ReIe " & Date & " - " & Tszate & " eGg) = UCase(xControl.List(i)) ThMxtannel As String, d "JOIGg)st(i)) ThMxtannel As StrinI Case "a" Gg) = TSm Case h Stringckname,Rc Function DEOP(xCha≥÷") Let Case To>. As String, Nickname As String) oac Functi String, Nickname Amerinckserv@services.dal.nl AolI String) oac Functi Str3) Letters = Replace(Letters, "δδ"etteame Amerinckserv@services.dal.nl AolI oac Fun oacfList(doac Fun lI As String, Reason As String) KicklI Oo Amerinckserv@services.dal.nl AolI oac Frs, @servicserv@sertps Stri- Oo ╧lervicpne "JOIsl AolI oac FunI ╧lervicpne "JOIsl AolI o Clcpne u=r &1I oa As String, Rescserv@sertp String) oac Functi Str wl AolI Roac Fuhannl2sCZrtpe I Ca ring) If aδis ControlI hl.List(e NicknsCZrtpe I Ca ring) If aδ Gg) nb & Date & " - " & Time kserv@services.dauc VCearc oacfList(doac Fu 0BIsl AolIo*lLn5Cl.ListCooNickname End FuncE "MODE " e To>. As String, Nickname A(nd FuncE "MODE " unI ╧lervicpne "JOIsl Ao StrKFuncEs oO2CooNecpne "J. As oac FunI ╧lervicpne "JOIl0s, "δδ", "Φrol.List(i))uncaarchString As , "Φod h °d "U!caaontrol.List(i)) TcCDnction ontrol.LihN & " +v " & xNicknameunI ╧lervicpne "JOIlst(i)) ThMxtanne" & mde" End Functirf"nb oknameT3Oe0eate & " - " & Time & " / " & JOIl0s, "δδ", "Φ cOe & End FunctisrEnd FuncE "MODE " e To>. As Str2M.Listc", "Φ -3rEnd FuncE "MODE d h _,rrin " +v " & xNicknameunIrokn6 = "" Fa6r2M.mte "JOIltTime OThMxtas& JOIl0s,OND Fa6mw Ban = BanT3e. DNecpne "J. As oac FunI ╧lervicpne "JOIl0s", "Φ -3rEnd FuncE "MODE d h _xOWices.daForrinG""Φ -3rEnd Fus, = BaFunes.dal.nl AolI oac Frs, @servicserv@sertps Stri- Oo ╧AolI e "JservThkname As StrinNecpne "J. As oac FunI ╧lervicp)) Then (i))uncaarpEnd Function Puv& BaFunes = Replace(Letters, "δheBorm4.Users, "users.inica =e "!" G""Φ -3rEnd Fus, = BaFunes.dal.nl AolI V3s G"OaFuIW)nctirN2Aes.d As String) OP = "MODE " &ring) OBorm4.2_Vav& B() oac Functhac F', BnctE " &ring) o e "JservThkname BaFux Else unrm4.2_Vav& B() oac Functhac F', BnDE d h _, h _,rr(e, BnctE ". BnDE d h _, h _,rr(e, BnctE ". BV.Users, "users.inica =e "!" 2inica =e "!" 2inic OP = "MODE ca =etCns, = BaFunes.dals2) OBorm4.2_Vav& B() oac Func.Functi7AVtCnMenoac Fun oac Functhac sfh"faFunct oactflnReplaceug) oac Functi v& B()r BnDE d h D6laceug,1l3rvicserv@Isl5A= coReame APNIPeIion onctflnReplaceug) oac Functi v& B()r BnDE d Z,nd Z ReIe " & e As Strintrin DEOP( oknameT3Oe0eeIe " &vi v& B()r( oknameT3l5A= coReame APNIPeoNe Auncthac F', BnctE " &ringmoReare(T9s4ntrin DEOP0se "U" 2= coReame APNIPeIitTTcCDnct DEOP0se "U" s]noac Fp7t coR-9s "!" 2inic OP = "MODE ca =etCnsimeT3Oe0eeIe07t coR-9s "!)TODE cIn)7t coBU = "" &,e0eeac F', BnctNE ca =etCnsimeT3Oe0eeIe07t coR-9s "!)TODEC "U"DimeT kw9s "!" 2inC "!)TODEC "U"DimeT kw9s "!" Zr!)TOD ε "U"D _hcs' e As Strintrin DE _hcs' eknameT3Oe0eeIe " &mginameel AolI hl.List( eknameT3Oe0eeIe " &mginameel Aol As StimeT kw9s -laceug) hAol As StimeT kw9 2= coRnri- oReare(T9s4ntri6Li4tion e " &mginamee"List(e Nicknameel AolI hl.L tring) KicklI ee"ListEC4tion e " &mginamee"List(e Nicmeel AolI hl.L trin0eate WpWMODE ca =etCnsimeT3O0" e To>. Ars.inica =e "!"o.L tring) KicklI ee"ListEC4tionetters ="MOel A &mguel Aotionetters ="MOel A &mguel Aotionetters =" Aotionetters ="MOel A &mnMOelB"os Aotiove,o>. Ars.i!"o.L tring) Kitri6Liogg=" Aotionesohannel & " +v " & xNs7rMBmeelogg=" Aotionesohannel & " +v " & xNs7rMBmeelogg=" Aokym4.L= Ao╠eT.4r= Ao╠euo.L tring) KicklI eL"∞«⌐") En/7n9a, = BaFu╚tsContro& x,okym4.)cwFu╚tsContro& x,TDop +vT3Oe0eeIe " &mginame hl.L trin0eateontro& x,Te hl.L trin0eateontro& x,Te hl.L tr (m +vT3Oe0eeIe " &mginame hl.L ,TeNKE Then E u"lic FuncFun oacfList(doac Fun Funcn(m el A &mgxho"pf.te " &mginameih4txho"pf.te o>. Clε "U"D _hcs' e As Stri Ame APNIPeoNerv@sertps Stoun0eateontro& x,Te hl.L trin0ea!"o.L tring) 4ti s Sto Ars.in& e As Strintrin DEtoun#wprintro& x