Advertisement
DerEddy

Active Skype Status

Sep 23rd, 2012
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.36 KB | None | 0 0
  1. #Include <Misc.au3>
  2.  
  3. Global $dll32 = DllOpen("user32.dll")
  4. AdlibRegister("_hotkey", 250)
  5.  
  6. Global $aStatus
  7.  
  8. $oSkype = ObjCreate('Skype4COM.Skype')
  9. $oSkypeEvent = ObjEvent($oSkype,'Skype_')
  10. $oError = ObjEvent('AutoIt.Error','MyErrFunc')
  11. If Not $oSkype.Client.IsRunning Then
  12. $oSkype.Client.Start()
  13. EndIf
  14. While 1
  15.     Sleep(250)
  16.     If $oSkype.CurrentUserStatus = $oSkype.Convert.TextToUserStatus('ONLINE') Then
  17.         ExitLoop
  18.     Else
  19.         $oSkype.ChangeUserStatus($oSkype.Convert.TextToUserStatus('ONLINE'))
  20.     EndIf
  21. WEnd
  22. $oSkype.Attach()
  23. ;~ $oSkype.ChangeUserStatus($oSkype.Convert.TextToUserStatus('BUSY'))
  24. While 1
  25.     $status = "Aktives Fenster: " & WinGetTitle("[ACTIVE]")
  26.     If $status = "Aktives Fenster: VLC Media Player" Then
  27.         $status = "Anime schauen"
  28.         $oSkype.ChangeUserStatus($oSkype.Convert.TextToUserStatus('BUSY'))
  29.     EndIf
  30.     If $status <> "Aktives Fenster: " Then $oSkype.SendCommand($oSkype.Command(0, 'SET PROFILE RICH_MOOD_TEXT ' & $status))
  31.     Sleep (1000)
  32. WEnd
  33.  
  34. Func Skype_AttachmentStatus($aStatus)
  35.     TrayTip("Active Status", 'Attachment status ' & $oSkype.Convert.AttachmentStatusToText($aStatus), 5, 1)
  36.     If $aStatus = $oSkype.Convert.TextToAttachmentStatus('AVAILABLE') Then
  37.     $oSkype.Attach()
  38. EndIf
  39. EndFunc
  40.  
  41. Func MyErrFunc()
  42.     ConsoleWrite('Skype4COM Error !' & @CRLF)
  43. EndFunc
  44.  
  45. Func _hotkey()
  46.     If _IsPressed("1B", $dll32) Then Exit
  47.     Sleep (100)
  48. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement