Valhalla Legends Forums Archive | Visual Basic Programming | when someone joins....

AuthorMessageTime
zeth369
how do i get the product code to change to something like "STarCraft" or "StarCraft BroodWar"?

i got this.. but it wont work..
[code]
If frmSettings.Check2.Value = vbChecked Then
ElseIf Product = "RATS" Then
AddChat vbGreen, "-- ", vbYellow, Username & " [" & Ping & "ms] ", vbGreen, "has joined the channel using StarCraft."
ElseIf Product = "PXES" Then
AddChat vbGreen, "-- ", vbYellow, Username & " [" & Ping & "ms] ", vbGreen, "has joined the channel using StarCraft BroodWar."
End If[/code]
October 9, 2004, 1:27 PM
hismajesty
[quote]Public Function ExplodeClient(product As String) As String

Select Case UCase(product)
    Case "STAR"
        ExplodeClient = "Starcraft"
    Case "SEXP"
        ExplodeClient = "Starcraft: Broodwar"
    Case "JSTR"
        ExplodeClient = "Starcraft: Japanese"
    Case "SSHR"
        ExplodeClient = "Starcraft: Shareware"
    Case "W2BN"
        ExplodeClient = "Warcraft II: Battle.net Edition"
    Case "WAR3"
        ExplodeClient = "Warcraft III: Reign of Chaos"
    Case "W3XP"
        ExplodeClient = "Warcraft III: The Frozen Throne"
    Case "DRTL"
        ExplodeClient = "Diablo Retail"
    Case "DSHR"
        ExplodeClient = "Diablo Shareware"
    Case "D2DV"
        ExplodeClient = "Diablo II"
    Case "D2XP"
        ExplodeClient = "Diablo II: Lord of Destruction"
    Case "CHAT"
        ExplodeClient = "chat bot"
    Case Else
        ExplodeClient = "an Unknown Product"
End Select

End Function[/quote]

Usage:
[quote]AddChat("User joined using product " & ExplodeClient(product)[/quote]
October 9, 2004, 2:08 PM
zeth369
thank you.. :) it works..
October 9, 2004, 2:34 PM
Grok
Another way -- use a resource file with a string table.
October 9, 2004, 7:33 PM
Tuberload
[quote author=Grok link=topic=9062.msg83766#msg83766 date=1097350417]
Another way -- use a resource file with a string table.
[/quote]

To try and elaborate more on this, the reason this method would be more beneficial is it would keep you from having to update the bots code when new products types need to be added. All you would have to do is update the resource file.
October 10, 2004, 12:51 AM

Search