0

I'm fairly new to Python and I'm writing a script that sends a Skype message when someone sends you a message (And it changes the message dependent on whether a process exists or not.) and I'm struggling to get python to recognize a received message. I've seen another post on this but I'm struggling to put this into the if statement. The code is included below in-case you need it.

import Skype4Py
import sys
import os
while 0 == 0: #infinite loop
    if """user sends message to me""":
        if #process is open (Still haven't figured this out, either!)
            print("Process Found")
            client = Skype4Py.Skype()
            client.Attach()
            user = ChatMessage.Sender #may need changing
            message = 'SERVER ONLINE'
            client.SendMessage(user, message)
            print("Message sent to", ChatMessage.Sender)
        else:
            print("Process Non-Existant")
            client = Skype4Py.Skype()
            client.Attach()
            user = ChatMessage.Sender #same as above
            message = 'SERVER OFFLINE'
            client.SendMessage(user, message)
            print("Message sent to", ChatMessage.Sender)
    else:
        print("Awaiting Message")
else:
    print("Physics is broken.")

That's how far I got. Thanks - James Whybrow

0 Answers0