User Control Panel
Advertisements

HELP US, HELP YOU!

Having Aiden react to other events.....

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help
View unanswered posts
Author Message
Ajar
Newbie
Newbie


Joined: 21 Aug 2007
Posts: 2


PostPosted: Wed Aug 22, 2007 4:19 am    Post subject: Having Aiden react to other events..... Reply with quote

Hi...

We've been working with the latest version of Aiden, and would like to have the bot monitoring a text file for other events.

A real basic example would be to monitor a text file for text, and send it to a chatroom.

The place to monitor for events would clearly be in active.pl, however whenever we try to send a message out from there... we've been unsuccess. Here's what we've got....

Code:
# active.pl - Keeps the bot active.

sub active {
        # Loop each bot.
        foreach my $bot (keys %{$aiden->{bots}}) {
                unless (length $bot) {
                        delete $aiden->{bots}->{$bot};
                        next;
                }

                if ($aiden->{bots}->{$bot}->{listener} eq 'HTTP') {
                        &http_request($bot);
                        next;
                }

                $aiden->{bots}->{$bot}->{client}->do_one_loop();
        }

# Send chat msgs

        if (-e "./data/msgs.txt") {
                open (MASTER, "./data/msgs.txt");
                my @data = <MASTER>;
                close (MASTER);
                foreach my $line (@data) {
                        print "Send to chat: $line\n";
                        $aim->chat_send ("CHATROOMNAME", $line);
                }
                unlink ("./data/msgs.txt")
        }



        # Unblock users.
        foreach my $client (keys %{$aiden->{clients}}) {
                if (exists $aiden->{clients}->{$client}->{blocked} && $aiden->{clients}->{$client}->{blocked} == 1) {
                        if (time() >= $aiden->{clients}->{$client}->{expires}) {
                                &userSend ($client,'blocked',0);
                                &userSend ($client,'expires',0);
                                print &timestamp . "\n"
                                        . "AidenSYS: $client block time has expired.\n\n";
                        }
                }
        }


the rest of the file is standard....

The above attempt errors out, with $AIM not being defined... If we try sending the via the queue, it just never sends...

Any help or tips would be suggested...


Cheers,

Ajar
[/code]
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Wed Oct 10, 2007 1:51 am    Post subject: Reply with quote

It's because Aiden doesn't use $aim, the variable you want is inside of $aiden->{bots}->{$bot}->{client}, where $bot is the s/n in lowercase/without spaces of the bot you want to control.

$aiden->{bots}->{"aidencks"}->{client}->send_im (...);

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Code Help All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group