' This is a part of the StimBot script. There really isn't any documentation in here; ' for more info, get hold of the StimBot script and read the Readme file. ' Version 2. Dim tcpChatMaster(), sHubForwardName Sub Main() Dim i On Error Resume Next ' Change the 0 on the line below to the number of hubs you wish to forward to minus one. ' If you're forwarding to one other hub, set it to 0. If you are forwarding to 2 other hubs, set it to 1 and so on. ReDim tcpChatMaster(0) For i = 0 to UBound(tcpChatMaster) Set tcpChatMaster(i) = frmHub.Controls.Add("MSWinsock.Winsock.1", "tcpChatMaster" & Trim(CStr(i))) tcpChatMaster(i).LocalPort = 0 Next ' You need to edit this to send to the hub address and port you wish, and change BotPassword to the bot password of the hub ' you are forwarding to. If you want to forward to more than one hub, you need to ALSO have the same three lines, but with ' tcpChatMaster(1), in the same way. Also, don't forget to change the ReDim line above. tcpChatMaster(0).RemoteHost = "myhub.dns2go.com" tcpChatMaster(0).RemotePort = 411 tcpChatMaster(0).Tag = "Postman 123456" ' The name to display in the hub we're forwarding to. sHubForwardName = "MyHub" If InStr(sHubForwardName, " ") <> 0 Then sHubForwardName = Replace(sHubForwardName, " ", "_") If InStr(sHubForwardName, "$") <> 0 Then sHubForwardName = Replace(sHubForwardName, "$", "_") End Sub Sub DataArival(curUser, sCurData) Dim sUser, sMsg If Left(sCurData, 3) = "$FW" Then sUser = Trim(BeforeFirst(AfterFirst(sCurData, "$FW "), " ")) sMsg = AfterFirst(AfterFirst(sCurData, "$FW "), " ") If sUser <> "" And Trim(sMsg) <> "" Then If sUser <> Right(sMsg, Len(sUser)) Then colUsers.SendChatToAll CStr(sUser), CStr(sMsg) End If ElseIf InStr(sCurData, "$") = 0 And Len(sCurData) > 0 Then Forward curUser.sName, sCurData End If End Sub Sub Forward(sUserName, sUserMsg) ' This function forwards messages to another hub. Dim i, iCount, sPW, sLogin, sThisHubName ' Make sure we didn't get any malformed messages. If Left(Trim(sUserMsg), 1) <> "<" Then Exit Sub If InStr(sUserMsg, "> ") = 0 Then Exit Sub If InStr(sUserMsg, "$") <> 0 Then Exit Sub sUserMsg = AfterFirst(sUserMsg, "> ") If LCase(sHubForwardName) = "none" Then sThisHubName = "" Else sThisHubName = "{" & sHubForwardName & "}" End If For iCount = 0 To UBound(tcpChatMaster) sPW = AfterFirst(tcpChatMaster(iCount).Tag, " ") sLogin = BeforeFirst(tcpChatMaster(iCount).Tag, " ") If tcpChatMaster(iCount).State <> 7 Then tcpChatMaster(iCount).Close Do While i < 5000 And tcpChatMaster(iCount).State <> 0 i = i + 1 Loop i = 0 End If If tcpChatMaster(iCount).State = 0 Then tcpChatMaster(iCount).Connect Do While i < 5000 And tcpChatMaster(iCount).State <> 7 i = i + 1 Loop End If ' Make sure we're connected, otherwise don't send. If tcpChatMaster(iCount).State = 7 Then tcpChatMaster(iCount).SendData "$Key " & sPW & "|$ValidateNick " & sLogin & "|$MyPass " & sPW & "|" tcpChatMaster(iCount).SendData "$FW " & sThisHubName & sUserName & " " & sUserMsg & "|" End If Next End Sub Function AfterFirst(ByVal sIn, ByVal sFirst) ' This function returns the part of sIn which comes after the first occurrence of sFirst. ' If is not found in , the entire is returned. ' Example: AfterFirst("I like fishing in a lake.", "in") would return "g in a lake.". If InStr(1, sIn, sFirst, vbTextCompare) <> 0 Then AfterFirst = Right(sIn, Len(sIn) - InStr(1, sIn, sFirst, vbTextCompare) - (Len(sFirst) - 1)) Else AfterFirst = sIn End If End Function Function BeforeFirst(ByVal sIn, ByVal sFirst) ' This function returns the part of sIn which comes before the first occurrence of sFirst. ' If is not found in , the entire is returned. ' Example: BeforeFirst("I like fishing in a lake.", "in") would return "I like fish". If InStr(1, sIn, sFirst, vbTextCompare) <> 0 Then BeforeFirst = Left(sIn, InStr(1, sIn, sFirst, vbTextCompare) - 1) Else BeforeFirst = sIn End If End Function