Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 29th, 2003, 04:58 PM
icex icex is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 icex User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy I need some helper

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

Reply With Quote
  #2  
Old December 29th, 2003, 11:29 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
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.

Reply With Quote
  #3  
Old December 30th, 2003, 08:32 AM
icex icex is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 icex User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you. I had to add a command button to make it work. Can I add you to msn messanger?

Reply With Quote
  #4  
Old December 30th, 2003, 07:59 PM
cleverpig cleverpig is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jul 2003
Posts: 1,152 cleverpig User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via MSN to cleverpig
yes,I'm glad to be friend with u!
My MSN:great_liudan@hotmail.com
..Wait for your msn...

Reply With Quote
  #5  
Old December 30th, 2003, 10:01 PM
icex icex is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 icex User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i just added u

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > I need some helper


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway