• Welcome to Valhalla Legends Archive.
 

Channel View help..

Started by zeth369, September 26, 2004, 07:15 PM

Previous topic - Next topic

zeth369

im having trouble with this..


Private Sub CSB_UserInChannel(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, ByVal Ping As Long, ByVal Product As String, StatUpdate As Boolean, SimulatedEvent As Boolean)

   Dim producticon As Integer
   Dim lagicon As Integer
   producticon = iGetProduct(Product, Flags)
   lagicon = iGetPing(Ping)
   If producticon = iOPS Then
        ChannelView.ChannelView.add1 , , "test", , 1
           ChannelView.ListSubItems.Add , , , lagicon
         
   Else
         With ChannelView.ListItems.Add(, , Username, , producticon)
           .ListSubItems.Add , , , lagicon
         End With
   End If
End Sub



        ChannelView.ChannelView.add1 , , "test", , 1


that part is highlighted... please help

Banana fanna fo fanna

I think the problem is "add1"

zeth369

do you know what to change it too?  I've tried changing it a lot.. and it wont seem to work..

UserLoser.

It should be ListItems.Add, not Add1

zeth369

ok.. im now using ..

    Dim producticon As Integer
   Dim lagicon As Integer
   Dim Product As String
   lagicon = iGetPing(Ping)
   Product = Mid(Message, 4, 1) & Mid(Message, 3, 1) & Mid(Message, 2, 1) & Left(Message, 1)
   producticon = iGetProduct(Product, Flags)
   ChannelView.ListItems.Remove ChannelView.FindItem(Username).Index
   If producticon = iOPS Then
         With ChannelView.ListItems.Add(1, , Username, , producticon)
           .ListSubItems.Add , , , lagicon
         End With
   Else
         With ChannelView.ListItems.Add(, , Username, , producticon)
           .ListSubItems.Add , , , lagicon
         End With
   End If

but it still wont work..

Yegg

Heres wut  i use:

Private Sub CleanSlateBot1_UserInChannel(ByVal username As String, ByVal Flags As Long, ByVal Message As String, ByVal Ping As Long, ByVal Product As String, StatUpdate As Boolean, SimulatedEvent As Boolean)
    strJSTR = Product
    strSexp = Product
    strSTAR = Product
    strd2 = Product
    strD2XP = Product
    strW2BN = Product
    strw3 = Product
    strDiablo = Product
    strW3XP = Product
Dim icon As Integer
Dim lagicoN As Integer
If icon = ICON_GAVEL Then
With Form1.lvChannel.ListItems.Add(1, username, username, , icon)
    .ListSubItems.Add lvChannel.FindItem(username).Index, , , lagicoN
    End With
End If
If icon <> ICON_GAVEL Then
    With Form1.lvChannel.ListItems.Add(, , username, , icon)
    .ListSubItems.Add , , , lagicoN
    End With
End If

zeth369

ok the above still wont work..
I tried using..

'Private Sub CSB_UserInChannel(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, ByVal Ping As Long, ByVal Product As String, StatUpdate As Boolean, SimulatedEvent As Boolean)
'Username = Replace(Username, "*", vbNullString)
'Dim ProductIcon As Integer, LagIcon As Integer
'ProductIcon = iGetProduct(Product, Flags)
'LagIcon = IIf(Flags = 16 Or Flags = 18 Or Flags = 48 Or Flags = 50, PLUG, iGetPing(Ping))
'
'  If ProductIcon = OPS Then
' With ChannelView.ListItems.Add(1, , Username, , ProductIcon)
'      .ListSubItems.Add , , , LagIcon
'      .ToolTipText = "Ping: " & Ping & " Flags: " & Flags
'          'change Tool Tip to w/e you want
'    End With
'  Else
'    With ChannelView.ListItems.Add(, , Username, , ProductIcon)
'      .ListSubItems.Add , , , LagIcon
'      .ToolTipText = "Ping: " & Ping & " Flags: " & Flags
              'change tool tip here aswell (if u want)
'    End With
  ' End If
   'lblChannel.Caption = Channel & " (" & ChannelView.ListItems.Count & ")"
      'change lblChannel.Caption to the name of the label/textbox u called it
'End Sub


without the 's of course.. I think ill stick with no icons for now.. can anyone tell me that...?

Yegg

I think no icons is good, my bots prettty stable now with its commands and i do not use icons, not using icons also allows u to connect to servers like us-best.net with no trouble.

Warrior

Its the emulation server's own fault for not doing thier Flag Updates correctly.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

zeth369

how would i go about making a channel list.. without icons.. :(

l)ragon

1. Does ChannelView have 2 columns or 1?
2. Did you add the ImageList?
3. Does that ImageList have any icons in it?
4. Giveing up defeats the purpose of trying to be better :P
*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*ˆ¨¯¯¨ˆ*^~·.,l)ragon,.-·~^*ˆ¨¯¯¨ˆ*^~·.,¸¸,.·´¯`·.,¸¸,.-·~^*

zeth369

#11
1.2
2.yes
3.yes
4. this is my first version of my first bot.. so i think no icons would be ok for now..

Joe[x86]

Zeth! Why did you leave me! I can fix it!

UserJoins:
Private Sub CSB_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 vbWhite, Username & " joined the channel"
    Dim producticon As Integer
   Dim lagicon As Integer
   producticon = iGetProduct(Product, Flags)
   lagicon = iGetPing(Ping)
   If producticon = iOPS Then
         With lvChannel.ListItems.Add(1, , Username, , producticon)
           .ListSubItems.Add , , , lagicon
         End With
   Else
         With lvChannel.ListItems.Add(, , Username, , producticon)
           .ListSubItems.Add , , , lagicon
         End With
   End If
End Sub


Userleaves:
Private Sub CSB_UserLeaves(ByVal Username As String, ByVal Flags As Long, SimulatedEvent As Boolean)
AddChat vbWhite, Username & " has left the channel"
    On Error Resume Next
   lvChannel.ListItems.Remove ChannelView.FindItem(Username).Index
End Sub


UserInChannel:
Private Sub CSB_UserInChannel(ByVal Username As String, ByVal Flags As Long, ByVal Message As String, ByVal Ping As Long, ByVal Product As String, StatUpdate As Boolean, SimulatedEvent As Boolean)
   Dim producticon As Integer
   Dim lagicon As Integer
   producticon = iGetProduct(Product, Flags)
   lagicon = iGetPing(Ping)
   If producticon = iOPS Then
         With lvChannel.ListItems.Add(1, , Username, , producticon)
           .ListSubItems.Add , , , lagicon
         End With
   Else
         With lvChannel.ListItems.Add(, , Username, , producticon)
           .ListSubItems.Add , , , lagicon
         End With
   End If
End Sub


Kinda.. ignore the icon stuff.. my bot uses that exact code and no icons show up ;)

That code asumes that you use lvChannel for for your channel LV

Thanks to Darkness[e1] for the Channel List code. Thanks to CupHead for CSB :)
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

Grok

Quote from: JoeTheOdd on September 28, 2004, 10:35 AMThanks to CupHead for CSB :)

Burn in hell, CupHead!

oops, I am off topic and a moderator :p

zeth369

:) YOUR CODE WORKS! weee.. ty lol