in reply to Net::AIM with another script?

You could run it all in one script and use POE for the timeing. Its not very accurate but i think on the 15 minute scale it would work pretty good. Then you set your bot up as one poe event (calling $aim->do_one_loop continualy) and your other script as an event that repeats every 15 minutes. You might have to record the start time of your HTML grab, and the end time, and figure out the next delay from that, not sure but trivial either way. Good Luck!

___________
Eric Hodges

Replies are listed 'Best First'.
Re: Re: Net::AIM with another script?
by hoopsbwc34 (Initiate) on Aug 15, 2003 at 18:41 UTC
    Eric, I haven't heard of POE, but I think that might work. I checked out poe.perl.org, but I'm still not sure how I would code this (or what classes I would need, there seem to be a lot).

    Also, I was wondering which you thought would be less server intensive. Running one POE perl script all the time, or using cron to call the scripts only when I want it?

    Would it be better to just include my other script as a subroutine that returns the HTML I wish to send and the AOL username I wish to send it to?

    Thanks!

Re: Re: Net::AIM with another script?
by hoopsbwc34 (Initiate) on Aug 15, 2003 at 18:55 UTC
    One other question. How will I actually get the data to the AIMbot? I somehow need the connection pointer (which is now running in a different script?). Once I do a $aim->start; I'm in an infinite loop ($aim->do_one_loop), and I can't execute any other code UNLESS I get an event off the toc server.... how can POE help me do this? Thanks again.

      Instead of running start, run do_one_loop, in a continous set of poe events.

      I would just include any HTML generation as part of the same script, if you want it to happen at set intervals then use POE to do it.

      For learning poe i would just set it up on a computer, and have it print something every 5 seconds, and then figure out how to get it to print one thing every 5 seconds and another every 7, then you basicaly have the base for what you need. Fix the intervals and have one generate HTML and the other call do_one_loop. Its realy easier than it sounds once you get poe running.

      ___________
      Eric Hodges
        Any chance you can point me to URL for a good example script? I'm not really sure where to start... there seem to be a lot of uses and applications of POE from looking at poe.perl.com