Jump to content

Skype UDF v1.2 (Sep 15, 2013)


FireFox
 Share

Recommended Posts

  • 4 weeks later...
  • 2 weeks later...

Hi, i'm trying to read the latest message from a given username, but whatever I do, I can't get it done. Can you give me an example or show me what am I doing wrong?

#include <Skype.au3>
#include <Array.au3>

$test =_Skype_ChatCreateWith("username")
Global $a = _Skype_ChatMessageGetBody($test)
_ArrayDisplay($a)
Link to comment
Share on other sites

Hi,

Here you go :

#include "Skype.au3"

Local Const $aChat = _Skype_ChatGetAll()
Local $oChat = 0, $aMember = 0, $sChatName = ""

For $iChat = 0 To UBound($aChat) -1
    $oChat = $aChat[$iChat]

    #region 1
    $aMember = _Skype_ChatGetMembers($oChat)
    If IsArray($aMember) = 0 Then ContinueLoop

    For $iMember = 1 To $aMember[0] -1
        ConsoleWrite($aMember[$iMember] & ", ")
    Next
    ConsoleWrite(@CrLf)
    #endregion

    $sChatName = _Skype_ChatGetName($oChat)
    ConsoleWrite($sChatName & @CrLf & @CrLf)

    If $sChatName = "#abc.def/$whatever" Then ExitLoop
Next

Local $sMsgBody = ""
For $oMsg In $oChat.Messages
    $sMsgBody = _Skype_ChatMessageGetBody($oMsg)

    If $sMsgBody = "" Then ContinueLoop

    ConsoleWrite("Last message (" & _Skype_ChatMessageGetDate($oMsg) & "): " & $sMsgBody & @CrLf)
    ExitLoop
Next

You need to find the chat name thanks to the console, then you can comment everything which is in the region 1.

Br, FireFox.

Link to comment
Share on other sites

Hi FireFox,

again, after runing the above code, I get an error about the array(s) :

!>Error Number: 0

Description: 0

C:\Program Files\AutoIt3\Include\Skype.au3 (3377) : ==> Array variable subscript badly formatted.:

Local $aChats[$iChats], $i

Local $aChats[^ ERROR

I get the similar error but with other code ( i'll try to reproduce it if you like ):

C:Program FilesAutoIt3IncludeSkype.au3 (2386) : ==> Array variable subscript badly formatted.:

Local $aChatMessages[$iChats][4], $i

Edited by hiho
Link to comment
Share on other sites

Replace the Skype_Error function with this one (don't forget to rename it) :

Func MyErrFunc($oError)
    MsgBox(0, "", "err.number is: " & @TAB & $oError.number & @CRLF & _
        "err.windescription:" & @TAB & $oError.windescription & @CRLF & _
       "err.description is: " & @TAB & $oError.description & @CRLF & _
       "err.source is: " & @TAB & $oError.source & @CRLF & _
       "err.helpfile is: " & @TAB & $oError.helpfile & @CRLF & _
       "err.helpcontext is: " & @TAB & $oError.helpcontext & @CRLF & _
       "err.lastdllerror is: " & @TAB & $oError.lastdllerror & @CRLF & _
       "err.scriptline is: " & @TAB & $oError.scriptline & @CRLF & _
       "err.retcode is: " & @TAB & $oError.retcode)
EndFunc ;==>_ErrFunc
Link to comment
Share on other sites

I feel like an idiot : I forgot that I blocked "AutoIT.exe" from my personal skype while making the other script. Everything works fine, sorry for troubling you,

No problem :D

@everyone

New version available ! (see first post for update)

Br, FireFox.

Link to comment
Share on other sites

  • 2 weeks later...

I have discovered this today and the first thing I tried have been to send a message in the current chat, so this is the code:

#include "Skype.au3"
_Skype_ChatSendMessage(_Skype_ChatGetActive(),"hola")

I think it should work, but I get an error:

err.number is:  169
err.windescription: Variable must be of type 'Object'.
err.description is: 
err.source is: 
err.helpfile is: 
err.helpcontext is:  0
err.lastdllerror is:  0
err.scriptline is:  2650
Link to comment
Share on other sites

Hi,

The _Skype_ChatGetActive function returns an array containing all active chats and not an object.

Take a look at the replies from this topic and you will find what you need ;)

Br, FireFox.

Link to comment
Share on other sites

Hi,

The _Skype_ChatGetActive function returns an array containing all active chats and not an object.

Take a look at the replies from this topic and you will find what you need ;)

Br, FireFox.

Oh fine, but then I think this could be wrong:

; #FUNCTION# ====================================================================================================================
; Name...........: _Skype_ChatGetActive
; Description ...: Queries active chat object
; Syntax.........: _Skype_ChatGetActive()
; Parameters ....: None
; Return values .: Success   - Active chat object
;                Failure     - 0 [Sets an error event]
; Author ........: FireFox (d3mon)
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........:
; Example .......: Yes
; ===============================================================================================================================

I mean this: ; Return values .: Success - Active chat object

Link to comment
Share on other sites

Yes, you're right.

I changed the function name to _Skype_ChatGetAllActive

$aActiveChat = _Skype_ChatGetAllActive()

$aActiveChat[0] ;current opened chat

@everyone

New version available ! (see first post for update)

Br, FireFox.

Edited by FireFox
Link to comment
Share on other sites

  • 2 weeks later...

so, off topic, i have a question but before i begin. there was no function that i could find within skype4com to check if a user exists on skype. so i made one that uses the jquery on skypes signup page. heres the function i made:

Func _checkskypeuser($skuser)
$skhtml = BinaryToString(InetRead("https://login.skype.com/json/validator.php?new_username="&$skuser,1))
If StringInStr($skhtml, "Skype Name not available") Then
    Return 1
EndIf
EndFunc

as for my question, how do i get the user handle of someone who is attempting to send me a friend request?

Link to comment
Share on other sites

  • 4 weeks later...

Hi,

I don't understand what you mean.

Do you want to run more than one instance on your computer?

OR you have a portable skype and you ask if it's possible to use this UDF?

Br, FireFox.

Link to comment
Share on other sites

You need to run the Skype with this parameter " /secondary"

I don't know if you can target a skype instance with the Skype4COM library, I will make some searches tonight. Meanwhile if you find something you can post it :)

Br, FireFox.

Link to comment
Share on other sites

Hi, if I understand you correct, you're asking if it's possible to have 2 Skype accounts running at the same time and one of them being manupulated with the UDF? If this is what you want to accomplish, then simply deny the access of the complied script when it asks for permission to use Skype.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...