Re: example on AutoIt language - WeOnlyDo Discussion board

Re: example on AutoIt language (General questions)

by wodDamir, Wednesday, February 16, 2011, 11:59 (5027 days ago) @ Autoit_user

Hi,

Well, theoretically it should look something like this in VBS (our simple sample, just added IncomingMessage event, and additional comment):

[code]Option Explicit
Dim XMPP1
Set XMPP1 = WScript.CreateObject( WeOnlyDo.wodXMPPCom.1 , wod_ )

' please change these lines, from here
WScript.echo Please edit this file to setup Login and Password properties

XMPP1.Login = somename@wippien.com
XMPP1.Password = password
XMPP1.Blocking = True
'XMPP1.Register = True ' register new account
XMPP1.Connect

'XMPP1.Contacts.Add( someone@wippien.com ).Subscribe ' you can add someone to your contact list...
XMPP1.SendText someone@wippien.com , Hello there!

'Some kind of a message loop
'should be implemented here
'to keep wodXMPP working,
'since it would otherwise die
'at the end of script execution

Sub wod_Disconnected()
WScript.Echo Done and disconnected
End Sub

Sub wod_IncomingMessage(Contact, Message)
WScript.Echo Message From & Contact.JID & vbcrlf & Text: & Message.Text
End Sub[/code]

Hope this helps.

Regards,
Damba


Complete thread: