|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Im making a msn messanger bot and im wanting the code for if somone says !status away or !status busy my status will change to what they want. I know its possible cause I had the code before but now I just got visual basic 4 - 6 days ago.
Help is appreciated ![]() |
|
#2
|
|||
|
|||
|
This is msn bot sample code..
Automation of MSN Messenger from VB Code Tested with VB6 Courtesy of Nicole Jordan This program is used when there are multiple MSN/Hotmail accounts on the same computer. You will need a form with a frame, and as many option buttons (in a control array) as e-mail accounts. 1 - Start a new, standard VB project. 2 - Add a frame to the form. 3 - Add the required number of option buttons in an array on the frame, with indexes beginning at 0. This example uses a total of two, with indexes of 0 and 1. You might want to caption each option button to indicate the account it logs onto. 4 - Add a reference to the Messenger Type Library (msmsgs.exe). 5 - Place the following code in the General Declarations section of the form code: Option Explicit Dim Msgrobj As New MsgrObject Dim MsgrSrvobj As IMsgrService Private Sub Form_Unload(Cancel As Integer) 'set the object to nothing Set Msgrobj = Nothing Set MsgrSrvobj = Nothing End Sub Private Sub Optname_Click(Index As Integer) Dim i As Integer On Error Resume Next 'tests to see if msn messenger is logged in If Msgrobj.LocalState <> MSTATE_OFFLINE Then 'If it is logged in then it logs off Msgrobj.Logoff 'Used Do Events to give Msn Messenger time to _ log off before logging in again For i = 0 To 20000 DoEvents Next End If 'This logs in to the email specified below 'The number of case statements, and option buttons, _ is determined by the number of e-mails accounts. Select Case Index Case 0 'these use the messenger object logon method _ with the username, password, imsgservice (which _ is a object in the messenger library) as arguments 'Change e-mail address and password below to _ the correct values for the password and address _ to be used in each case. Msgrobj.Logon "e-mail address", "password", MsgrSrvobj Case 1 Msgrobj.Logon "e-mail address", "password", MsgrSrvobj End Select Unload Me End Sub 5 – Run the program and test. Click on each option as desired to see if Messenger logs onto the appropriate account. Further explorations of what can be done through automation of Messenger are left as an exercise for the reader. |
|
#3
|
|||
|
|||
|
Thank you. I had to add a command button to make it work. Can I add you to msn messanger?
|
|
#4
|
|||
|
|||
|
yes,I'm glad to be friend with u!
My MSN:great_liudan@hotmail.com ..Wait for your msn... |
|
#5
|
|||
|
|||
|
i just added u
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > I need some helper |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|