вот сообственно плагин:
package char_recreate;
use strict;
use Plugins;
use Globals;
use Log qw(message warning error debug);
use Misc;
use Network;
use Network::Send;
Plugins::register('char_recreate', 'Char Recreate Bot (used for noobfarming)', \&onUnload);
my $hooks = Plugins::addHooks(['charSelectScreen', \&delChar, undef]);
sub onUnload {
Plugins::delHooks($hooks);
}
sub loginChar {
my (undef, $args) = @_;
sendCharLogin($net,$chars[0]{ID});
$timeout{'charlogin'}{'time'} = time;
$args->{return} = 1;
Plugins::delHooks($hooks);
$hooks = Plugins::addHooks(['charSelectScreen', \&delChar, undef]);
}
sub delChar {
my (undef, $args) = @_;
Plugins::delHooks($hooks);
$hooks = Plugins::addHooks(['charSelectScreen', \&createChar, undef]);
sendCharDelete($net,$chars[0]{ID}, 'blablabla@mail.com');
$timeout{'charlogin'}{'time'} = time;
$args->{return} = 2;
}
sub createChar {
my (undef, $args) = @_;
Plugins::delHooks($hooks);
$hooks = Plugins::addHooks(['charSelectScreen', \&loginChar, undef]);
sendCharCreate($net,$chars[0], 'blabla', 5 , 5 , 5 , 5 , 5 , 5 , 1 , 1 );
$timeout{'charlogin'}{'time'} = time;
$args->{return} = 2;
}