Advertisement
Guest User

Untitled

a guest
May 2nd, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. import clr
  2. clr.AddReference("BaseWindowsProtocolLibrary")
  3. from InstantMessage import *
  4. from System.Net import *
  5. from System.IO import *
  6.  
  7. IMSettings.SettingInterface = BasicXmlSettingsBinding("C:\test.xml")
  8. IMSettings.SettingInterface.AutoSave = False # Avoiding the problem
  9.  
  10. ServicePointManager.Expect100Continue = False
  11.  
  12. protocol = IMYahooProtocol()
  13. protocol.Username = "[username]"
  14. protocol.Password = "[password]"
  15. protocol.Status = IMStatus.AVAILABLE
  16. protocol.Login()
  17. protocol.LoginWaitHandle.WaitOne(-1) # Since Login is async, the script will end before we even connect. We need to prevent this
  18.  
  19. for x in range(0, 5):
  20.     protocol.SendMessage("ntw1103", "automated poke number " + str(x) + " of 5");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement