Amxmodx to sourcemod admin list: Difference between revisions
From Mike Beane's Blog
(New page: <pre> #!/usr/bin/perl $USERS_IN="users.ini"; $out="admins.txt"; open OUT, ">$out" or die "Cannot open $out for write :$!"; open LOGFILE_IN, $LOGFILE_IN or die "Cannot open $LOGFILE_IN fo...) |
mNo edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
#!/usr/bin/perl | #!/usr/bin/perl | ||
$ | $LOGFILE_IN="users.ini"; | ||
$out="admins.txt"; | $out="admins.txt"; | ||
open OUT, ">$out" or die "Cannot open $out for write :$!"; | open OUT, ">$out" or die "Cannot open $out for write :$!"; | ||
open LOGFILE_IN, $LOGFILE_IN or die "Cannot open $LOGFILE_IN for read :$!"; | open LOGFILE_IN, $LOGFILE_IN or die "Cannot open $LOGFILE_IN for read :$!"; | ||
while (<LOGFILE_IN>) | |||
{ | { | ||
#"STEAM_0:1:359131" "f0C4p4ss" "bcdfgijlmnopqrstu" "c";"FoCA|VelvetMan" | |||
if ($_=~/^"(.*)"(.*)"(.*)"(.*)"(.*)"(.*)"(.*)";"(.*)"/) | |||
{ | |||
print OUT "\"$8\"\n"; | |||
print OUT "{\n"; | |||
print OUT "\"auth\" \"steam\"\n"; | |||
print OUT "\"identity\" \"$1\"\n"; | |||
print OUT "\"flags\" \"abcdefgjk\"\n"; | |||
print OUT "}\n"; | |||
} | |||
else {print OUT "*********************$8\n";} | |||
} | |||
</pre> | </pre> | ||
Line 27: | Line 28: | ||
[[Category:Steam]] | [[Category:Steam]] | ||
[[Category:Gaming]] | [[Category:Gaming]] | ||
[[Category:2007-11]] | [[Category:Perl]] | ||
[[Category:Weblog-2007-11]] |
Latest revision as of 19:40, 31 December 2007
#!/usr/bin/perl $LOGFILE_IN="users.ini"; $out="admins.txt"; open OUT, ">$out" or die "Cannot open $out for write :$!"; open LOGFILE_IN, $LOGFILE_IN or die "Cannot open $LOGFILE_IN for read :$!"; while (<LOGFILE_IN>) { #"STEAM_0:1:359131" "f0C4p4ss" "bcdfgijlmnopqrstu" "c";"FoCA|VelvetMan" if ($_=~/^"(.*)"(.*)"(.*)"(.*)"(.*)"(.*)"(.*)";"(.*)"/) { print OUT "\"$8\"\n"; print OUT "{\n"; print OUT "\"auth\" \"steam\"\n"; print OUT "\"identity\" \"$1\"\n"; print OUT "\"flags\" \"abcdefgjk\"\n"; print OUT "}\n"; } else {print OUT "*********************$8\n";} }