Need a way to start rotation script when the new match begin

What do you want to see in Armagetron soon? Any new feature ideas? Let's ponder these ground breaking ideas...
User avatar
Al's Used Cars
On Lightcycle Grid
Posts: 45
Joined: Sun Dec 03, 2006 3:22 pm
Location: Baltimore, MD

Post by Al's Used Cars »

this is what happens when i enter the cmd:



admin@ubuntu:~$ sudo tail -f -n0 /home/admin/soc/var/ladderlog.txt | /home/admin/soc/etc/games/armagetronad-dedicated/rotation3.sh
-bash: /home/admin/soc/etc/games/armagetronad-dedicated/rotation3.sh: Permission denied
Password:

i enter the pswd, then theres nothing... should there be a confirmation, or some sign that its now working?

should i try to incorporate a login into the command?
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Al's Used Cars wrote:-bash: /home/admin/soc/etc/games/armagetronad-dedicated/rotation3.sh: Permission denied
Is it really executable? And do you need sudo to read the ladder log?
ˌɑrməˈɡɛˌtrɑn
User avatar
Al's Used Cars
On Lightcycle Grid
Posts: 45
Joined: Sun Dec 03, 2006 3:22 pm
Location: Baltimore, MD

Post by Al's Used Cars »

heres what i used to make exec


admin@ubuntu:~/soc/data$ cd /home/admin/soc/etc/games/armagetronad-dedicated/
admin@ubuntu:~/soc/etc/games/armagetronad-dedicated$ sudo chmod a=r+w+x rotation3.sh
Password:
admin@ubuntu:~/soc/etc/games/armagetronad-dedicated$

((server msg on login says:
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.))
User avatar
Al's Used Cars
On Lightcycle Grid
Posts: 45
Joined: Sun Dec 03, 2006 3:22 pm
Location: Baltimore, MD

Post by Al's Used Cars »

ok, now i'm getting a reaction/ feedback

PLAYER_ENTERED |fa|_almighty 7#.##.##.##
[: 27: ==: unexpected operator
[: 27: ==: unexpected operator
NEW_ROUND
[: 27: ==: unexpected operator
[: 27: ==: unexpected operator
NEW_MATCH
[: 27: ==: unexpected operator
[: 27: ==: unexpected operator
DEATH_SUICIDE |fa|_almighty
User avatar
Jonathan
A Brave Victim
Posts: 3391
Joined: Thu Feb 03, 2005 12:50 am
Location: Not really lurking anymore

Post by Jonathan »

Al's Used Cars wrote:admin@ubuntu:~/soc/etc/games/armagetronad-dedicated$ sudo chmod a=r+w+x rotation3.sh
a=r+w+x should work although it's clumsy (a=rwx or just rwx would work, in particular if your intention is to give everyone who might be around write access, but what you probably want is simply +x). What does "ls -l rotation3.sh" say the mode is?
Al's Used Cars wrote:((server msg on login says:
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.))
Yeah, but you probably don't need root to access your own stuff.
ˌɑrməˈɡɛˌtrɑn
User avatar
Al's Used Cars
On Lightcycle Grid
Posts: 45
Joined: Sun Dec 03, 2006 3:22 pm
Location: Baltimore, MD

Post by Al's Used Cars »

it says this when i entered ls..*

-rw-r--r-- 1 admin admin 517 2007-08-18 13:59 rotation3.sh
User avatar
Al's Used Cars
On Lightcycle Grid
Posts: 45
Joined: Sun Dec 03, 2006 3:22 pm
Location: Baltimore, MD

Post by Al's Used Cars »

WOOWOOWOOWOOOWOOWO!!!


its running!

thank you all so much for your patience!

beers all around, gentlemen!
User avatar
Al's Used Cars
On Lightcycle Grid
Posts: 45
Joined: Sun Dec 03, 2006 3:22 pm
Location: Baltimore, MD

Post by Al's Used Cars »

er, should i detach the session when entering the command?

dont want to close it until I know....
User avatar
Al's Used Cars
On Lightcycle Grid
Posts: 45
Joined: Sun Dec 03, 2006 3:22 pm
Location: Baltimore, MD

Post by Al's Used Cars »

Project Summary:


for anyone trying to do something similiar, heres the finshed script:
note that zero values must be written in order to not skip round 2.

and the tail comd is this:
tail -f -n0 /entirepath/ladderlog.txt | /entirepath/scriptname.sh

-----------------------------------------------

#!/bin/sh

# create used variables
round=""
num_rounds="10" #the total number of rounds per match

#begin loop
while true;
do
read line
echo $line
if [ "$line" = "NEW_ROUND" ]
then
round=$(($round + 1));
if [ $round = $num_rounds ]
then
round="0";
fi
#resets to arena 1 with new match
if [ "$line" = "NEW_MATCH" ]
then
round="0";
fi
if [ "$line" = "GAME_END" ]
then
round="0";
fi
#outputs rotation line into cfg
echo "INCLUDE round${round}.cfg" > /home/admin/soc/etc/games/armagetronad-dedicated/everytime.cfg;
fi
done

-------------------------------------
NB:
after saving in server dir somewhere, you must
make it executable- and if you change it, you must make it executable again
with (cd to dir of script above) chmod +x scriptname.sh
then run tail cmd above to begin. you should see a line output in the terminal window when the server is being played.

good luck,
AL
User avatar
Al's Used Cars
On Lightcycle Grid
Posts: 45
Joined: Sun Dec 03, 2006 3:22 pm
Location: Baltimore, MD

Post by Al's Used Cars »

right....

could someone answer the question re screen?

i've had power outages in my location and the cmd stops running when my comp goes down, so the server stops rotation. I've read man_screen, just dont understand how it is implemented with a cmd like "tail -n0 path/file | path/file"

an xample, pls? where does -d go?
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

Al's Used Cars wrote:right....

could someone answer the question re screen?
Heh, between the time you asked it and the last time you posted, you could have determined the answer experimentally.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
Al's Used Cars
On Lightcycle Grid
Posts: 45
Joined: Sun Dec 03, 2006 3:22 pm
Location: Baltimore, MD

Post by Al's Used Cars »

thank you very very much
for your answer such as it is
fyi
i dont have a lot of free time
with wife, child, biz, house, etc.

do you have more time than i? do you

*******have ******

*****enough*******

******time *******

to reply
to a simple question?
User avatar
Lucifer
Project Developer
Posts: 8640
Joined: Sun Aug 15, 2004 3:32 pm
Location: Republic of Texas
Contact:

Post by Lucifer »

Al's Used Cars wrote:thank you very very much
for your answer such as it is
fyi
i dont have a lot of free time
with wife, child, biz, house, etc.

do you have more time than i? do you

*******have ******

*****enough*******

******time *******

to reply
to a simple question?
No.
Image

Be the devil's own, Lucifer's my name.
- Iron Maiden
User avatar
Al's Used Cars
On Lightcycle Grid
Posts: 45
Joined: Sun Dec 03, 2006 3:22 pm
Location: Baltimore, MD

Post by Al's Used Cars »

nvm.

got an answer elsewhere, seems to be working ok.
Post Reply