Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Skype COM Examples - Skype4COMLib


  • Please log in to reply
17 replies to this topic

#1 Airwolf

Airwolf

    Software Dev Engineer II @ Dell | Author

  • Active Members
  • PipPipPipPipPipPip
  • 426 posts

Posted 04 June 2008 - 06:42 PM

I have manually converted all Skype4COMLib VBS examples (found HERE) to AutoIt. I have also created a UDF library - http://www.autoitscript.com/forum/index.php?showtopic=75056.

IMPORTANT: Skype4Com.dll is automatically included together with Skype Extras Manager during Skype installation. If a user has unchecked Extras Manager during installation, Skype4Com library will be unavailable on that machine and these examples will not work.

Notes:
  • All examples have had code added, if they did not already have it, to verify that Skype is running and a user is signed in.
  • All examples use a Skype event handler to detect changes once attached to the Skype API.
  • The COM Error handler for each example simply allows the script to continue, because the section that verifies a user is logged in will error on the first object until Skype is running (I'm working on fixing this so an error handler can be used properly).
If you find any errors or have any trouble, please feel free to send me a PM or post a reply to this thread, and I will help you as best I can.

Thanks and enjoy!

Andy

Attached File  Answer.au3   3.63KB   1645 downloads - This script sets up automatic answering of incoming calls.

Attached File  Attach.au3   3.36KB   1001 downloads - This script listens for connections on the Skype API, connects when available, and holds the skypename of the user when a connection is successful.

Attached File  Buttons.au3   3.96KB   1003 downloads - This script sends key press events to the Skype client.

Attached File  Call.au3   6.1KB   1401 downloads - This script places a call through the Skype API, and monitors status while the call is in progress.

Attached File  Chats.au3   4.26KB   1111 downloads - This script queries chats in chat history.

Attached File  Chats2.au3   7.3KB   986 downloads - An improved chats example to illustrate new chat properties.

Attached File  Client.au3   4.74KB   990 downloads - This script opens different windows in the Skype client.

Attached File  Command.au3   4.79KB   817 downloads - This script sends blocking and non-blocking commands to the Skype API.

Attached File  Conference.au3   3.58KB   752 downloads - This script creates a conference call.

Attached File  Conferences.au3   4.32KB   658 downloads - This script lists conference calls hosted by a user, and lists participants in conference calls not hosted by a user.

Attached File  FileTransfers.au3   6.57KB   840 downloads - This script lists file transfers.

Attached File  GroupChat.au3   3.29KB   829 downloads - This script creates a group chat.

Attached File  Groups.au3   6.07KB   672 downloads - This script manages various aspects of contact groups.

Attached File  Join.au3   4.97KB   687 downloads - This script joins callers to form a conference call.

Attached File  MessageStatus.au3   3.23KB   936 downloads - This script logs chat text messages.

Attached File  MissedMessages.au3   3.23KB   686 downloads - This script list all missed messages and changes message status to "Read".

Attached File  Plugins.au3   6.43KB   761 downloads - This script demos how to create plugin menu items and events.

Attached File  Profile.au3   4.79KB   729 downloads - This script lists the profile properties for the current user.

Attached File  Response.au3   4.64KB   956 downloads - This script provides a response to a message received in a chat.

Attached File  Search.au3   3.04KB   712 downloads - This script performs a simple search for a user.

Attached File  Settings.au3   3.71KB   708 downloads - This script queries the Skype general parameters.

Attached File  Sms.au3   3.31KB   996 downloads - This script sends a SMS message.

Attached File  Smss.au3   3.96KB   619 downloads - This script lists all SMS messages.

Attached File  VoicemailServer.au3   4.94KB   693 downloads - This script listens for new voicemails, sends SMS message and answers incoming calls.

Edited by Airwolf, 09 July 2008 - 09:18 PM.

Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->AutoIt v3 Development - newbie to g33k - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt







#2 ofLight

ofLight

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 280 posts

Posted 04 June 2008 - 07:05 PM

Hay Airwofl,

First off Great work and Thankyou for sharing.

I got an error when running "sms.au3"

C:\Documents and Settings\Desktop\New AutoIt v3 Script.au3 (42) : ==> Error in expression.:
If $oSkype.CurrentUserStatus = $oSkype.Convert.TextToUserStatus("ONLINE") Then
If ^ ERROR


There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Posted Image


#3 Airwolf

Airwolf

    Software Dev Engineer II @ Dell | Author

  • Active Members
  • PipPipPipPipPipPip
  • 426 posts

Posted 04 June 2008 - 07:07 PM

Hay Airwofl,

First off Great work and Thankyou for sharing.

I got an error when running "sms.au3"

I know this seems like a dumb question, but do you have Skype installed?
Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->AutoIt v3 Development - newbie to g33k - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt

#4 ofLight

ofLight

    Universalist

  • Active Members
  • PipPipPipPipPip
  • 280 posts

Posted 04 June 2008 - 07:14 PM

That was it, I had the old 2.2 installed. I upgraded to the current 3.8 and it is Workin :)

There is always a butthead in the crowd, no matter how hard one tries to keep them out.......Volly

Posted Image


#5 Skrip

Skrip

    Psychonaut

  • Active Members
  • PipPipPipPipPipPip
  • 2,346 posts

Posted 11 June 2008 - 04:52 PM

This is great! I've needed these for awhile...just too lazy to make them. lol.

Thanks alot.

We're trapped in the belly of this horrible machine.And the machine is bleeding to death...


#6 blitzkrg

blitzkrg

    Polymath

  • Active Members
  • PipPipPipPip
  • 232 posts

Posted 11 June 2008 - 06:19 PM

Great work Airwolf. thanks for sharing..

do you have functions to close windows?
the Quality feedback mgr keeps opening.. as well as the client when i'm in a call.

or do you suggest just using standard autoit window close calls?

thanks

#7 Airwolf

Airwolf

    Software Dev Engineer II @ Dell | Author

  • Active Members
  • PipPipPipPipPipPip
  • 426 posts

Posted 13 June 2008 - 11:06 PM

Great work Airwolf. thanks for sharing..

do you have functions to close windows?
the Quality feedback mgr keeps opening.. as well as the client when i'm in a call.

or do you suggest just using standard autoit window close calls?

thanks

You can use standard AutoIt window closes if you'd like, but I think the GroupChat.au3 example goes over opening and closing a chat window with multiple users. The same methods apply to a single chat aside from the opening part (a groupchat calls a window with a collection of members, whereas a standard chat calls a window aimed at one user).

Group Chat Example:

;// Create a UserCollection object and add the multichat users to this collection: $oMembers = ObjCreate("Skype4COM.UserCollection") $oMembers.Add($oSkype.User("skypeuser2")) $oMembers.Add($oSkype.User("skypeuser3")) ;// Create a multichat: $oChat = $oSkype.CreateChatMultiple($oMembers) ;// Open a chat window: $oChat.OpenWindow ;// Set a chat topic: $oChat.Topic = "Skype is cool" ;// Send a chat message: $oMsg = $oChat.SendMessage("Greetings!") ;// Leave a chat: $oChat.Leaveƒo݊÷ ؈Z½é÷öÛ^²×¶¬nëH‹¥v)š‚)Þʋœ¢é]¢—§jw–‹jËZÖ«uÈZ¶X¤zʺÚ"µÍŽËËÈܙX]HHÝ[™™Ú]‚‰ˆÌ ͎ÛÐÚ]H    ˆÌ ͎ÛÔÚÞKÜ™X]PÚ]Ú]     ˆÌ ͎ÛÔÚÞK•ÙŠ   œ][ÝÜÚÞ]ىœ][ÝÊJB‚ŽËËÈÜ[ˆHÚ]Ú[™Ý΂‰ˆÌ ͎ÛÐÚ] “Ü[•Ú[™Ý‚ŽËËÈÙ]HÚ]ÜX΂‰ˆÌ ͎ÛÐÚ] •ÜXÈH  œ][ÝÔÚÞHÈÛÛÛ   œ][Ý‚ŽËËÈÙ[™HÚ]YÜØYÙN‚‰ˆÌ ͎ÛÓÙÈH ˆÌ ͎ÛÐÚ] ”Ù[™YÜØYÙJ œ][ÝÑܙY][™ÜɈÌÌÎɜ][ÝÊB‚ŽËËÈX]™HHÚ]‚‰ˆÌ ͎ÛÐÚ] “X]™


For other types of windows, you'd have to know which method to call for the specific object type to close the window. It is a bit more complicated to close the windows with object methods than with AutoIt WinClose(), etc. Either way will work; the choice is yours.

Andy
Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->AutoIt v3 Development - newbie to g33k - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt

#8 cheatera

cheatera

    Seeker

  • Banned (NOT IN USE)
  • 13 posts

Posted 27 June 2008 - 07:31 PM

if user is incognito lets say, chats2.au3 gives error...
otherwise: great work! keep it up, w8ing for da udf
Is There A Life BEFORE Death?im stupidSaved warn logs: cheateraSmOke_N Note Added 17 January 2009 - 02:54 PM Added to warn level Posting a way to hack the registry and force sending someones desktop via TCP. Jos Note Added 25 November 2008 - 02:52 PM Added to warn level for being an impolite rookie.once a year i go bad ... what will happen in 2010??Its GOOD to be BAD ... (Warlock's Succubus - World of Warcraft)

#9 Airwolf

Airwolf

    Software Dev Engineer II @ Dell | Author

  • Active Members
  • PipPipPipPipPipPip
  • 426 posts

Posted 01 July 2008 - 10:27 PM

w8ing for da udf

Just FYI in case someone stumbles across this thread and would like to know, the UDF has been created (link below).

http://www.autoitscript.com/forum/index.php?showtopic=75056
Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->AutoIt v3 Development - newbie to g33k - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt

#10 foray

foray

    Seeker

  • Active Members
  • 16 posts

Posted 15 March 2009 - 11:59 AM

hi there, i tryed the received.au3, but it didn´t work for me?! maybe someone else can check it please?!

i deleted some code from the received.au3 i didn´t need, for example "online check" and so on..
skype is online, Skype4COM.dll is in the same folder like the edited *.au3, *.au3 script is running,
some incoming chatevents on skype BUT it seems the code never jumped in one of these functions?!
Sending a msg with another autoit script to a specified user/chat works fine!

where is the mistake?! maybe someone can help please...
below the code:

Plain Text         
;// Create a Skype4COM object: $oSkype = ObjCreate("Skype4COM.Skype") $oSkypeEvent = ObjEvent($oSkype,"Skype_") $oError = ObjEvent("AutoIt.Error","MyErrFunc") ;// Declare the following Skype constants: $cAttachmentStatus_Available = $oSkype.Convert.TextToAttachmentStatus("AVAILABLE") $cMessageStatus_Sending = $oSkype.Convert.TextToChatMessageStatus("SENDING") $cMessageStatus_Received = $oSkype.Convert.TextToChatMessageStatus("RECEIVED") $cMessageType_Said = $oSkype.Convert.TextToChatMessageType("SAID") $cMessageType_Left = $oSkype.Convert.TextToChatMessageType("LEFT") ;// Sleep While 1     Sleep(1000) WEnd ;// The AttachmentStatus event handler monitors attachment status and automatically attempts to reattach to the API following loss of connection: Func Skype_AttachmentStatus($aStatus)     MsgBox(0,"","Attachment status " & $oSkype.Convert.AttachmentStatusToText($aStatus))     If $aStatus = $oSkype.Convert.TextToAttachmentStatus("AVAILABLE") Then         $oSkype.Attach()     EndIf EndFunc ;// The MessageStatus event handler monitors message status, decodes received messages and, for those of type "Said", sends an autoresponse quoting the original message: Func Skype_MessageStatus($aMsg, $aStatus)     MsgBox(0,"","Message " & $aMsg.Id & " status " & $oSkype.Convert.ChatMessageStatusToText($aStatus))     If $aStatus = $cMessageStatus_Received Then         DecodeMsg($aMsg)         If $aMsg.Type = $cMessageType_Said Then             MsgBox(0,"","TEST")         ;$oSkype.SendMessage($aMsg.FromHandle, "This is autoresponse.")             $aMsg.Chat.SendMessage("You said [" & $aMsg.Body & "]")         EndIf     EndIf   EndFunc ;// The DecodeMsg event handler decodes messages in a chat and converts leave reasons to text for messages of type "Left": Func DecodeMsg($oMsg)     MsgBox(0,"","DecodeMsg TEST")     $sText = $oMsg.FromHandle & " " & $oSkype.Convert.ChatMessageTypeToText($oMsg.Type) & ":"     If StringLen($oMsg.Body) Then         $sText = $sText & " " & $oMsg.Body     EndIf     Dim $oUser     For $oUser In $oMsg.Users         $sText = $sText & " " & $oUser.Handle     Next     If $oMsg.Type = $cMessageType_Left Then         $sText = $sText & " " & $oSkype.Convert.ChatLeaveReasonToText($oMsg.LeaveReason)     EndIf     MsgBox(0,"",$sText) EndFunc Func MyErrFunc() ;Do Nothing EndFunc


#11 foray

foray

    Seeker

  • Active Members
  • 16 posts

Posted 15 March 2009 - 12:30 PM

no way to edit/delete post, sorry. problem solved! :P

#12 lmsanch

lmsanch

    Seeker

  • New Members
  • 1 posts

Posted 06 April 2009 - 11:45 PM

Hello everybody. When running sms.au3, I am experiencing a similar problem to one addressed before, but don't know the solution. I get

Line 42 (File "C:\Users\Luis\Desktop\Docs\AutoIt\Sms.au3"):

If $oSkype.CurrentUserStatus = $oSkype.Convert.TextToUserStatus("ONLINE") Then
If ^ ERROR

Error: Error in expression.

Skype4COM.dll is is in the same folder as Sms.au3; and it is running fine.

I am new to Auotit and got it because I am trying to automate some functions in skype, and it looks like a variation of sms.au3 is what I need. I am using Skype 3.8.0.188

Any help is appreciated.

Regards

#13 diehard889

diehard889

    Seeker

  • New Members
  • 2 posts

Posted 14 October 2010 - 11:23 AM

Im looking for a skype script that checks the chat for a particulart word and displays a messagebox, like there is a new message!.
I dont know whether this is included in the API.

#14 diehard889

diehard889

    Seeker

  • New Members
  • 2 posts

Posted 15 October 2010 - 07:27 AM

Im looking for a skype script that checks the chat for a particulart word and displays a messagebox, like there is a new message!.
I dont know whether this is included in the API.

Plain Text         
#cs ---------------------------------------------------------------------------- testing alert new messages. #ce ---------------------------------------------------------------------------- ;// Create a Skype4COM object: $oSkype = ObjCreate("Skype4COM.Skype") $oSkypeEvent = ObjEvent($oSkype,"Skype_") $oError = ObjEvent("AutoIt.Error","MyErrFunc") ;// Start the Skype client: If Not $oSkype.Client.IsRunning Then     $oSkype.Client.Start() EndIf ;// Verify that a user is signed in and online before continuing While 1     If $oSkype.CurrentUserStatus = $oSkype.Convert.TextToUserStatus("ONLINE") Then         ExitLoop     Else         $oSkype.ChangeUserStatus($oSkype.Convert.TextToUserStatus("ONLINE"))     EndIf     Sleep(1000) WEnd ;// The AttachmentStatus event handler monitors attachment status and automatically attempts to reattach to the API following loss of connection: Func Skype_AttachmentStatus($aStatus)     MsgBox(0,"","Attachment status " & $oSkype.Convert.AttachmentStatusToText($aStatus))     If $aStatus = $oSkype.Convert.TextToAttachmentStatus("AVAILABLE") Then         $oSkype.Attach()     EndIf EndFunc ;// messagebox Message received from "user" Func Skype_MessageStatus($aMsg, $aStatus)     if ($aStatus = $oSkype.Convert.TextToChatMessageStatus("RECEIVED")) and  _         $aMsg.Type = $oSkype.Convert.TextToChatMessageType("SAID") Then     MsgBox(0,"","Message " & $aMsg.Id & " " & $aMsg.FromHandle & " said " & $aMsg.Body) ;MsgBox(0,"","Total missed message count: " & $oSkype.MissedMessages.Count) EndIf EndFunc While 1     sleep(1000) WEnd


I now have this, which works pretty good. the next thing is need is that it triggers on a word or chatgroup.

#15 ram07

ram07

    Seeker

  • Normal Members
  • 2 posts

Posted 18 June 2012 - 08:41 AM

Hi,

every time i execute the script i get the following error

Error in expression.:
Const $UserStatus_Offline = $oSkype.Convert.TextToUserStatus("OFFLINE")
Const $UserStatus_Offline = ^ ERROR
->14:07:11 AutoIT3.exe ended.rc:1

Can some one help me in fixing this issue ?

#16 guwguw

guwguw

    Adventurer

  • Active Members
  • PipPip
  • 112 posts

Posted 19 August 2012 - 12:10 PM

Hi,

every time i execute the script i get the following error

Error in expression.:
Const $UserStatus_Offline = $oSkype.Convert.TextToUserStatus("OFFLINE")
Const $UserStatus_Offline = ^ ERROR
->14:07:11 AutoIT3.exe ended.rc:1

Can some one help me in fixing this issue ?


Did you have $oSkype initialized? Like with

Global $oSkype = ObjCreate("Skype4COM.Skype")

#17 guwguw

guwguw

    Adventurer

  • Active Members
  • PipPip
  • 112 posts

Posted 01 September 2012 - 09:07 AM

How to get the name of a group?

Basic setup: groups get created and deleted as planned. But I am member of a group (which is always open & active) whose name does not show up in the resulting list of
For $oChat In $oSkype.ActiveChats $msgstring = $msgstring & @CR & $oChat.Timestamp & " by " & $oChat.Name & " friendlyName:" & $oChat.FriendlyName Next

nor does it show in
For $oGroup In $oSkype.CustomGroups


or
$oSkype.HardwiredGroups


Sending a message to individual participants using
$oSkype.SendMessage("individual_user", "Wishing you a nice weekend!")

works fine.
But sending
$oSkype.SendMessage("group_name", "Wishing you all a nice weekend!")
or
$ichat.SendMessage("group_name", "Wishing you all a nice weekend!")

gets executed, but shows no new entry on the chat window. I already had renamed the group from a rather long name to a very simple one, but to no avail ...

There is a function Skype_GroupVisible($aGroup, $aVisible) available in the groups.au3 script, but I have no idea how to apply that to a group that is not listed in the above results.

Is there another way of finding out the name of the group (that is listed in the contact list)?

#18 FireFox

FireFox

    It slips through our fingers, like a fist full of sand.

  • MVPs
  • 5,382 posts

Posted 01 September 2012 - 12:05 PM

Hi,

Try this :
AutoIt         
#include "Skype.au3" Local $oActiveChats = _Skype_ChatGetActive() _List($oActiveChats) ConsoleWrite("!---------------------------" & @CrLf) Local $oAllChats = _Skype_ChatGetAll() _List($oAllChats) Func _List($oChats) If IsArray($oChats) Then Local $oChat For $iChat = 0 To UBound($oChats) -1 $oChat = $oChats[$iChat] Local $aMembers = _Skype_ChatGetMembers($oChat) Local $sUsersFullNames For $iUser = 2 To $aMembers[0] - 1 ;0: number of members, 1: yourself $sUsersFullNames &= _Skype_UserGetFullName($aMembers[$iUser]) & ", " Next ConsoleWrite("Chat " & $iChat & ": " & _Skype_ChatGetName($oChat) _ & @CrLf & "Members: " & StringTrimRight($sUsersFullNames, 2) _ & @crlf & "Description: " & _Skype_ChatGetDescription($oChat) & @CrLf & @CrLf) Next EndIf EndFunc


The Skype UDF is in my signature.

Br, FireFox.

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.

Hardware : Intel® Core™ i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

Updated 07 November, 2013 - If you find dead links please send me a PM, do not post in the topics !





1 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users


    Google (1)