Valhalla Legends Forums Archive | Visual Basic Programming | Channel View help..

AuthorMessageTime
zeth369
im having trouble with this..

[code]
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
[/code]

[code]
        ChannelView.ChannelView.add1 , , "test", , 1
[/code]

that part is highlighted... please help
September 27, 2004, 12:15 AM
St0rm.iD
I think the problem is "add1"
September 27, 2004, 12:21 AM
zeth369
do you know what to change it too?  I've tried changing it a lot.. and it wont seem to work..
September 27, 2004, 12:27 AM
UserLoser.
It should be ListItems.Add, not Add1
September 27, 2004, 12:29 AM
zeth369
ok.. im now using ..
[code]
    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
[/code]
but it still wont work..
September 27, 2004, 12:43 AM
Yegg
Heres wut  i use:

[code]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[/code]
September 27, 2004, 12:49 AM
zeth369
ok the above still wont work..
I tried using..
[code]
'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
[/code]

without the 's of course.. I think ill stick with no icons for now.. can anyone tell me that...?
September 27, 2004, 7:31 PM
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.
September 27, 2004, 10:19 PM
Quarantine
Its the emulation server's own fault for not doing thier Flag Updates correctly.
September 28, 2004, 1:13 AM
zeth369
how would i go about making a channel list.. without icons.. :(
September 28, 2004, 1:35 AM
dRAgoN
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
September 28, 2004, 4:04 AM
zeth369
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..
September 28, 2004, 11:38 AM
JoeTheOdd
Zeth! Why did you leave me! I can fix it!

UserJoins:
[code]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[/code]

Userleaves:
[code]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[/code]

UserInChannel:
[code]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[/code]

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 :)
September 28, 2004, 3:35 PM
Grok
[quote author=JoeTheOdd link=topic=8867.msg82412#msg82412 date=1096385722]Thanks to CupHead for CSB :)[/quote]

Burn in hell, CupHead!

oops, I am off topic and a moderator :p
September 28, 2004, 7:50 PM
zeth369
:) YOUR CODE WORKS! weee.. ty lol
September 28, 2004, 7:50 PM
-MichaeL-
[quote author=Grok link=topic=8867.msg82467#msg82467 date=1096401003]
[quote author=JoeTheOdd link=topic=8867.msg82412#msg82412 date=1096385722]Thanks to CupHead for CSB :)[/quote]

Burn in hell, CupHead!

oops, I am off topic and a moderator :p
[/quote]
I think grok snapped -.-, EVERYONE RUN GROKS GONE MAD!@!@!@
September 29, 2004, 9:08 PM
Yegg
pointless post.........
September 30, 2004, 12:06 AM

Search