[hlds_linux] Anyone good with perl scripting?

2007-09-22 Thread [EMAIL PROTECTED]

Using this installed:

http://turkeyfiles.escapedturkey.net/misc/scripts/root/rcon-hl2-0.02.tar.gz

trying to make a script that reads parameters (hl2rcon.pl):

#!/usr/bin/perl
my $rcon = Rcon::HL2-new(
hostname = $ipaddress:$port,
password = $pass,
timeout = 3,
);

$rcon-run($command);
print $rcon-response();
# end

I just need to add a portion to this script to do the following (so I
can pass on parameters to it):

./hl2rcon.pl -ip -port -pass -command

Example:

./hl2rcon.pl -ip 72.5.249.2 -port 20715 -pass whatever -command
status

Thank you. =)



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux


Re: [hlds_linux] Anyone good with perl scripting?

2007-09-22 Thread ratman2000
Hello,

thats not the full script!
You use an Class Rcon and thats defined in another file!

Look at the other files, how he reads the $ipaddress and port and add your
to it...

With friendly reguards

Ratman2000

- Original Message -
From: [EMAIL PROTECTED]
To: hlds_linux@list.valvesoftware.com
Sent: Saturday, September 22, 2007 9:39 AM
Subject: [hlds_linux] Anyone good with perl scripting?


 Using this installed:


http://turkeyfiles.escapedturkey.net/misc/scripts/root/rcon-hl2-0.02.tar.gz

 trying to make a script that reads parameters (hl2rcon.pl):

 #!/usr/bin/perl
 my $rcon = Rcon::HL2-new(
 hostname = $ipaddress:$port,
 password = $pass,
 timeout = 3,
 );

 $rcon-run($command);
 print $rcon-response();
 # end

 I just need to add a portion to this script to do the following (so I
 can pass on parameters to it):

 ./hl2rcon.pl -ip -port -pass -command

 Example:

 ./hl2rcon.pl -ip 72.5.249.2 -port 20715 -pass whatever -command
 status

 Thank you. =)



 ___
 To unsubscribe, edit your list preferences, or view the list archives,
please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlds_linux


___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux


Re: [hlds_linux] Anyone good with perl scripting?

2007-09-22 Thread Tom Leighton

I think in his own script he is trying to catch the arguments.

Take a look here:
http://kbrin.a-bldg.louisville.edu/~rouchka/PERL/Week6.htm


[EMAIL PROTECTED] wrote:

Hello,

thats not the full script!
You use an Class Rcon and thats defined in another file!

Look at the other files, how he reads the $ipaddress and port and add your
to it...

With friendly reguards

Ratman2000

- Original Message -
From: [EMAIL PROTECTED]
To: hlds_linux@list.valvesoftware.com
Sent: Saturday, September 22, 2007 9:39 AM
Subject: [hlds_linux] Anyone good with perl scripting?




Using this installed:




http://turkeyfiles.escapedturkey.net/misc/scripts/root/rcon-hl2-0.02.tar.gz


trying to make a script that reads parameters (hl2rcon.pl):

#!/usr/bin/perl
my $rcon = Rcon::HL2-new(
hostname = $ipaddress:$port,
password = $pass,
timeout = 3,
);

$rcon-run($command);
print $rcon-response();
# end

I just need to add a portion to this script to do the following (so I
can pass on parameters to it):

./hl2rcon.pl -ip -port -pass -command

Example:

./hl2rcon.pl -ip 72.5.249.2 -port 20715 -pass whatever -command
status

Thank you. =)



___
To unsubscribe, edit your list preferences, or view the list archives,


please visit:


http://list.valvesoftware.com/mailman/listinfo/hlds_linux




___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux





___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux


Re: [hlds_linux] Anyone good with perl scripting?

2007-09-22 Thread Ian mu
--
[ Picked text/plain from multipart/alternative ]
Not entirely sure what exactly you are wanting, but I'm guessing maybe
something like ...

my $params = join( ,@ARGV);

$params =~ m/\-ip +(\S+) +-port +(\S+) +-pass +(\S+) +-command +(.+)/;

my $ipaddress = $1;
my $port = $2;
my $pass = $3;
my $command = $4;



My regex isn't the best and a few diff ways to do it I guess.

Ian





On 9/22/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Using this installed:


 http://turkeyfiles.escapedturkey.net/misc/scripts/root/rcon-hl2-0.02.tar.gz

 trying to make a script that reads parameters (hl2rcon.pl):

 #!/usr/bin/perl
 my $rcon = Rcon::HL2-new(
 hostname = $ipaddress:$port,
 password = $pass,
 timeout = 3,
 );

 $rcon-run($command);
 print $rcon-response();
 # end

 I just need to add a portion to this script to do the following (so I
 can pass on parameters to it):

 ./hl2rcon.pl -ip -port -pass -command

 Example:

 ./hl2rcon.pl -ip 72.5.249.2 -port 20715 -pass whatever -command
 status

 Thank you. =)



 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlds_linux

--

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux


Re: [hlds_linux] Anyone good with perl scripting?

2007-09-22 Thread Nolan Hurlburt
--
[ Picked text/plain from multipart/alternative ]
use Getopt::Long;

my $ipaddress;
my $port;
my $pass;
my $command;

$result = GetOptions (ipaddress|i=s = \$ipaddress,
port|p=s  = \$port,
pass|x=s  = \$pass,
command|c=s   = \$command );

Getops::Long full documentation here:
http://perldoc.perl.org/Getopt/Long.html

Hope this helps

On 9/22/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Using this installed:


 http://turkeyfiles.escapedturkey.net/misc/scripts/root/rcon-hl2-0.02.tar.gz

 trying to make a script that reads parameters (hl2rcon.pl):

 #!/usr/bin/perl
 my $rcon = Rcon::HL2-new(
 hostname = $ipaddress:$port,
 password = $pass,
 timeout = 3,
 );

 $rcon-run($command);
 print $rcon-response();
 # end

 I just need to add a portion to this script to do the following (so I
 can pass on parameters to it):

 ./hl2rcon.pl -ip -port -pass -command

 Example:

 ./hl2rcon.pl -ip 72.5.249.2 -port 20715 -pass whatever -command
 status

 Thank you. =)



 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlds_linux

--

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux


RE: [hlds_linux] Anyone good with perl scripting?

2007-09-22 Thread Chris Green
GetOpt is the best way to handle keyworded arguments like this
http://world.std.com/~swmcd/steven/perl/pm/getopt.html


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ian mu
Sent: Saturday, September 22, 2007 7:32 AM
To: hlds_linux@list.valvesoftware.com
Subject: Re: [hlds_linux] Anyone good with perl scripting?

--
[ Picked text/plain from multipart/alternative ]
Not entirely sure what exactly you are wanting, but I'm guessing maybe
something like ...

my $params = join( ,@ARGV);

$params =~ m/\-ip +(\S+) +-port +(\S+) +-pass +(\S+) +-command +(.+)/;

my $ipaddress = $1;
my $port = $2;
my $pass = $3;
my $command = $4;



My regex isn't the best and a few diff ways to do it I guess.

Ian





On 9/22/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Using this installed:



http://turkeyfiles.escapedturkey.net/misc/scripts/root/rcon-hl2-0.02.tar
.gz

 trying to make a script that reads parameters (hl2rcon.pl):

 #!/usr/bin/perl
 my $rcon = Rcon::HL2-new(
 hostname = $ipaddress:$port,
 password = $pass,
 timeout = 3,
 );

 $rcon-run($command);
 print $rcon-response();
 # end

 I just need to add a portion to this script to do the following (so I
 can pass on parameters to it):

 ./hl2rcon.pl -ip -port -pass -command

 Example:

 ./hl2rcon.pl -ip 72.5.249.2 -port 20715 -pass whatever -command
 status

 Thank you. =)



 ___
 To unsubscribe, edit your list preferences, or view the list archives,
 please visit:
 http://list.valvesoftware.com/mailman/listinfo/hlds_linux

--

___
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux


Re: [hlds_linux] Anyone good with perl scripting?

2007-09-22 Thread [EMAIL PROTECTED]

Thank you to all that helped. I was just telling a friend that after
signing up to this hlds_linux list, I've never before seen such
friendly, knowledgeable, and professional people until now. You all rock! =)

Thank you again. =)

Nolan Hurlburt wrote:

--
[ Picked text/plain from multipart/alternative ]
use Getopt::Long;

my $ipaddress;
my $port;
my $pass;
my $command;

$result = GetOptions (ipaddress|i=s = \$ipaddress,
port|p=s  = \$port,
pass|x=s  = \$pass,
command|c=s   = \$command );

Getops::Long full documentation here:
http://perldoc.perl.org/Getopt/Long.html

Hope this helps

On 9/22/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

Using this installed:


http://turkeyfiles.escapedturkey.net/misc/scripts/root/rcon-hl2-0.02.tar.gz

trying to make a script that reads parameters (hl2rcon.pl):

#!/usr/bin/perl
my $rcon = Rcon::HL2-new(
hostname = $ipaddress:$port,
password = $pass,
timeout = 3,
);

$rcon-run($command);
print $rcon-response();
# end

I just need to add a portion to this script to do the following (so I
can pass on parameters to it):

./hl2rcon.pl -ip -port -pass -command

Example:

./hl2rcon.pl -ip 72.5.249.2 -port 20715 -pass whatever -command
status

Thank you. =)



___
To unsubscribe, edit your list preferences, or view the list archives,
please visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux


--

___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux



___
To unsubscribe, edit your list preferences, or view the list archives, please 
visit:
http://list.valvesoftware.com/mailman/listinfo/hlds_linux