Is it possible to ignore someone?
Hey guys. I made a program called MHX Homework Helper. It also includes a live homework help chat room thing. But there is no ignore option to iggy the annoying ones. See the program works by you connect to the server IP, then you are on a list of users in the chat. Is there a way that you can click on a username and click ignore from a drop down menu or something?
If you need any info on how the chat program works like code or etc. Just ask. OR if you would like some help with your homework..... join it lol
but really all help is appreciated.
Re: Is it possible to ignore someone?
are you using the vSixC chat control?
Re: Is it possible to ignore someone?
I do not know I know it uses winsock though. I can post the code is that would help??
Re: Is it possible to ignore someone?
Posting the code would help. It'd probably be real simple to put in an ignore feature. No need to post the server code, just the client.
Re: Is it possible to ignore someone?
'' Code for opening webpages ''
vb Code:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
ByVal hWnd As Long, _
ByVal lpOperation As String, _
ByVal lpFile As String, _
ByVal lpParameters As String, _
ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Private Declare Function GetTickCount& Lib "kernel32" ()
Private Sub Title(What As String) 'Sets the caption of the window to "Chat [What]"
Me.Caption = "MHX Homework Helper - Live Help [" & What & "]"
End Sub
Private Sub AddText(Who, WhatText) 'Adds text to the chat-window
txtChat.Text = txtChat.Text & "-=" & Who & "=-" & vbCrLf 'First the name of the user
txtChat.Text = txtChat.Text & WhatText & vbCrLf 'And then the text
txtChat.SelStart = Len(txtChat.Text) 'Roll the window when text doesn't fit.
End Sub
Private Sub Command1_Click()
Chat.Hide
frmHomeworkMain.Show
End Sub
Private Sub con_Click() 'Connect button
Dim Server As String
Server = InputBox("Please write IP or HostName.", "Connect", "LocalHost")
sock.Close 'Close it before trying to connect, in case it's already connected.
sock.Connect Server, 8765
End Sub
Private Sub Form_Load()
Title "Disconnected"
Dim i As Long
For i = 0 To Screen.FontCount - 1
Combo1.AddItem Screen.Fonts(i)
Next i
Combo1.ListIndex = 0
txtOut.Font =
End Sub
Private Sub Image1_Click()
ShellExecute Me.hWnd, "open", "http://www.geocities.com/nitrogenocide2003/MHXDonate.html", vbNullString, vbNullString, ByVal 1&
End Sub
Private Sub sock_Close()
Title "Disconnected"
End Sub
Private Sub sock_Connect()
Dim msg As String
Title "Connected"
DoEvents 'Without the DoEvents sock will not send the data because sock haven't
msg = "name|" & txtName.Text 'connected yet.
sock.SendData msg 'Send our name.
Chat.Label3.Caption = "ONLINE"
End Sub
Private Sub sock_DataArrival(ByVal bytesTotal As Long) 'When someone sends us data.
Dim GetIt As String
sock.GetData GetIt
msg = Split(GetIt, "|")
Select Case msg(0)
Case "cons" 'Server sends us the list of connected users.
List.Clear
For i = 1 To UBound(msg) - 1
List.AddItem msg(i)
Next i
Case "text" 'Server sends us text, transfered from some other user.
AddText msg(1), msg(2)
End Select
End Sub
Private Sub txtOut_KeyDown(KeyCode As Integer, Shift As Integer) 'When pressed enter, send the text.
If KeyCode = 13 Then
AddText txtName.Text, txtOut.Text
sock.SendData "text|" & txtOut.Text
txtOut.Text = ""
End If
End Sub
It needs some finishing up because I never finished putting in the code to let you chose the font. But I don't think that should stop the ignore option.
Re: Is it possible to ignore someone?
Justin [VBCode] tags no longer work so I edited yours.
Re: Is it possible to ignore someone?
Quote:
Originally Posted by Justin M
vb Code:
Private Sub AddText(Who, WhatText) 'Adds text to the chat-window
txtChat.Text = txtChat.Text & "-=" & Who & "=-" & vbCrLf 'First the name of the user
txtChat.Text = txtChat.Text & WhatText & vbCrLf 'And then the text
txtChat.SelStart = Len(txtChat.Text) 'Roll the window when text doesn't fit.
End Sub
If that is the sub you use to display messages, you could just do a simple if/then before. ie:
vb Code:
If IsOnIgnore(Who) Then Exit Sub
And making your IsOnIgnore() a simple function that returns TRUE if the user is on the ignore list.
How you make the ignore list is up to you, could just be a simple text file with the usernames. Then load that into an array or collection when your program loads, and loop through the array/collection to see if the user is on the ignore list.
Re: Is it possible to ignore someone?
Oh thanks, I never heard it changed, why is that? and what should i use instead?
Re: Is it possible to ignore someone?
It was a hack that was too difficult to maintain across upgrades and since we did just recently upgrade we dropped it. You can use either [highlight=vb][/highlight] or [code][/code]. The former is a little tricky to copy (see the two "new" links in my signature) and does not follow VB6's coloring conventions and the latter is difficult for the original poster to edit.