• Welcome to Valhalla Legends Archive.
 

Channel Display Help.

Started by Jaquio, January 17, 2004, 07:06 PM

Previous topic - Next topic

Jaquio

Wow, thanks for all the help. I did make my code smaller in size with the code and info you all told me and now I have W3XP image showing instead of when someone joins the channel the bot quits. Thank you all for helping me, If I ever need help with anything I always come here and get the problem figured out.

Hazard

By the way... you're signature is even more obnoxious than Feanor's.

"Courage is being scared to death - but saddling up anyway." --John Wayne

ChR0NiC

Quote from: Jaquio on January 18, 2004, 10:02 AM
Ok thank you. I got all that working now I just can't get Warcraft 3:tft to work... How would I do that like I did with these


   If Product = "STAR" Then
       InChannel.ListItems.add , , Username, , 6
   ElseIf Product = "SEXP" Then
       InChannel.ListItems.add , , Username, , 9
   ElseIf Product = "D2DV" Then
       InChannel.ListItems.add , , Username, , 5
   ElseIf Product = "D2XP" Then
       InChannel.ListItems.add , , Username, , 13
   ElseIf Product = "W2BN" Then
       InChannel.ListItems.add , , Username, , 10
   ElseIf Product = "WAR3" Then
       InChannel.ListItems.add , , Username, , 61
   ElseIf Product = "CHAT" Then
       InChannel.ListItems.add , , Username, , 2
   ElseIf Product = "DRTL" Then
       InChannel.ListItems.add , , Username, , 12
   ElseIf Product = "DSHR" Then
       InChannel.ListItems.add , , Username, , 1
   ElseIf Product = "JSTR" Then
       InChannel.ListItems.add , , Username, , 11
   ElseIf Product = "SSHR" Then
       InChannel.ListItems.add , , Username, , 1
   Else
       InChannel.ListItems.add , , Username, , 8
   End If
   lbPing.AddItem Ping


What would the war3:tft be?

I don't mean to be a jerk but I think Select Case might be better :D

Select Case Product

Case "STAR"
       InChannel.ListItems.add , , Username, , 6
Case "SEXP"
       InChannel.ListItems.add , , Username, , 9
Case "D2DV"
       InChannel.ListItems.add , , Username, , 5
Case "D2XP"
       InChannel.ListItems.add , , Username, , 13
Case "W2BN"
       InChannel.ListItems.add , , Username, , 10
Case "WAR3"
       InChannel.ListItems.add , , Username, , 61
Case "CHAT"
       InChannel.ListItems.add , , Username, , 2
Case "DTRL"
       InChannel.ListItems.add , , Username, , 12
Case "DSHR"
       InChannel.ListItems.add , , Username, , 1
Case "JSTR"
       InChannel.ListItems.add , , Username, , 11
Case "SSHR"
       InChannel.ListItems.add , , Username, , 1
Case  Else
       InChannel.ListItems.add , , Username, , 8
End Select
lbPing.AddItem Ping


Just incase you weren't aware of Select Case......it saves alot of time and space. And I have had more efficient results when using it. So just a suggestion  :P

R.a.B.B.i.T

Why not use Public or Global Integer Consts instead of a seperate add?

On Error GoTo OnErr1
Dim ICON As Integer
Select Case varProd
   Case "RATS"
       ICON = i_STAR
   Case "PXES"
       ICON = i_SEXP
   Case "VD2D"
       ICON = i_D2DV
   Case "PX2D"
       ICON = i_D2XP
   Case "NB2W"
       ICON = i_W2BN
   Case "3RAW"
       ICON = i_WAR3
   Case "PX3W"
       ICON = i_W3XP
   Case "TAHC"
       ICON = i_CHAT
   Case "LTRD"
       ICON = i_DRTL
   Case "RHSD"
       ICON = i_DSHR
   Case "RHSS"
       ICON = i_SSHR
   Case Else
       ICON = i_UNWN
End Select
InChannel.ListItems.Add , , UserName, , ICON
Exit Sub
OnErr1:
InChannel.ListItems.Add , , UserName, , i_UNWN

It's a lot better.

hismajesty

QuoteJust incase you weren't aware of Select Case......it saves alot of time and space. And I have had more efficient results when using it. So just a suggestion  :P

Yeah, using a switch has been said two or three times already. :P

Grok

Should also consider wrapping that into a function.

Private Function GetProductIdFromType(ProductType As String) As Integer
...


R.a.B.B.i.T

Quote from: Grok on January 20, 2004, 12:43 PM
Should also consider wrapping that into a function.

Private Function GetProductIdFromType(ProductType As String) As Integer
...


Long function name..why not just GetIcon(Product As String) As Integer?

SKiLLs

#22
Quote from: UserLoser. on January 18, 2004, 02:13 PMConverting the TGA to a JPG/BMP - isn't that a bit hard to do?

I use IrfanView :
http://download.com.com/3000-2192-10223761.html

and it's FREE!!

Tuberload

Quote from: R.a.B.B.i.T on January 20, 2004, 05:14 PM
Quote from: Grok on January 20, 2004, 12:43 PM
Should also consider wrapping that into a function.

Private Function GetProductIdFromType(ProductType As String) As Integer
...


Long function name..why not just GetIcon(Product As String) As Integer?

Some people like to use long, descriptive method/variabled names because it makes it easier for others to understand, as well as yourself if you leave a project and come back to it after a long period of time.
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