Sign in to follow this  
Followers 0
Expansion

Change Skype status - need help

9 posts in this topic

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. 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Remove Opt(GUIoneventmode,0) and re run it, Does it exit then?


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.

Share this post


Link to post
Share on other sites

It exits both times, usually.

The problem is that sometimes it remains stuck. And I see the exe in task manager.

I would need something to auto-close itself somehow after 10 seconds or something.

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

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
2 people like this

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.

Share this post


Link to post
Share on other sites

javiwhite, thank you for the trick. I've managed to solve the issue as you said.

Share this post


Link to post
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
Sign in to follow this  
Followers 0

  • Similar Content

    • nacerbaaziz
      By nacerbaaziz
      hello
      Greetings to all
      dears i have a big problem in the bass.dll
      e.g
      If you play an audio file using the bass.dll
      and  You changed the audio output
      Such as setting or removing headphones
      The sound output of bass.dll does not change
      Is there any solution
      If it exists, please give it to me
      Greetings and thanks in advance
      I apologize for my bad English
    • nacerbaaziz
      By nacerbaaziz
      Hi friends, I have a question, please.
      I have created a window containing a edit box
      I need to know how to change the keyboard language,
      e.g :
      if a user open the  script  it will be change the keyBord language   in window automatically into English
      I found more examples but didn't work with me .
      Note:  
       I use the windows 10 os
      Please help me .
      thanks in advance to all
      with my Greetings and my appreciation for all users and admins
    • r0ash
      By r0ash
      Hi guys,
      I am trying to backup Skype contacts when the Skype window is minimized or machine is locked. But ControlSend is not working.
      However when I run program, when Skype is active & focused, same program works.
      #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_UseX64=n #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** $pid = Run("skype.exe") $hWnd = WinWait("[CLASS:tSkMainForm]", "", 10) WinSetState($hWnd, "", @SW_SHOW) Sleep( 1000 ) ControlSend($hWnd,"","TConversationsControl1", "!cdb") If I change 
      WinSetState($hWnd, "", @SW_SHOW) to 
      WinSetState($hWnd, "", @SW_MINIMIZE) The file dialog to save contact as file will never appear. Where FAQs says ControlSend() instead of Send() will work even computer is locked.
      Thanks for your time.
       
      P.S: I've tried to find if backing up Skype contacts violate any EULA but do not find anything. Kindly enlighten me if this post is against forum rules in any sense.
    • ur
      By ur
      I have a text file whose data will be as below.
      win10x64 ~\erwin Notallowed1! "erwin Data Modeler r9.7 (32-bit)_2500.exe" SilentInstall.exe win10x64clone1 ~\erwin Notallowed1! "erwin Data Modeler r9.7 (64-bit)_2500.exe" DM64.exe win10x64clone2 ~\erwin Notallowed1! "erwin Mart Server r9.7 (32-bit).exe" SilentInstall.exe win10x64clone3 ~\erwin Notallowed1! "erwin License Server r9.7 (32-bit).exe" SilentInstall.exe Each line will have multiple values separated by space.
      If a value contains space in it, the value is surrounded by quotes.
      My task is to check how many values are there in each line.
      If the line contains 5 values, I need to replace the 4th value with the string contained in a variable.
      If it contains 4 values then also  I need to replace the 4th value followed by appending 5 th value to it as SilentInstall.exe
      If the value I am replacing contains spaces then I need to surround the new value with quotes.
       
      Any one can suggest how to do this,??
    • billshu
      By billshu
      Is there any way to change chrome settings from Auto-it.  I would like to change back and forth, between "Allow Site to show POP-ups" and "Do not Allow Site to show POP-up"?