( { x=>'288', y=>'852'}, # []. { x=>'790', y=>'667'}, # []. . { x=>'1126', y=>'658'}, # []. . { x=>'871', y=>'594'}, # []. . { # . # 100 . # 400 . x=>'983', y=>'742', # . dx=>'874', dy=>'750', # . # 99 . inc=>{ # : x=>'1010', y=>'745', # 1. inc=>'1', # . rnd=>'0', # 0 0 rnd inc. timer => [ # . { sh=>0, eh=>24, inc=>0 } # 0 . ] } }, { x=>'1064', y=>'733', rx=>'20', ry=>'10'}, # []. . { x=>'1131', y=>'668', rx=>'10', ry=>'2'}, # []. . # # . { x=>'1016', y=>'548', rx=>'20', ry=>'10'}, # []. . { # . # 20 + 0, 2, 4 8 # + 0 15 . # 400 . x=>'988', y=>'743', # . dx=>'804', dy=>'746', # . # 1 . inc=>{ # : x=>'1010', y=>'745', # 1. inc=>'19', # . rnd=>'15', # 0 0 rnd inc. timer => [ # . # - . { sh=>0, eh=>24, inc=>0 },# 0 . { sh=>0, eh=>8, inc=>8 },# +8 c 00.00 08.00. { sh=>8, eh=>9, inc=>4 },# +4 c 08.00 09.00. { sh=>9, eh=>10, inc=>2 } # +2 c 09.00 10.00. ] } }, { x=>'1083', y=>'736', rx=>'20', ry=>'10' }, # []. . { x=>'961', y=>'596', rx=>'14', ry=>'12' } # []. . );
#!/usr/bin/perl # 20 sleep 20; # my @g_trade = do "trade.guns.pl"; # . . # [Ctrl]+c. while(){ # . print "NEXT TRADE\n"; # . for my $l_cur ( @g_trade ){ sleep(1); if( defined $l_cur->{dx} ){ # dx - # . # ($l_count). # . my $l_count=$l_cur->{inc}{inc}; # . №2 - . my @l_curtime=localtime(time); # x, y . move($l_cur); # . my $l_inc=0; # . for my $l_timer ( @{$l_cur->{inc}{timer}} ){ # , . $l_inc=$l_timer->{inc} if $l_curtime[2] >= $l_timer->{sh} && $l_curtime[2] <= $l_timer->{eh}; } # . my $l_rnd=int(rand($l_cur->{inc}{rnd})); # . $l_count+=$l_inc; $l_count+=$l_rnd; # . print "\tSET: [$l_count] [$l_cur->{inc}{inc} + $l_up + $l_rnd\($l_cur->{inc}{rnd})]\n"; # . while ($l_count){ $l_count--; clicktoxy($l_cur->{inc}); usleep(80); } }else{ # dx - . clicktoxy($l_cur); } } # . 11 + 0 4 ( ). my $l_time=11+int(rand(4)); my $count=0; # . for($count=0;$count<$l_time;$count++){ sleep 60; mousemove(400,500); sleep 1; mousemove(1400,500); sleep 1; } # 0 60 sleep(int(rand(60))); # } sub usleep{ # ( Ms Windows). my $l_ptr=shift; $l_ptr*=1000; `usleep $l_ptr`; } sub move{ # . my $l_coord=shift; mousemove($l_coord->{x},$l_coord->{y}); mousedown(1); usleep(600); mousemove($l_coord->{dx},$l_coord->{dy}); mouseup(1); } sub click{ # . mousedown(1); mouseup(1); } sub clicktoxy{ # , # . my $l_coord=shift; mousemove($l_coord->{x},$l_coord->{y}); mousedown(1); mouseup(1); usleep(300); } sub mousedown{ # xdotool . # : # 1 - () # 2 - () my $l_key = shift; if( $l_key ){ `xdotool mousedown $l_key`; } } sub mouseup{ # xdotool . # : # 1 - () # 2 - () my $l_key = shift; if( $l_key ){ `xdotool mouseup $l_key`; } } sub mousemove{ # xdotool x, y. my $l_x = shift; my $l_y = shift; my $l_com='xdotool mousemove'; $l_com.=" $l_x $l_y"; `$l_com`; }
Source: https://habr.com/ru/post/145842/
All Articles