hai gan , kali ne ane mau ngasih ""Sample Join room, leave room, chat room Mig33 (vb6)"".. Kemaren udah Kalian pelajari Source login Mig33 kan :D, Kalo belum Pelajari Dulu
Di sini!!!..ok
Sekarang Buka Lagi Project Login yang Kalian buat!! Kalian Tambahin CommandButtom dan TextBox lagi.
Kalian Bikin 3 textbox dan 3 commandbuttom.
bikin textbox kasih nama "Room" trus bikin lagi textbox kasih nama "Chat" <<gunanya untuk nampilin chatnya. 1 lagi bikin textbox kasih nama sendtext. kalo sudah bikin lagi 3 commandbuttom kasih nama cmdenter,cmdleave,cmdsend..
Pada Textbox "Chat" yang kalian buat, di klik kanan Terus Property Cari Multiline yang tadinya "False" kalian Ubah Menjadi "True" .
Lanjut tinggal mengisi coding2
Sck.SendData (0), JoinRoom(Room) << masukin di CmdEnter, Gunanya buat Joinroom
Sck.SendData (0), LeaveRoom(Room) << masukin di CmdLeave, Gunanya buat Leave Room
yang ini dimasukin di CmdSend, gunanya untuk send text yang kita ketik buat masuk di Chat..
lanjutt....
Sck.SendData (0), sendtextroom(txtUname, sendtext, Room)
Chat.SelStart = Len(Chat.text)
Chat.ForeColor = vbBlue ' WARNA ID KITA, biSA DIUBAH sesuai selera
Chat.SelText = txtUname.text & ": "
Chat.ForeColor = vbBlack
Chat.SelText = sendtext.text & vbCrLf
Chat.SelStart = Len(RTB.text)
sendtext.SetFocus
sendtext.text = ""
Masukin Text di bawah di DataArrival Letakin di paling bawah!!!
'===============================================CHATROOM
Dim ichat As Integer
If A = "0201F400" Then
text() = Split(Datin, Right(Mid$(Datin, 10, Unhex(A2H(Mid$(Datin, 8, 2)))), 2))
For ichat = 0 To UBound(text())
C = Left(text(ichat), 4)
If C = (H2A(A)) Then
TextCode (ichat) ' UNTUK CHAT ROOM
End If
Next ichat
End If
'=======================================
kalo sudah, Masukin Coding DI bawah
Private Sub TextCode(Index As Integer) ' CHATROOOM CODE
On Error Resume Next
Dim A, b, C, D
Ssize = A2H(Mid(text(Index), 12, 4))
A = Unhex(Ssize)
Sender = Mid(text(Index), 16, A)
b = 18 + A
Rsize = A2H(Mid(text(Index), b, 4))
C = Unhex(Rsize): b = b + 4
Rname = Mid(text(Index), b, C)
b = b + C + 2
Tsize = A2H(Mid(text(Index), b, 4))
D = Unhex(Tsize)
b = b + 4
Tisi = LCase(Mid(text(Index), b, D))
'================ Nampilin text Admin & Merchont ===================
Dim sText As String
Dim splace As String
Dim rText As String
Dim rplace As String
Dim tText As String
Dim tplace As String
splace = InStr(1, Datin, H2A("00020000"))
sText = Unhex(A2H(Mid$(Datin, splace + 2, 4)))
rplace = InStr(1, Datin, H2A("00040000"))
rText = Unhex(A2H(Mid$(text(Index), rplace + 2, 4)))
tplace = InStr(1, Datin, H2A("00080000"))
tText = Unhex(A2H(Mid$(text(Index), tplace + 2, 4)))
Tisi = Mid$(text(Index), tplace + 6, tText)
With Chat
If Sender = Rname Then
.ForeColor = vbRed
Else
.ForeColor = vbBlue
End If
.SelText = Sender
.ForeColor = vbRed
.SelText = ": " & Tisi & vbCrLf
End With
Chat.SelStart = Len(Chat.text)
End Sub
Coding Di atas Gunanya Buat Code Dalam Chat nya ...
Oke Selesai Sudah Membuat Source Join Room, Leave Room Dan Chat Room
Selamat Mencobaa :D :D