I've got this script which looks something like this:

sub concentrate {
        if (!$Concentrating and !$afflictions{confusion}) {
                $Concentrating = 1;
                print "concentrate\n";
                concereset;
        };

};

sub concentratingreset {
        $Concentrating=0;
        print "Concentrating has been reset\n";

};

sub concereset {
POE::Session->create(
    inline_states => {
        _start         => \&delaytime,
        event_part_two => \&concentratingreset,
      }
);

sub delaytime {
    $_[KERNEL]->delay( event_part_two => 2 );

}

POE::Kernel->run();
exit;

};

but when i run concentrate; it waits for 2 seconds and then prints
concentrate
Concentrating has been reset

I was trying to get
concentrate
-2 second pause/delay
Concentrating has been reset.

Any ideas on that one.

I've also been trying to use one POE script for all my delays in my mud
scripts.

sub concereset {
POE::Session->create(
    inline_states => {
        _start         => \&delaytime($_[0]),
        event_part_two => \&task_two($_[1]),
      }
);

sub delaytime {
    $_[KERNEL]->delay( event_part_two => $_[0] );
}

sub task_two {
    $_[1];
    $_[HEAP]->{is_running} = 0;
}

POE::Kernel->run();
exit;
};

Is something like that possible?

Thanks, chris

Reply via email to