Jump to content


 

* * * * * 1 votes

Skype COM Examples - Skype4COMLib


13 replies to this topic

#1 Airwolf

    Systems Architect : Programmer : Author

  • Full Members
  • PipPipPipPip
  • 421 posts
  • Gender:Male
  • Location:Saint Charles, MO

Posted 04 June 2008 - 07: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.63K   914 downloads - This script sets up automatic answering of incoming calls.

Attached File  Attach.au3   3.36K   550 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.96K   560 downloads - This script sends key press events to the Skype client.

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

Attached File  Chats.au3   4.26K   584 downloads - This script queries chats in chat history.

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

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

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

Attached File  Conference.au3   3.58K   386 downloads - This script creates a conference call.

Attached File  Conferences.au3   4.32K   314 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.57K   408 downloads - This script lists file transfers.

Attached File  GroupChat.au3   3.29K   415 downloads - This script creates a group chat.

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

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

Attached File  MessageStatus.au3   3.23K   486 downloads - This script logs chat text messages.

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

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

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

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

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

Attached File  Settings.au3   3.71K   395 downloads - This script queries the Skype general parameters.

Attached File  Sms.au3   3.31K   555 downloads - This script sends a SMS message.

Attached File  Smss.au3   3.96K   347 downloads - This script lists all SMS messages.

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

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

Certifications: A+, Network+, Security+, MCSA | Languages: AutoIt, SQL, VB.NET, C#, Delphi, ASP.NET
Books: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007
-------->AutoIt: Complete (working title) - Coming Soon - Fate Publishing - Fall/Winter 2012
UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksum
Examples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt



#2 ofLight

    Spammer!

  • Full Members
  • PipPipPip
  • 280 posts

Posted 04 June 2008 - 08:05 PM

Hay Airwofl,

First off Great work and Thankyou for sharing.

I got an error when running "sms.au3"

Quote

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

Quote

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

Posted Image


#3 Airwolf

    Systems Architect : Programmer : Author

  • Full Members
  • PipPipPipPip
  • 421 posts
  • Gender:Male
  • Location:Saint Charles, MO

Posted 04 June 2008 - 08:07 PM

View PostofLight, on Jun 4 2008, 02:05 PM, said:

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+, MCSA | Languages: AutoIt, SQL, VB.NET, C#, Delphi, ASP.NET
Books: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007
-------->AutoIt: Complete (working title) - Coming Soon - Fate Publishing - Fall/Winter 2012
UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksum
Examples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt

#4 ofLight

    Spammer!

  • Full Members
  • PipPipPip
  • 280 posts

Posted 04 June 2008 - 08:14 PM

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

Quote

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

Posted Image


#5 Skrip

    Psychonaut

  • Full Members
  • PipPipPipPipPipPipPip
  • 2,339 posts
  • Gender:Male
  • Location:Look behind you...

Posted 11 June 2008 - 05: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

    Spammer!

  • Full Members
  • PipPipPip
  • 231 posts
  • Gender:Male

Posted 11 June 2008 - 07: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

    Systems Architect : Programmer : Author

  • Full Members
  • PipPipPipPip
  • 421 posts
  • Gender:Male
  • Location:Saint Charles, MO

Posted 14 June 2008 - 12:06 AM

View Postblitzkrg, on Jun 11 2008, 01:19 PM, said:

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:

[ autoIt ]    ( Popup )
;// 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+, MCSA | Languages: AutoIt, SQL, VB.NET, C#, Delphi, ASP.NET
Books: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007
-------->AutoIt: Complete (working title) - Coming Soon - Fate Publishing - Fall/Winter 2012
UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksum
Examples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt

#8 cheatera

    Member

  • Blocked
  • 13 posts
  • Gender:Male
  • Location:Bulgaria

Posted 27 June 2008 - 08: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 stupid


Saved warn logs: cheatera
SmOke_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

    Systems Architect : Programmer : Author

  • Full Members
  • PipPipPipPip
  • 421 posts
  • Gender:Male
  • Location:Saint Charles, MO

Posted 01 July 2008 - 11:27 PM

View Postcheatera, on Jun 27 2008, 02:31 PM, said:

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+, MCSA | Languages: AutoIt, SQL, VB.NET, C#, Delphi, ASP.NET
Books: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007
-------->AutoIt: Complete (working title) - Coming Soon - Fate Publishing - Fall/Winter 2012
UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksum
Examples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt

#10 foray

    Member

  • Full Members
  • Pip
  • 16 posts

Posted 15 March 2009 - 12:59 PM

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:

[ code='text' ]    ( ExpandCollapse - Popup )
;// 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

    Member

  • Full Members
  • Pip
  • 16 posts

Posted 15 March 2009 - 01:30 PM

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

#12 lmsanch

    Newbie

  • Members
  • 1 posts

Posted 07 April 2009 - 12:45 AM

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

    Newbie

  • Members
  • 2 posts

Posted 14 October 2010 - 12:23 PM

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

    Newbie

  • Members
  • 2 posts

Posted 15 October 2010 - 08:27 AM

View Postdiehard889, on 14 October 2010 - 12:23 PM, said:

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.

[ code='text' ]    ( ExpandCollapse - Popup )
#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.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users