24.02.2011, 16:34
*grins*
Besser?
LG
Molt
Code:
# Nemesis iNk Bot by iNk ( http://unix.secure.la/adb/forums )
# Source File v2.1.0
use threads;
use threads::shared;
use Thread::Semaphore;
use strict;
use IO::Socket::INET;
use Time::HiRes qw(sleep);
use DBI;
use Tk;
our $version = '2.1.0';
our @C;
our $cfile = 'iNk-Bot.ini';
our $ifile = 'iNk-Bot.lnk';
if (@ARGV > 1) {
$cfile = $ARGV[0];
$ifile = $ARGV[1];
}
our $dbh;
our $host;
our $user;
our %ibot;
our @bots;
our $prevread;
our $read : shared;
our %avillages : shared;
our $inviteall : shared = 0;
our $allyfounded : shared = 0;
our $aggressive : shared = 0;
our $enemytarget : shared = 0;
our $ntarget;
my $mw = MainWindow->new;
my $box = $mw->Listbox(
-relief => 'raised',
-height => 20,
-width => 80,
-setgrid => 1,
-takefocus => '1'
);
$mw->title( 'DSLan \'iNk\' Bot v' . $version );
$mw->Label(-text => 'Copyright (c) iNk, www.thethirdway.tk')->pack;
my $scroll = $mw->Scrollbar(-command => ['yview', $box]);
$box->configure(-yscrollcommand => ['set', $scroll]);
$scroll->pack(-side => 'right', -fill => 'y');
$box->pack(-side => 'left', -fill => 'both', -expand => 1);
$mw->repeat(10, sub {
if (length($read) > 0 && $prevread ne $read) {
$box->insert('end', $read);
$prevread = $read;
}
});
&startup($box);
MainLoop;
sub start {
our $box = $_[2];
&sqlconnect() if &c($cfile, 'use-sql') eq 'true';
my $login;
@bots = split(/ /, &c($cfile, 'bot-names'));
$user = $bots[$_[1]-1];
$host = &c($cfile, 'dslan-host');
if (!( $login = &login($_[0]) )) {
if (!®ister($_[0])) {
&thar(" Registrierung von $user fehlgeschlagen.\n");
return;
} else {
&thar(" Account $user erstellt.\n");
&login($_[0]);
}
}
&thar(" $user eingeloggt.\n");
my $onetime = 0;
while (1) {
&update($login =~ /village=([0-9]+)/m, $_[1]);
for (my $i = 0; $i < @{$ibot{ 'vilnum' }}; $i++) {
my $vilnum = ${$ibot{ 'vilnum' }}[$i];
$vilnum =~ s/.*village=([0-9]+).*/$1/g;
if (!$onetime) {
if (&get( $host . "/game.php?village=$vilnum&screen=settings&mode=settings" )
=~ /([^"]+action=change_settings[^"]*)/m) {
my $settings = $1;
$settings =~ s/&/\&/g;
&get( $host . "/$settings", "map_size=15" );
}
my $hasally = &firstally($vilnum);
if ($hasally == 1) {
$inviteall = 1; sleep(3);
} elsif ($hasally == 2) {
if ($allyfounded) {
$onetime = 0;
last;
} else {
$allyfounded = 1;
}
&thar(" Stamm ".&c($cfile, 'ally-name')." wurde gegruendet.\n");
} elsif ($hasally == 3) {
&thar(" $user tritt Stamm bei.\n");
$onetime = 1
} else {
&invite($vilnum);
$onetime = 1
}
} else {
&update($vilnum, $_[1]);
&build($vilnum);
if ($ibot{'aktfarmlevel'} > 23900 && $ibot{'snobs'} < 1 && @{$ibot{'vilnum'}} < 3) {
my @enemyvils = @{&getenemyvils($vilnum)};
&singleattack($vilnum, $enemyvils[ int( rand(@enemyvils) ) ]);
}
&snobing($vilnum) if ($ibot{ 'aktsnob' } > 0);
if ($enemytarget) {
if (&checkavillages($enemytarget)) {
&singleattack($vilnum, $enemytarget );
} else {
$enemytarget = 0;
}
}
&recruit($vilnum);
&look($vilnum);
invite($vilnum) if ($inviteall);
&thar(" $user -> ${vilnum}\n") if (&c($cfile, 'verbose') eq 'true');
#&thar(" $user: spear:".$ibot{ 'aktspear' }.", axe:".$ibot{ 'aktaxe' }.".\n");
}
}
}
}
sub look {
my $look = &get( $host . "/game.php?village=$_[0]&screen=report" );
my $enemy;
if ( $look =~ /f="([^"]+)"[^"]+"[^"]+red\.png[^a-zA-Z_0-9]+([a-zA-Z_0-9]+).*neu/m ) {
my ($var1, $var2) = ($2, $1); $var2 =~ s/&/\&/g;
if ($var1 eq $user) {
&thar(" $user lernt Angriffstechniken.\n");
my $naxe = &c($ifile, 'axe-attack') * 1.5; $naxe = 9900 if ($naxe > 10000);
&c($ifile, 'axe-attack', $naxe);
my $nlight = &c($ifile, 'light-attack') * 1.5; $nlight = 2100 if ($nlight > 2500);
&c($ifile, 'light-attack', $nlight);
my $nheavy = &c($ifile, 'heavy-attack') * 1.5; $nheavy = 500 if ($nheavy > 750);
&c($ifile, 'heavy-attack', $nlight);
} else {
&thar(" $user lernt Verteidigungstechniken.");
my $naxe = &c($ifile, 'spear-attack') * 1.5; $naxe = 9000 if ($naxe > 10000);
&c($ifile, 'spear-attack', $naxe);
my $nlight = &c($ifile, 'sword-attack') * 1.5; $nlight = 9000 if ($nlight > 10000);
&c($ifile, 'sword-attack', $nlight);
my $nheavy = &c($ifile, 'heavy-attack') * 1.5; $nheavy = 500 if ($nheavy > 750);
&c($ifile, 'heavy-attack', $nlight);
$naxe = &c($ifile, 'axe-attack') * 1.5; $naxe = 9900 if ($naxe > 10000);
&c($ifile, 'axe-attack', $naxe);
$nlight = &c($ifile, 'light-attack') * 1.5; $nlight = 2100 if ($nlight > 2500);
&c($ifile, 'light-attack', $nlight);
}
$look = &get( $host . "/$var2" );
if ($look =~ /Angreifer:[^\n]+\n[^"]+"([^"]+)/m && $var1 ne $user) {
$look = $1;
$look =~ s/.*id=([0-9]+).*/$1/g;
$enemytarget = $look; &thar(" -> Globales Feindziel: \[$ntarget\], Initiator: $user.");
}
}
}
sub checkavillages {
while ( my($k,$v) = each %avillages) {
if (&checkarray($_[0], \@{$v}) == 0) {
return 0;
}
}
return 1;
}
sub snobing {
if ($ntarget > 0 && &checkavillages($ntarget))
{
&singleattack($_[0], $ntarget);# &thar(" $user attackiert $ntarget.\n");
} else {
my @farmvils;
if ($aggressive) {
@farmvils = @{&getenemyvils($_[0])};
} else {
@farmvils = @{&getfarmvils($_[0])};
}
if (@farmvils > 0) {
$ntarget = $farmvils[ int( rand(@farmvils) ) ];
&singleattack($_[0], $ntarget);
}
}
}
sub sqlconnect {
my $database = 'lan';
my $hostname = &c($cfile,'dslan-host');
my $dsn = "DBI:mysql:database=$database;host=$hostname";
my $user = "root"; my $pass = &c($cfile,'root-password');
$dbh = DBI::->connect( $dsn, $user, $pass,
{ 'RaiseError' => 1, 'AutoCommit' => 1 } );
}
sub sql {
my @resarray;
my $response;
my $sql = $_[0];
my $sth = $dbh->prepare($sql);
$sth->execute;
while ( my $row = $sth->fetchrow_arrayref ) {
$response = $response . " @{ $row }"; }
@resarray = split( / /, $response );
return \@resarray;
}
sub sqldisconnect {
$dbh->disconnect;
}
sub getfarmvils {
my @vils;
my $farm;
if (&c($cfile, 'use-sql') eq 'true') {
$farm = &sql('SELECT `id` FROM `villages` WHERE `userid` = -1 LIMIT 0, 30');
@vils = @{$farm};
} else {
$farm = &get( $host . "/game.php?village=$_[0]&screen=map" );
foreach( split( /\n/, $farm ) ) {
if (/background-color:rgb\(180,0,0\)(.+)/) { #null, null, false
$farm = $1;
$farm =~ s/.*id=([0-9]+).*/$1/g;
push @vils, $farm;
}
}
}
return \@vils;
}
sub recruit {
my @barrunits = ('axe', 'spear', 'sword');
&shuffle(\@barrunits);
my @units = (@barrunits, 'light', 'heavy');
&snob($_[0]) if ($ibot{ 'hassnobb' });
for (my $i = 0; $i < 3; $i++) {
my $sunits = &c($ifile, $units[$i].'-attack') - $ibot{ 'akt'.$units[$i] };
#&thar(" muss $sunits $units[$i] rekrutieren\n");
next if ($sunits < 1);
my $barracks = &get( $host . "/game.php?village=$_[0]&screen=barracks" );
if ($barracks =~ /\.unit_$units[$i], ([0-9]+)/m) {
$sunits = $1 if ($sunits > $1);
}
next if ($barracks =~ /action=cancel/m);
if ($barracks =~ /([^"]+action=train[^"]*)/m) {
my $train = $1;
$train =~ s/&/\&/g;
if ($barracks !~ /input name="unit_$units[$i]/m) {
if(&smith ($_[0], $units[$i])) {
$barracks = &get( $host . "/$train", "submit=Rekrutieren&unit_".$units[$i]."=$sunits" );
#&thar(" $user forscht und rekrutiert Infanterie.\n");
}
} else {
$barracks = &get( $host . "/$train", "submit=Rekrutieren&unit_".$units[$i]."=$sunits" );
#&thar(" $user rekrutiert Infanterie.\n");
}
}
}
for (my $i = 2; $i < 5; $i++) {
my $sunits = &c($ifile, $units[$i].'-attack') - $ibot{ 'akt'.$units[$i] };
next if ($sunits < 1);
my $barracks = &get( $host . "/game.php?village=$_[0]&screen=stable" );
if ($barracks =~ /\.unit_$units[$i], ([0-9]+)/m) {
$sunits = $1 if ($sunits > $1);
}
next if ($barracks =~ /action=cancel/m);
if ($barracks =~ /([^"]+action=train[^"]*)/m) {
my $train = $1;
$train =~ s/&/\&/g;
if ($barracks !~ /input name="unit_$units[$i]/m) {
if(&smith ($_[0], $units[$i])) {
$barracks = &get( $host . "/$train", "submit=Rekrutieren&unit_".$units[$i]."=$sunits" );
#&thar(" $user forscht und rekrutiert Kavallerie.\n");
}
} else {
$barracks = &get( $host . "/$train", "submit=Rekrutieren&unit_".$units[$i]."=$sunits" );
#&thar(" $user rekrutiert Kavallerie.\n");
}
}
}
}
sub snob {
my $snob = &get( $host . "/game.php?village=$_[0]&screen=snob" );
if ($snob =~ /([^"]+action=train_snob[^"]*)/m) {
$snob = $1;
$snob =~ s/&/\&/g;
$snob = &get( $host . "/$snob" );
&thar(" $user rekrutiert ein Adelsgeschlecht.\n");
}
return $snob;
}
sub smith {
my $smith =
&get( $host . "/game.php?village=$_[0]&screen=smith" );
my $regvar = $_[1];
if ($smith =~ /([^"\n]+action=research&id=${regvar}[^"\n]*)/m) {
my $research = $1;
$research =~ s/&/\&/g;
for (my $i = 0; $i < 3; $i++) {
$research = &get( $host . "/$research" );
}
return 1;
}
return 0;
}
sub build {
my $build =
&get( $host . "/game.php?village=$_[0]&screen=main" );
if ($build =~ /screen=snob/m) {
$ibot{ 'hassnobb' } = 1; }
else { $ibot{ 'hassnobb' } = 0; }
while ( $build =~ /action=build/m ) {
if ($build !~ /\n([^\n]*iNk::$user[^\n]*)/) {
if ($build =~ /([^"]+action=change_name[^"]*)/m) {
my $rename = $1;
$rename =~ s/&/&/g;
&get( $host . "/$rename", "name=iNk::$user" );
}
}
if ($build =~ /([^"]+action=build[^"]*)/m) {
my $url = $1;
$url =~ s/&/\&/g;
$build = &get( $host . "/$url" );
}
}
}
sub debug {
open (TMP, ">debug.txt");
&thar(TMP $_[0]);
close(TMP);
system("notepad debug.txt");
}
sub singleattack {
return if ($_[1] < 1);
my $stattack = &get( $host . "/game.php?village=$_[0]&screen=place&mode=command&target=$_[1]" );
my( $x, $y );
if ($stattack =~ /x: <input[^\n]+value="([0-9]+)[^\n]+\n[^\n]+value="([0-9]+)/m)
{
$x = $1;
$y = $2;
}
my $spear = $1 if ($stattack =~ /\.unit_spear, ([0-9]+)/m);
my $sword = $1 if ($stattack =~ /\.unit_sword, ([0-9]+)/m);
my $axe = $1 if ($stattack =~ /\.unit_axe, ([0-9]+)/m);
my $spy = $1 if ($stattack =~ /\.unit_spy, ([0-9]+)/m);
my $light = $1 if ($stattack =~ /\.unit_light, ([0-9]+)/m);
my $heavy = $1 if ($stattack =~ /\.unit_heavy, ([0-9]+)/m);
my $snob = $1 if ($stattack =~ /\.unit_snob, ([0-9]+)/m);
my $ram = $1 if ($stattack =~ /\.unit_ram, ([0-9]+)/m);
$snob = 1 if ($snob > 1);
return if ($light < &c ($ifile, 'light-attack') ||
$heavy < &c ($ifile, 'heavy-attack') ||
$axe < &c ($ifile, 'axe-attack'));
if ($stattack =~ /([^"]+try=confirm[^"]*)/m)
{
$stattack = $1;
$stattack =~ s/&/\&/g;
$stattack = &get( $host . "/$stattack", "unit_axe=$axe&"
. "unit_heavy=$heavy&"
. "unit_light=$light&"
. "unit_snob=$snob&"
. "unit_ram=$ram&"
. "x=$x&y=$y&attack=Angreifen" );
&thar(" $user schickt ein Adelsgeschlecht los. (".$x."|".$y.") \[$_[1]\] \n") if ($snob);
my (@aparas, @apara);
foreach ( split( /\n/, $stattack ) ) { push @apara, $_ }
@apara = grep( /type="hidden"/, @apara );
foreach my $spara (@apara) {
$spara =~ s/.*name="([a-z_]+)".*value="([0-9a-z]+)".*/$1=$2/g;
$spara =~ s/[\n\r\t ]//g;
push @aparas, $spara;
}
if ($stattack =~ /([^"]+action=command[^"]+)/m) {
$stattack = $1;
$stattack =~ s/&/\&/g;
}
$stattack = &get( $host . "/$stattack", join( "&", @aparas)."&submit=OK" );
}
}
sub shuffle {
my $array = shift;
my $i = @$array;
while ( --$i )
{
my $j = int rand( $i+1 );
@$array[$i,$j] = @$array[$j,$i];
}
}
sub getenemyvils {
my @vils;
my $rang = &get( $host . "/game.php?village=$_[0]&screen=ranking" );
my @tmp = split( /\n/, $rang ); &shuffle( \@tmp );
foreach( @tmp )
{
if (/screen=info_player/) {
if (&checkarray($_, \@bots)) {
my $enemy = $_;
$enemy =~ s/.*f="([^"]+)".*/$1/g; $enemy =~ s/&/\&/g;
$enemy = &get( $host . "/$enemy" );
foreach( split( /\n/, $enemy ) ) {
if (/screen=info_village/) {
$enemy = $_;
$enemy =~ s/.*id=([0-9]+).*/$1/g;
push @vils, $enemy;
}
}
return \@vils;
}
}
}
return 0;
}
sub checkarray {
my @array = @{$_[1]};
my $skalar = $_[0];
foreach (split( /\n/, $skalar)) {
my $checkvar = $_;
foreach (@array) {
if ($checkvar =~ /$_/ || $checkvar == $_) {
return 0;
}
}
}
return 1;
}
sub invite {
if ($inviteall == 1 && $_[1] != 1) {
my $ally = &get( $host . "/game.php?village=$_[0]&screen=ally&mode=invite" );
if ($ally =~ /([^\n]+action=invite[^\n]+)/m) {
my $tribe = $1;
$tribe =~ s/.*action="([^"]+)".*/$1/g; $tribe =~ s/&/\&/g;
foreach (@bots) {
&get( $host . "/$tribe", "name=$_&submit= OK " );
}
$ibot{ 'allyfounder' } = 1;
$inviteall = 0;
} else {
$ibot{ 'allyfounder' } = 0;
}
}
}
sub firstally {
my $allyname = &c($cfile, 'ally-name');
my $ally_ = &get( $host . "/game.php?village=$_[0]&screen=ranking&mode=ally" );
my $ally = &get( $host . "/game.php?village=$_[0]&screen=ally" );
if ($ally_ =~ /">$allyname<\/a>/m) {
if ($ally =~ /([^\n]+action=accept[^\n]+)/m) {
my $tribe = $1;
$tribe =~ s/.*href="([^"]+)".*/$1/g; $tribe =~ s/&/\&/g;
$ally = &get( $host . "/$tribe" );
return 3;
}
if ($ally !~ /action=create/m) {
return 0;
}
return 1;
} else {
if ($ally =~ /([^\n]+action=create[^\n]+)/m) {
my $tribe = $1;
$tribe =~ s/.*action="([^"]+)".*/$1/g; $tribe =~ s/&/\&/g;
$ally = &get( $host . "/$tribe", "name=iNk::$allyname&tag=$allyname&submit=Gründen" );
$ally = &get( $host . "/game.php?village=$_[0]&screen=ally&mode=invite" );
if ($ally =~ /action=invite/m) {
$tribe = $1;
$tribe =~ s/.*action="([^"]+)".*/$1/g; $tribe =~ s/&/\&/g;
foreach (@bots) {
&get( $host . "/$tribe", "name=$_&submit= OK " );
}
}
}
return 2;
}
}
sub update {
my $overview = &get( $host . "/game.php?village=$_[0]&screen=overview_villages");
my %backup = %ibot;
my @vtmp : shared;
my @villages;
&ibot( 'points', $overview =~ /Rangliste[^|]+[0-9]+[^0-9]+([0-9]+[^0-9]+[0-9]+)/m );
my $points = &ibot( 'points' ); $points =~ s/[^0-9]+//g; &ibot( 'points', $points );
&ibot( 'rang', $overview =~ /Rangliste<\/a> \(([0-9]+)\./m );
undef @vtmp;
foreach ( split( /\n/, $overview ) )
{
if (/&screen=overview">/) {
my $urlv = $_;
$urlv =~ s/.*href="([^"]+)"/$1/g;
push @villages, $urlv;
$urlv =~ s/.*village=([0-9]+).*/$1/g;
push @vtmp, $urlv;
}
}
&ibot( 'vilnum', \@villages );
$avillages{ $user } = \@vtmp;
&ibot( 'aktfarmlevel', $overview =~ /<td align="center">([0-9]+)\/[0-9]+/m =~ /([0-9]+)/ );
&ibot( 'aktvilname', $overview =~ /screen=overview">([^<]+)<\/a>/m );
if (keys( %backup ) > 2) {
&thar(" $user ist nun ".$ibot{'rang'}.".\n") if $ibot{'rang'} != $backup{'rang'}
&& $ibot{'points'} > 12300;
if (@{$ibot{'vilnum'}} > @{$backup{'vilnum'}} && @{$backup{'vilnum'}}) {
&thar(" $user erobert ein Dorf. (".@{$backup{'vilnum'}}."->".@{$ibot{'vilnum'}}.")\n");
$aggressive = 0;
} elsif (@{$ibot{'vilnum'}} < @{$backup{'vilnum'}}) {
&thar(" $user verlor ein Dorf. (".@{$backup{'vilnum'}}."->".@{$ibot{'vilnum'}}.")\n");
$aggressive = 1;
};
}
my $place = &get( $host . "/game.php?village=$_[0]&screen=place&mode=units" );
my $getunits = $place;
$getunits = $1 if ($getunits =~ /Insgesamt[^\n]*\n([^\n]+)/m);
$getunits =~ s/[^0-9\/]//g; #&thar($getunits."\n");
my @akts = split( /\//, $getunits );
$ibot{ 'aktspear' } = $akts[0];
$ibot{ 'aktsword' } = $akts[1];
$ibot{ 'aktaxe' } = $akts[2];
$ibot{ 'aktspy' } = $akts[3];
$ibot{ 'aktlight' } = $akts[4];
$ibot{ 'aktheavy' } = $akts[5];
$ibot{ 'aktsnob' } = $akts[8];
$ibot{ 'aktram' } = $akts[6];
my @tmp;
foreach ( split( /\n/, $place ) ) { push @tmp, $_ if /action=all_back/ }
for ( my $i = 0 ; $i < @tmp ; $i++ ) {
$place = $tmp[$i];
$place =~ s/.*href="([^"]+)">.*/$1/g;
$place =~ s/&/\&/g;
&get( $host . "/$place" );
}
#if ($points > 30000) {
# &c($ifile, 'axt-attack', '10000');
# &c($ifile, 'light-attack', '2000');
# &c($ifile, 'heavy-attack', '0');
# &c($ifile, 'spear-attack', '3000');
# &c($ifile, 'sword-attack', '3000');
#}
}
sub ibot {
$ibot{ $_[0] } = $_[1] if @_ > 1;
return $ibot{ $_[0] } if @_ < 2;
}
sub register {
my $register = &get( $host . "/register.php?action=validate",
"name=$user&password=boootj&password_confirm=boootj&agb=on&submit=Registrieren"
);
if ($register =~ /erfolgreich/m)
{
return 1;
} else {
return 0;
}
}
sub login {
my $login = &get(
$host . "/index.php?action=login",
"user=$user&clear=true&password=boootj"
);
if ($login =~ /action=logout/m)
{
return $login;
} elsif ($login =~ /action=create/m)
{
return &get( $host . "/create_village.php?action=create", "direction=nw" );
} else {
return 0;
}
}
sub startup {
my $config = "iNk Bot - Konfigurationsdatei Version $version
\n\tdslan-host=localhost;;
\tbot-names=Nemesis;;
\tsleep-delay=0.0;;
\tdef-units=spear sword;;
\trecruit-all=0;;
\tally-name=iNkas;;
\tverbose=false;;
\tuse-sql=false;;
\troot-password=;;
";
my $internalconfig = "\taxe-attack=250;;\n\tlight-attack=100;;\n\theavy-attack=100;;\n\tangry-level=1;;
\tspear-attack=100;;\n\tsword-attack=50;;\n";
my $renew = 0;
#&thar("iNk Bot v$version\n\n");
&thar('');
open( TARGET, "<".$ifile );
if ( !<TARGET> ) {
open( TARGET, ">".$ifile );
print TARGET $internalconfig;
close(TARGET);
}
open( TARGET, "<".$cfile );
if ( !<TARGET> ) {
open( TARGET, ">".$cfile );
print TARGET $config;
close(TARGET);
}
else {
open( TARGET, "<".$cfile );
while (<TARGET>) {
if ( $_ =~ /.*$version.*/ ) { $renew = 1; }
}
}
if ( $renew == 0 ) {
close(TARGET);
open( TARGET, ">".$cfile );
print TARGET $config;
close(TARGET);
}
my $i = 1;
foreach ( split (/ /, &c($cfile, 'bot-names')) )
{
threads->new( \&start, $_, $i++, $_[0] );
}
}
sub thar {
#my $s = Thread::Semaphore->new();
#$s->down();
$read = $_[0];
#$box->insert('end', $_[0]);
#$s->up();
}
sub c {
my ( @tmp, $v );
if ( !defined( $_[2] ) && $_[3] != 1 ) {
open( TARGET, '<', $_[0] );
while (<TARGET>) {
foreach ( split( /\n/, $_ ) ) {
$v = ${_} if /$_[1]=/i;
}
$v =~ s/.*$_[1]=(.*);;/\1/gi;
}
close(TARGET);
return $v;
}
else {
open( TARGET, '>', $_[0] . ".ZOR" );
open( SOURCE, '<', $_[0] );
my $done = 0;
my ($be) = ( $_[2] );
while (<SOURCE>) {
my ($ln, $nl) = ($_, $_[1]);
if (/$nl=/) {
$ln =~ s/=.*;;/=$be;;/g;
$done = 1;
}
print TARGET $ln;
}
if ( !$done ) {
print TARGET "$_[1]=$be;;\n";
}
close(TARGET);
close(SOURCE);
unlink( $_[0] );
rename( $_[0] . ".ZOR", $_[0] );
return $_[2];
}
}
sub ddble { my (%dd) = (); @dd{@_} = 1; return ( keys %dd ); }
Besser?
LG
Molt