Results 1 to 9 of 9

Thread: Is it possible to ignore someone?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Posts
    2,295

    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.

  2. #2
    Addicted Member
    Join Date
    Mar 2007
    Posts
    203

    Re: Is it possible to ignore someone?

    are you using the vSixC chat control?

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Posts
    2,295

    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??

  4. #4
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    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.

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Posts
    2,295

    Re: Is it possible to ignore someone?

    '' Code for opening webpages ''
    vb Code:
    1. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" ( _
    2. ByVal hWnd As Long, _
    3. ByVal lpOperation As String, _
    4. ByVal lpFile As String, _
    5. ByVal lpParameters As String, _
    6. ByVal lpDirectory As String, _
    7. ByVal nShowCmd As Long) As Long
    8. Private Declare Function GetTickCount& Lib "kernel32" ()
    9.  
    10.  
    11. Private Sub Title(What As String) 'Sets the caption of the window to "Chat [What]"
    12. Me.Caption = "MHX Homework Helper - Live Help [" & What & "]"
    13. End Sub
    14.  
    15. Private Sub AddText(Who, WhatText)                          'Adds text to the chat-window
    16. txtChat.Text = txtChat.Text & "-=" & Who & "=-" & vbCrLf    'First the name of the user
    17. txtChat.Text = txtChat.Text & WhatText & vbCrLf             'And then the text
    18. txtChat.SelStart = Len(txtChat.Text)                        'Roll the window when text doesn't fit.
    19. End Sub
    20.  
    21. Private Sub Command1_Click()
    22. Chat.Hide
    23. frmHomeworkMain.Show
    24. End Sub
    25.  
    26. Private Sub con_Click() 'Connect button
    27. Dim Server As String
    28. Server = InputBox("Please write IP or HostName.", "Connect", "LocalHost")
    29. sock.Close                  'Close it before trying to connect, in case it's already connected.
    30. sock.Connect Server, 8765
    31. End Sub
    32.  
    33. Private Sub Form_Load()
    34. Title "Disconnected"
    35. Dim i As Long
    36.     For i = 0 To Screen.FontCount - 1
    37.         Combo1.AddItem Screen.Fonts(i)
    38.     Next i
    39.     Combo1.ListIndex = 0
    40.    
    41. txtOut.Font =
    42. End Sub
    43.  
    44. Private Sub Image1_Click()
    45. ShellExecute Me.hWnd, "open", "http://www.geocities.com/nitrogenocide2003/MHXDonate.html", vbNullString, vbNullString, ByVal 1&
    46. End Sub
    47.  
    48. Private Sub sock_Close()
    49. Title "Disconnected"
    50. End Sub
    51.  
    52. Private Sub sock_Connect()
    53. Dim msg As String
    54. Title "Connected"
    55. DoEvents                        'Without the DoEvents sock will not send the data because sock haven't
    56. msg = "name|" & txtName.Text    'connected yet.
    57. sock.SendData msg 'Send our name.
    58. Chat.Label3.Caption = "ONLINE"
    59. End Sub
    60.  
    61. Private Sub sock_DataArrival(ByVal bytesTotal As Long)  'When someone sends us data.
    62. Dim GetIt As String
    63. sock.GetData GetIt
    64. msg = Split(GetIt, "|")
    65. Select Case msg(0)
    66.     Case "cons"     'Server sends us the list of connected users.
    67.         List.Clear
    68.         For i = 1 To UBound(msg) - 1
    69.             List.AddItem msg(i)
    70.         Next i
    71.     Case "text"     'Server sends us text, transfered from some other user.
    72.         AddText msg(1), msg(2)
    73. End Select
    74. End Sub
    75.  
    76. Private Sub txtOut_KeyDown(KeyCode As Integer, Shift As Integer)    'When pressed enter, send the text.
    77. If KeyCode = 13 Then
    78.     AddText txtName.Text, txtOut.Text
    79.     sock.SendData "text|" & txtOut.Text
    80.     txtOut.Text = ""
    81. End If
    82. 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.

  6. #6

  7. #7
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Re: Is it possible to ignore someone?

    Quote Originally Posted by Justin M
    vb Code:
    1. Private Sub AddText(Who, WhatText)                          'Adds text to the chat-window
    2. txtChat.Text = txtChat.Text & "-=" & Who & "=-" & vbCrLf    'First the name of the user
    3. txtChat.Text = txtChat.Text & WhatText & vbCrLf             'And then the text
    4. txtChat.SelStart = Len(txtChat.Text)                        'Roll the window when text doesn't fit.
    5. End Sub
    If that is the sub you use to display messages, you could just do a simple if/then before. ie:

    vb Code:
    1. 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.

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    May 2006
    Posts
    2,295

    Re: Is it possible to ignore someone?

    Oh thanks, I never heard it changed, why is that? and what should i use instead?

  9. #9
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width