Jump to content

Change Skype status - need help


Recommended Posts

Hi,

 

I need a script to change the Skype status available/away/etc.

I've tried the following, but it doesn't work very well, because quite often, the compiled app remains stuck in task manager without changing the status. 

#NoTrayIcon
#include "SkypeCOM.au3"

Opt("GUIOnEventMode", 0)
$oSkype.ChangeUserStatus(1)

The compiled app is triggered by a perl script each 1-5 minutes. A short switch from available to away and back to available. 

Link to comment
Share on other sites

Hey Expansion,

Is SkypeCOM the script that generates the skype object?

I can see that $oSkype is your object handle.

It may be worth adding a simple message box before the Opt() function, so you can test whether the issue lies within your Wrapper script, Or "SkypeCOM.au3" itself.

Cheers

Javi

give a man an application, and he'll be frustrated for the day, Teach him how to program applications and he'll be frustrated for a lifetime.

Link to comment
Share on other sites

javiwhite, yes, SkypeCOM is generating the object by itself. What I've posted there is the entire code. 

I'm guessing that I'm doing something wrong:

Either not deallocating some resources or some timeouts protection

Either it's not ok to use:

 

Opt("GUIOnEventMode", 0)

If i let EventMode ON, the script stays alive forever. So, I'll end up with thousands of exe processes waiting(I can see them in task manager).

 

Edited by Expansion
Link to comment
Share on other sites

Ahh so i'm guessing SkypeCOM enables event mode? If it's an event driven UDF, it's probably best you leave it as such.

What if you leave Event mode on, and then add an exit to the end of your script?, Like So:

#NoTrayIcon
#include "SkypeCOM.au3"

$oSkype.ChangeUserStatus(1)
exit

If that doesn't work, then chances are their is some sort of loop within the SkypeCOM.au3, that is preventing your code from running.

Out of interest, Did the msgbox appear when you added it above Opt()?

Cheers

Javi

give a man an application, and he'll be frustrated for the day, Teach him how to program applications and he'll be frustrated for a lifetime.

Link to comment
Share on other sites

1) EventMode + exit at the end, it still gets stuck sometimes, and I see the .exe file in task manager.

2) 

#NoTrayIcon
#include "SkypeCOM.au3"
#include <MsgBoxConstants.au3>

MsgBox($MB_SYSTEMMODAL, "Title", "This message box will timeout after 10 seconds or select the OK button.", 10)

Opt("GUIOnEventMode", 0

$oSkype.ChangeUserStatus(1)
exit

In this case, the MsgBox appears.

Link to comment
Share on other sites

Hmmm, You could always add this line to the top of your script which will, At the very least kill any static processes:

if ProcessExists("YourCompiledNameHere.exe") > 0 then 
Do
ProcessClose("YourCompiledNameHere.exe")
Until ProcessExists("YourCompiledNameHere.exe") = 0
endif

Just replace the "YourCompiledNameHere.exe" with the actual name of your compiled script.

Note: this method won't work if the script is not compiled, As when running an au3 program, The autoit3Wrapper.exe (or something to that liking) will appear as the process.

The issue most likely lies with the SkypeCom.au3 contents, Although I can't really comment as I haven't seen the code.

Cheers 
 

Javi

Edited by javiwhite

give a man an application, and he'll be frustrated for the day, Teach him how to program applications and he'll be frustrated for a lifetime.

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...