Valhalla Legends Archive

Programming => General Programming => Visual Basic Programming => Topic started by: zeth369 on September 26, 2004, 07:15 PM

Title: Channel View help..
Post by: zeth369 on September 26, 2004, 07:15 PM
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
Title: Re: Channel View help..
Post by: Banana fanna fo fanna on September 26, 2004, 07:21 PM
I think the problem is "add1"
Title: Re: Channel View help..
Post by: zeth369 on September 26, 2004, 07:27 PM
do you know what to change it too?  I've tried changing it a lot.. and it wont seem to work..
Title: Re: Channel View help..
Post by: UserLoser. on September 26, 2004, 07:29 PM
It should be ListItems.Add, not Add1
Title: Re: Channel View help..
Post by: zeth369 on September 26, 2004, 07:43 PM
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..
Title: Re: Channel View help..
Post by: Yegg on September 26, 2004, 07:49 PM
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
Title: Re: Channel View help..
Post by: zeth369 on September 27, 2004, 02:31 PM
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...?
Title: Re: Channel View help..
Post by: Yegg on September 27, 2004, 05:19 PM
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.
Title: Re: Channel View help..
Post by: Warrior on September 27, 2004, 08:13 PM
Its the emulation server's own fault for not doing thier Flag Updates correctly.
Title: Re: Channel View help..
Post by: zeth369 on September 27, 2004, 08:35 PM
how would i go about making a channel list.. without icons.. :(
Title: Re: Channel View help..
Post by: l)ragon on September 27, 2004, 11:04 PM
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
Title: Re: Channel View help..
Post by: zeth369 on September 28, 2004, 06:38 AM
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..
Title: Re: Channel View help..
Post by: Joe[x86] on September 28, 2004, 10:35 AM
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 :)
Title: Re: Channel View help..
Post by: Grok on September 28, 2004, 02:50 PM
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
Title: Re: Channel View help..
Post by: zeth369 on September 28, 2004, 02:50 PM
:) YOUR CODE WORKS! weee.. ty lol
Title: Re: Channel View help..
Post by: Michael on September 29, 2004, 04:08 PM
Quote from: Grok on September 28, 2004, 02:50 PM
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
I think grok snapped -.-, EVERYONE RUN GROKS GONE MAD!@!@!@
Title: Re: Channel View help..
Post by: Yegg on September 29, 2004, 07:06 PM
pointless post.........