#!/usr/bin/perl -wusestrict;# binmodes$|=1;binmodeSTDOUT,':utf8';binmodeSTDERR,':utf8';my$debug=-1;for(my$i=@ARGV-1;$i>=0;$i--){my$arg=$ARGV[$i];nextunless$arg=~/^--/;splice(@ARGV,$i,1);if($argeq'--nodebug'){$debug=0;}elsif($arg=~ /--debug=(\d+)/){$debug=$1;}else{die"Unrecognized option $arg\n";}}die"USAGE: $0 [--nodebug|--debug=<n>] botnum taskfile\n"if@ARGV!=2;my$dir="/tmp/anomiebot-test";die"Could not create directory $dir: $!\n"if(!-d$dir&&!mkdir($dir));if(-e$dir.'/test'){unlink($dir.'/test');die"Could not remove test file in $dir: $!\n"if(-e$dir.'/test');}open(X,">",$dir.'/test')ordie("Could not create test file in $dir: $!\n");close(X);unlink($dir.'/test');useCwd;useFile::Basename;uselibFile::Basename::dirname(Cwd::realpath(__FILE__));useAnomieBOT::API;my$task='';open(X,'<:utf8',$ARGV[1])ordie("Could not open task file: $!\n");while(<X>){$task=$1if/^package (.*);$/;}close(X);die"Invalid task file"unless$taskne'';AnomieBOT::API::load($ARGV[1]);$task=$task->new();my$api=AnomieBOT::API->new('conf.ini',$ARGV[0]);$api->{'nopause'}=1;$api->{'noedit'}=$dir;$api->login();$api->DEBUG($debug);my$t;do{$t=$task->run($api);$t='undef'if!defined($t);warn"Returned $t\n";}while($tne'undef'&&$t<=60);
Diese Website benutzt Cookies. Wenn du die Website weiter nutzt, gehe Ich von Deinem Einverständnis aus.OKNeinDatenschutzerklärung