• Welcome to Valhalla Legends Archive.
 

when someone joins....

Started by zeth369, October 09, 2004, 08:27 AM

Previous topic - Next topic

zeth369

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

i got this.. but it wont work..

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

hismajesty

QuotePublic 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

Usage:
QuoteAddChat("User joined using product " & ExplodeClient(product)

zeth369


Grok

Another way -- use a resource file with a string table.

Tuberload

Quote from: Grok on October 09, 2004, 02:33 PM
Another way -- use a resource file with a string table.

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.
Quote"Pray not for lighter burdens, but for stronger backs." -- Teddy Roosevelt
"Your forefathers have given you freedom, so good luck, see you around, hope you make it" -- Unknown