|
| Author |
Message |
StaticSpear Newbie

Joined: 17 Oct 2006 Posts: 5 Location: New Zealand
        
|
Posted: Thu Oct 19, 2006 9:15 pm Post subject: vb.net nicklist |
|
|
now i know this prolly wont help alot of you but i am only new to bot programming and i figure why not post what i learn in the hopes it helps others like me this is simple and does not much at all but it could help in some situations i think this works in messenger 4.7 havnt tried it useing windows live messenger
open up vb.net 2005 if you dont have it and u are interested then find a torrent or go download express edition
click project>add refference>com>messenger api
then add a listbox to your form keep it named listbox 1
add the following code to the code section
| Code: |
Imports MessengerAPI
Public Class Form1
Dim msn As New Messenger()
Dim contacts As IMessengerContacts
Dim contact As IMessengerContact
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
contacts = msn.MyContacts
For Each contact In contacts
ListBox1.Items.Add(contact.FriendlyName)
Next
End Sub
End Class
|
now whenever you open it all the contacts will be in your listbox hope this helps sum1 _________________ With the Source Code ill control the world |
|
| Back to top |
|
 |
StaticSpear Newbie

Joined: 17 Oct 2006 Posts: 5 Location: New Zealand
        
|
Posted: Fri Oct 20, 2006 11:27 am Post subject: |
|
|
now i have made this code as an addon to the last but it will still be posted in full ource code i have also commented it (ALOT) for the extreme nOoB to vb.net being noob is not bad by the way i belve i am still noob no doubt anyways this new data in the code alows you to change your status altho it is kinda slow i belive it will give some people a hint in the right direction please i ask trhat anything that you do to this bot / source code it isnt really a bot yet and omg i go on im quite drunk and i just got home but i ask that you make it open source and share what you have done here to assist in helping new vb.net programmers as i am trying to do anyways heres the code .... if you are starting from scratch then you will need to add a combobox and a listbox and a timer .. keep all as there defult name then add the folowing code to the code section
| Code: |
Imports MessengerAPI 'import the messenger api witch is wat we are working with
Public Class Form1
'the following are like global declarations they can be used anywhere in our code
Public WithEvents msn1 As New MessengerAPI.Messenger
Dim msn As New Messenger() 'declare msn(our version) as the messenger
Dim contacts As IMessengerContacts 'declare contacts and msn contacts
Dim contact As IMessengerContact ' similar to above
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
contacts = msn.MyContacts ' declare that contacts(our version) = the actual contacts(normal version)
'^we do this to make it easier to recognise and work woth among other reasons^
For Each contact In contacts 'scroll through all the contacts similar to
'a cigarete in a pacet of cigaretes (for every ciggarete in the pack of ciggaretes)
ListBox1.Items.Add(contact.FriendlyName)
Next
Timer1.Enabled = True 'enable the timer control so it can later be used to change our status
Timer1.Interval = 1 'set the timers interval to 1 millisecond so every millisecond it checks if the codes changed
ComboBox1.Items.Add("online") '2/ add user friendly status names to the combo box
ComboBox1.Items.Add("brb") '14
ComboBox1.Items.Add("busy") '10
ComboBox1.Items.Add("on the phone") '50
ComboBox1.Items.Add("out to lunch") '66
ComboBox1.Items.Add("apear offline") '6
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'i chose a timer because it constantly loops throught he code
'makeing it able to change status without the need for a button
'this will work tho it is a bit buggy ill wwork on it wwhen i have more time
If ComboBox1.Text = "online" Then 'if the text in the combobo = online then
msn.MyStatus = 2 'set status to online
End If ' all ifs need an end if
If ComboBox1.Text = "brb" Then
msn.MyStatus = 14 'set status to brb
End If
If ComboBox1.Text = "busy" Then
msn.MyStatus = 10 'set status to busy
End If
If ComboBox1.Text = "on the phone" Then
msn.MyStatus = 50 'set status to on the phone
End If
If ComboBox1.Text = "out to lunch" Then
msn.MyStatus = 66 'set status to out to lunch
End If
If ComboBox1.Text = "apear offline" Then
msn.MyStatus = 6 'set status to apear offline
End If
End Sub
End Class
|
this will change your messenger status aswell as add all your contacts to the list box it is well comented please send me all critasisims as it willl only help me learn  _________________ With the Source Code ill control the world |
|
| Back to top |
|
 |
StaticSpear Newbie

Joined: 17 Oct 2006 Posts: 5 Location: New Zealand
        
|
Posted: Fri Oct 20, 2006 11:35 am Post subject: |
|
|
this will make your form display your nick name in messenger
add 2 textbox controls to the form and keep there names as it is and add this single line of code to your "timer1 tick event" dosent really mater where as long as its not in one of the if statements =)
| Code: |
'this will make textbox1 display your user name
TextBox1.Text = msn1.MyFriendlyName.ToString
'this code will displayt your ewmail address
TextBox2.Text = msn1.MySigninName.ToString
|
you may as why i didnty just edit the same post all 3 times?? well its because i figure its easier to understand / what is being added to the pre existing code =) anyways im realy um smashed right now no shit so have fun all even tho noone is reading this forum if its because its stupid say so and i will stp posting stuff in it  _________________ With the Source Code ill control the world |
|
| Back to top |
|
 |
darkmonkey The Merovingian

Joined: 18 Apr 2004 Posts: 2557 Location: London, England
     votes: 7
|
Posted: Sun Oct 22, 2006 3:50 pm Post subject: |
|
|
Thank you. I don't code VB, but your input is certainly appreciated in this communtiy  _________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ] |
|
| Back to top |
|
 |
|