Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package moveFast;
- use strict;
- use warnings;
- use Modules 'register';
- use Globals;
- use Log qw(message debug error warning);
- use Misc;
- use Network;
- use Network::Send ();
- use Settings;
- use Plugins;
- use Skill;
- use Utils;
- use Utils::Exceptions;
- use AI;
- use Task;
- Plugins::register("moveFast", "moveFast", \&unload, \&unload);
- my $hooks = Plugins::addHooks(
- ['packet_pre/character_moves',\&on_move, undef]
- );
- sub unload {
- Plugins::delHooks($hooks);
- }
- sub on_move {
- my ($self, $args) = @_;
- return if (!$net || $net->getState() != Network::IN_GAME);
- return if (!$config{'moveFastActive'});
- my $pre_coords = {};
- my $pos_coords = {};
- makeCoordsFromTo($pre_coords, $pos_coords, $args->{coords});
- if ($pos_coords->{'x'} == $config{'moveFastX1'} && $pos_coords->{'y'} == $config{'moveFastY1'}) {
- $messageSender->sendMove($config{'moveFastX2'}, $config{'moveFastY2'});
- } elsif ($pos_coords->{'x'} == $config{'moveFastX2'} && $pos_coords->{'y'} == $config{'moveFastY2'}) {
- $messageSender->sendMove($config{'moveFastX1'}, $config{'moveFastY1'});
- }
- return;
- }
- return 1;
Advertisement
Add Comment
Please, Sign In to add comment