Announcement

Collapse
No announcement yet.

A little help

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    A little help

    I'm having a problem with some code and was hoping someone could help...

    Client = hs.Plugin("Message Server").GetLastConnected

    if Client = hs.Plugin("Message Server").GetLastConnected then
    hs.speak Client & " is connected"
    else
    hs.speak Client & " is not connected"
    end if
    The error message generated is a type mismatch. The script errors on the the line in italics. If I substitute a string with quotes for 'Client' everything works.

    Any suggestions?

    Thanks:

    Don
    Don

    #2
    Don,

    I ran your code and no error came up but as reading your code I think you should always have “is connected” message because you check if LastClient = LastClient then will always be true.

    Here how you can use the function
    <pre class="ip-ubbcode-code-pre">Sub Main()
    Dim Client
    Client = hs.Plugin("Message Server").GetLastConnected
    if Client = "P3" then
    hs.speak Client & " is connected"
    'Admin Client Send today news, meteo ...
    else
    'Regular client
    end if
    End Sub</pre>

    Comment


      #3
      Wow! That was quick. Thank you. By the way, I'm having way too much fun with your msAgents!

      Don
      Don

      Comment


        #4
        Could you suggest a way to identify who last DISconnected?

        Thanks;

        Don
        Don

        Comment


          #5
          Don,

          No problem “GetLastDisconnect” function will be in next release.

          Thanks,
          Christian

          Comment

          Working...
          X