• Welcome to Valhalla Legends Archive.
 

For all VB users using cleanslatebot.ocx

Started by sOuLz, December 16, 2002, 02:07 PM

Previous topic - Next topic

sOuLz

i have made a "sample" that is not tested, for users using cleanslatebot.ocx to understand the BNLS events.  like i said this source code is UNTESTED and i do not plan to update, its an example of how to use some of the Cleanslatebot.ocx events.

Private Sub CleanSlateBot1_BnetConnected()
    AddChat vbGreen, "Connected!"
End Sub

Private Sub CleanSlateBot1_BnetConnecting()
    AddChat vbYellow, "Connecting.."
End Sub

Private Sub CleanSlateBot1_BnetDisconnected()
    Cleanslatebot1.Disconnect
    AddChat vbRed, "Disconnected!"
End Sub

Private Sub CleanSlateBot1_BnetError(ErrorNumber As Integer, Description As String)
    AddChat vbRed, "Bnet error: " & ErrorNumber & " - " & Description
        Cleanslatebot1.Disconnect
        AddChat vbRed, "Disconnected!"
End Sub

Private Sub CleanSlateBot1_BNLSAuthEvent(Success As Boolean)
    If Success = True Then
    AddChat vbGreen, "BNLS Authorized!"
    Else
    AddChat vbRed, "BNLS Authorization failed!"
    End If
End Sub

Private Sub CleanSlateBot1_BNLSConnected()
    AddChat vbGreen, "Connected!"
End Sub

Private Sub CleanSlateBot1_BNLSConnecting()
    AddChat vbYellow, "Connecting..."
End Sub

Private Sub CleanSlateBot1_BNLSDisconnected()

End Sub

Private Sub CleanSlateBot1_BNLSError(ErrorNumber As Integer, Description As String)
    AddChat vbRed, "BNLS error: " & ErrorNumber & ": " & Description
End Sub

Private Sub CleanSlateBot1_FlagsUpdate(ByVal Username As String, ByVal flags As Long, ByVal Message As String, ByVal Ping As Long, SimulatedEvent As Boolean)
'add your own :P
End Sub

Private Sub CleanSlateBot1_JoinedChannel(ByVal ChannelName As String, ByVal flags As Long, SimulatedEvent As Boolean)
    AddChat vbGreen, "Joined channel: " & ChannelName & " --"
End Sub

Private Sub CleanSlateBot1_KeyReturn(KeyName As String, KeyValue As String)
'
End Sub

Private Sub CleanSlateBot1_LoggedOnAs(Username As String)
    AddChat vbYellow, "Successfully logged on as: ", vbGreen, Username, vbYellow, "!"
End Sub

Private Sub CleanSlateBot1_LogonEvent(Message As Long)
    If Message = 0 Then
        AddChat vbWhite, strTime & " ", vbRed, "Account doesn't exist!"
    ElseIf Message = 1 Then
        AddChat vbWhite, strTime & " ", vbRed, "Invalid Password!"
    ElseIf Message = 2 Then
        AddChat vbGreen, "Login successfull"
    ElseIf Message = 3 Then
        AddChat vbYellow, "Attempting to create account.."
    ElseIf Message = 4 Then
        AddChat vbGreen, "Account creation was a success!"
    End If
End Sub


Private Sub CleanSlateBot1_ServerError(ByVal Message As String, SimulatedEvent As Boolean)
    AddChat vbRed, Message
        AddChat vbRed, "<", _
        vbCyan, strCurrentUsername, _
        &H99CC00, ">", _
        vbCyan, Space(1) & Message
    End If
End Sub

Private Sub CleanSlateBot1_ServerInfo(ByVal Message As String, SimulatedEvent As Boolean)
    AddChat vbYellow, Message
End Sub

Private Sub CleanSlateBot1_SomethingUnknown(ByVal UnknownString As String, SimulatedEvent As Boolean)
    AddChat vbRed, "Something unknown"
End Sub

Private Sub CleanSlateBot1_UserEmote(ByVal Username As String, ByVal flags As Long, ByVal Message As String, SimulatedEvent As Boolean)
    AddChat vbYellow, "<" & Username & " " & Message & ">"
End Sub


Private Sub CleanSlateBot1_UserJoins(ByVal Username As String, ByVal flags As Long, ByVal Message As String, ByVal Ping As Long, ByVal Product As String, SimulatedEvent As Boolean)
    AddChat vbGreen, "-- ", __
            vbGreen, " has joined the channel using " & Message

    End Sub

Private Sub CleanSlateBot1_UserLeaves(ByVal Username As String, ByVal flags As Long, SimulatedEvent As Boolean)
    AddChat vbGreen, "-- ", vbYellow, Username, vbGreen, " has left the channel."
End Sub

Private Sub CleanSlateBot1_UserTalk(ByVal Username As String, ByVal flags As Long, ByVal Message As String, ByVal Ping As Long, SimulatedEvent As Boolean)
        AddChat &H99CC00, "<", _
        vbYellow, Username, _
        &H99CC00, ">", _
        vbWhite, Space(1) & Message
End Sub

Private Sub CleanSlateBot1_VersionCheck(Message As Long)
    If Message = 0 Then
        AddChat vbGreen, "Client has been accepted!"
    ElseIf Message = 1 Then
        AddChat vbRed, "Version check failed!"
    ElseIf Message = 2 Then
        AddChat vbGreen, "Version check passed!"
    ElseIf Message = 3 Then
        AddChat vbRed, "Version check failed!"
    ElseIf Message = 4 Then
        AddChat vbGreen, "Version check passed!"
    ElseIf Message = 5 Then
        AddChat vbGreen, "Version check passed!"
    ElseIf Message = 6 Then
        AddChat vbGreen, "Version check passed!"
    End If
End Sub

Private Sub CleanSlateBot1_WhisperFromUser(ByVal Username As String, ByVal flags As Long, ByVal Message As String, SimulatedEvent As Boolean)
    AddChat vbwhite, "<", _
        vbYellow, "<from: " & Username, _
        vbwhite, "> ", _
        &H999999, Message
        
End Sub

Private Sub CleanSlateBot1_WhisperToUser(ByVal Username As String, ByVal flags As Long, ByVal Message As String, ByVal Ping As Long, SimulatedEvent As Boolean)
    AddChat &H99CC00, "<", _
        vbYellow, "<to: " & Username, _
        &H99CC00, "> ", _
        &H999999, Message
End Sub

Mesiah-Unregister

#1
Yeah.. So wheres addchat()?  :P

Zakath

#2
void AddText( HWND hwnd, LPCTSTR TextToAdd, COLORREF color ) {
SendMessage( hwnd, EM_SETSEL, -1, -1 );
mainTextFrmt.crTextColor = color;
SendMessage( hwnd, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)(CHARFORMAT *)&mainTextFrmt );
SendMessage( hwnd, EM_REPLACESEL, FALSE, (LPARAM)TextToAdd );
}

Hey, you never said what language it should be in. :P
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

Mesiah-Unregister

#3
Lol, thank you Zak ^^ NOW I CAN MAKE A BINARY BOT W00T!

The_Lost_One

#4
can u make the addchat() in vb...?

Skywing

#5
Quotecan u make the addchat() in vb...?
That function has been posted on the board countless times already.  Perhaps you should use the search feature.

ChR0NiC

#6
I am slightly lost in the parts that werent finished, could you give me some examples of what might go in the incomplete parts?

Grok

#7
I still blame CupHead!!

Programming is not equivalent to legos or jigsaw puzzles.

Banana fanna fo fanna

#8
Agreed. Visual Bot Studio: the lego blocks are activex.

MrRaza

#9
If you want the AddChat function in Visual Basic go to:
http://www.valhallalegends.com/docs/rtbox.htm

It's in the [vL] documents section if you didn't notice and it has some good code examples in there(note* not all of them are useful, but hey). but anyway, If you also want to add more features to the AddChat function go to:

http://forum.valhallalegends.com/?board=general_prog;action=display;num=1046960370

 ;D