Jump to content
Sign in to follow this  
Expansion

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. 

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

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

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.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By nacerbaaziz
      hello autoit team
      please i've a question for you.
      am creating a audio player
      and in this audio player i want to show the current trac info
      such as the total time and the position ... etc
      i know i can show it as label
      but the screen reader for the blind read the text every change
      because it have a screen scan
      what i want is to show this informations but such image or icon
      i mean i need to create
      GUICtrlCreatepic or GUICtrlCreateicon ....
      or some thing as that
      and show this informations as image on it
      i think that i can do that with the 
      _GDIPlus functions
      but i couldn't find the currect way to do it
      i tried the _GDIPlus_GraphicsDrawString
      but i couldn't know how it work
      what i need is a small example that create a GUI
      and add a multy line text to it as graphic or image.
      so i need a simple way because it will changed every sec
      i hope any one can help me to do that
      global $GUI = GUICreate("text", 400, 400) global $label = GUICtrlCreateLabel(GetText(), 10, 10, 380, 380) GUISetState() do sleep(100) until GUIGetMSG() = -3 exit func GetText() return StringFormat("file name is test.mp3 \r\n total time is 00:30:00 \r\n position is 00:05:50") endFunc  
    • By edpoguatemala
      Hello Everyone, 
      So I'm using auto it to automate the download of pictures in woocommerce orders. Once images are downloaded, I need to change the status of the order from in process to completed. This is how my code looks like: 
      Download()
      Func Download()
          ; Save the downloaded file to the temporary folder.
          Local $sFilePath = @DesktopDir&"\TestAutomatizacion\"&@YEAR &"_"& @MON &"_"& @MDAY & "_picpic_orders.zip"
          ; Download the file in the background with the selected option of 'force a reload from the remote site.'
          Local $hDownload = InetGet("https://hellopicpic.com/get_pic_orders.php?token=ygtV2bMh23uJ7f6s&type=pic", $sFilePath, $INET_FORCERELOAD, $INET_DOWNLOADBACKGROUND)
          ; Wait for the download to complete by monitoring when the 2nd index value of InetGetInfo returns True.
          Do
              Sleep(250)
          Until InetGetInfo($hDownload, $INET_DOWNLOADCOMPLETE)
          ; Retrieve the number of total bytes received and the filesize.
          Local $iBytesSize = InetGetInfo($hDownload, $INET_DOWNLOADREAD)
          Local $iFileSize = FileGetSize($sFilePath)
          ; Close the handle returned by InetGet.
          InetClose($hDownload)
      EndFunc   ;==>Download
       
      Thanks for any help you can give. 
    • By nooneclose
      Good afternoon, I am in need of some help. I am sure this is a stupid question requiring only one or two lines of code. However, I would greatly appreciate the help I cannot figure this out. I also tried searching for the answer on the internet but no one except me apparently seems to be having a hard time figuring this out and or is asking about it. 
      I simply want to change the "status" of an email from unread to read once I have processed it. My code is over 500 lines and I would like not to clutter this post with it. Assume I have all my includes and connections properly defined and stuff. 
      Here is the bit of code where I am trying to change the email that was used from unread to read:
      Func ChangeEmailStatus() ;******************************************************************************* ; changes the status of an email from unread to Read ;******************************************************************************* Local $iRows = UBound($aItems, $UBOUND_ROWS) MsgBox("", "Number of Unread emails (Before Change)", $iRows) _OL_ItemModify($oOutlook,$aItems[$i][0], Default, "Read=True") MsgBox("", "Array Display 1", $aItems[1][0]) MsgBox("", "Array Display 2", $aItems[2][0]) Local $iRows = UBound($aItems, $UBOUND_ROWS) MsgBox("", "Number of Unread emails (After Change)", $iRows) EndFunc  
    • By Ambient
      I have tried several way sto get this to work to no avail. Any help would be appreciated. #include <ListViewConstants.au3> #include <GuiListView.au3> #include "GuiListViewEx.au3" $idItem = GUICtrlCreateListViewItem($r & " | " & $c & $adoRs.Fields("TransactionAmount").value & " | " & $Timestamp & " | " & _StringProper($adoRs.Fields("Tillid").value) & @CRLF & @CRLF & "Card Number : " & $cardnum & " " , $idListView) ConsoleWrite( "IDITEM" & $idItem) If STRINGLEFT($adoRs.Fields("TransactionAmount").value,1)= "-" Then Consolewrite(" String is Negative" & @CRLF) ;Drops in Here as expected ;GUICtrlSetColor(-1, $COLOR_RED) ; Colour line if item is negative this didn' work $TxC= _GUICtrlListView_SetTextColor($hListView, $CLR_RED) ; I also tried $TxC= _GUICtrlListView_SetTextColor(-1, 0xFF0000) CONSOLEWRITE("TEXTCOLOUR RETURNED " & $TxC & @crlf) ; This is returning True ELSE Consolewrite(" String is NOT Negative" & @CRLF) EndIf  
    • 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
×
×
  • Create New...