Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: TeEhEiMaN on May 26, 2003, 05:48 PM

Title: Why doesnt this work?
Post by: TeEhEiMaN on May 26, 2003, 05:48 PM
I think im pretty close to gettin this but, can you tell me what to change, Fix.


Private Sub channels()
If Username = Form5.txtMaster.Text Then
If Left((LCase(Message)), 12) = (Form5.txtTrigger.Text & "addchannel ") Then
Dim chanuser As String
cmbchannellist.combo.AddItem = "chanuser"
End If
End If
End Sub


Title: Re:Why doesnt this work?
Post by: ______ on May 26, 2003, 06:12 PM
You didnt set chanuser


chanuser = Right(Message, (Len(Message) - 12))

put that right above your

cmbchannellist.combo.AddItem = "chanuser"
Title: Re:Why doesnt this work?
Post by: tA-Kane on May 26, 2003, 06:12 PM
chanuser=Mid(Message,13)
cmbchannellist.combo.AddItem = chanuser
Title: Re:Why doesnt this work?
Post by: tA-Kane on May 26, 2003, 06:13 PM
Quote from: ______ on May 26, 2003, 06:12 PMYou didnt set chanuserchanuser = Right(Message, (Len(Message) - 12))put that right above yourcmbchannellist.combo.AddItem = "chanuser"
That code will still add "chanuser" instead of what's stored in chanuser.
Title: Re:Why doesnt this work?
Post by: TeEhEiMaN on May 26, 2003, 06:43 PM
I dont think that cmbchannellist.combo is right, Its suppost to be like txtchannellist.text for a text Box, but what would it be for a combo box??? please respond fast
Title: Re:Why doesnt this work?
Post by: tA-Kane on May 26, 2003, 06:45 PM
Quote from: TeEhEiMaN on May 26, 2003, 06:43 PMwhat would it be for a combo box???
Try searching on google or Microsoft...
Title: Re:Why doesnt this work?
Post by: Stealth on May 26, 2003, 06:52 PM
http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=%22combo+box%22+%22visual+basic%22+adding+items (http://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&q=%22combo+box%22+%22visual+basic%22+adding+items)

Google: The answer to the world's problems.

EDIT: Added url tags to link correctly.
Title: Re:Why doesnt this work?
Post by: OcTaViuS on May 26, 2003, 06:58 PM
Quote from: TeEhEiMaN on May 26, 2003, 06:43 PM
I dont think that cmbchannellist.combo is right, Its suppost to be like txtchannellist.text for a text Box, but what would it be for a combo box??? please respond fast

ever think to try cmbchannellist.text?
Title: Re:Why doesnt this work?
Post by: TeEhEiMaN on May 26, 2003, 07:23 PM
Nope that dont work...
Title: Re:Why doesnt this work?
Post by: TeEhEiMaN on May 26, 2003, 07:59 PM
omg this is weird!!!!!!

Why does this code not work?!


Private Sub channels()
If Username = Form5.txtMaster.Text Then
If Left((LCase(Message)), 12) = (Form5.txtTrigger.Text & "addchannel ") Then
Dim chanuser As String
chanuser = Right(Message, (Len(Message) - 12))
Combo1.AddItem = "chanuser"
End If
End If
End Sub
Title: Re:Why doesnt this work?
Post by: tA-Kane on May 27, 2003, 01:47 AM
In what way does it not work? In what way do you wish it to work? Stop being a <expletives removed>, and try to help us help you!
Title: Re:Why doesnt this work?
Post by: Soul Taker on May 27, 2003, 01:57 AM
This won't fix whatever the problem is, but I'd use

chanuser = Mid(Message, 13)

instead of

chanuser = Right(Message, (Len(Message) - 12))

... Just because it's easier to figure out at a glance (I think).
Title: Re:Why doesnt this work?
Post by: OcTaViuS on May 27, 2003, 10:39 AM
Quote from: TeEhEiMaN on May 26, 2003, 07:59 PM


Combo1.AddItem = "chanuser"


dont use quotes around chanuser
Title: Re:Why doesnt this work?
Post by: ______ on May 27, 2003, 11:12 AM
Quote from: OcTaViuS on May 27, 2003, 10:39 AM
Quote from: TeEhEiMaN on May 26, 2003, 07:59 PM


Combo1.AddItem = "chanuser"


dont use quotes around chanuser

yes otherwise your just adding "chanuser" as text not a string