Expansion Posted July 31, 2015 Posted July 31, 2015 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.
javiwhite Posted July 31, 2015 Posted July 31, 2015 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.CheersJavi 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.
Expansion Posted July 31, 2015 Author Posted July 31, 2015 (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 protectionEither 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 July 31, 2015 by Expansion
javiwhite Posted July 31, 2015 Posted July 31, 2015 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) exitIf 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()?CheersJavi 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.
Expansion Posted July 31, 2015 Author Posted July 31, 2015 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) exitIn this case, the MsgBox appears.
javiwhite Posted July 31, 2015 Posted July 31, 2015 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.
Expansion Posted July 31, 2015 Author Posted July 31, 2015 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.
javiwhite Posted July 31, 2015 Posted July 31, 2015 (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 endifJust 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 July 31, 2015 by javiwhite Skysnake and Expansion 2 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.
Expansion Posted August 1, 2015 Author Posted August 1, 2015 javiwhite, thank you for the trick. I've managed to solve the issue as you said.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now