Login to post  Page: « < 1 of 1 > »
26 Aug 2009 - 12:124868
Simple bot - Problem
Hi,

I am developing a very simple bot for subscribers to my website, so they can receive alerts via AIM.

My bot will only need to send msgs, it does not have to receive.

After reviewing the example code provided in SDK, I was able to understand the code that is required to initiate a conversation and send a message.

However, my problem is AccMessageLoop does not allow my program to do anything else.. once it is initiated it loops until AccPostQuit is called...

My program will be sending email, sms, and aim alerts.. itll just be a console app that constantly checks a database and checks if theres anyone in queue to receive an alert.. then it will send the alert to either their aim, mobile or email.

Anyone have any suggestions how I can get around the AccMessageLoop so my program can continue to do other things and I can just call a function that sends an IM when I need it?


26 Aug 2009 - 12:164869
Oops, I meant to post this in the bot section :(

If there are any mods here, please move it :)


26 Aug 2009 - 14:414870
Simple bot - Problem
I'm not sure what language you are using, but in C++ it's something like this:

void Run()
{
// run a message loop until AccPostQuit is called
HRESULT hr;
xp_int timeout = 1000;
int x=1;

while (1) {
x=x+1;
AccDispatchMessages(timeout);
if(x==50) {
read_message(msgqueue_id, &qbuf, rcvmsgtype);
x=0;
}
}
}

Thanks


26 Aug 2009 - 14:454871
Simple bot - Problem
I should mention in my example, read_message method would be replaced with
your method that gets database info and sends alerts.

Thanks


26 Aug 2009 - 16:264872
I am using C++, I will try that.

Thank you very much


Login to post  Page: « < 1 of 1 > »