Hmm. I could use a wait command.
But this will not answer, why the first nuke didnt start?
Greetings Avatar
Advertisement
NUKE-Script
Advertisement
#18 Guest_FSK05N
Posted 22 April 2004 - 05:05 PM
Well, I remember the things you guys have already come across as I wrote this script last October, I think. It uses urtrcon.pl and bash.
#!/bin/bash
#
# random-nuke.sh
#
# DEPS: urtrcon.pl and players.sh
#
# this pulls the player stats urtrcon.pl, strips
# off the crap (i should just re-write urtrcon
# but this works with little cost so wtf..)
###################################################
IP='YOURSERVERIPADDRESS'
PASS='YOURRCONPASS'
# this gets just the CID from quake and correctly sorts them
# to find the 'high' number for our range..
players.sh |gawk '{print $1}' |grep [0-9.] |sort -g >cids.tmp
# random is taken from /dev/srandom i believe
# range comes from the above CID listing..
RANGE=`tail -q -n1 cids.tmp`
sleep 3 #cause urtrcon or quake is choking on it..
number=$RANDOM
let "number %= $RANGE"
urtrcon.pl -s $IP -P $PASS -c "nuke $number"
rm -f cids.tmp
#fin
#!/bin/bash
#
# players.sh
# Who is on the server...
IP='YOURSERVERIP'
PASS='YOURRCONPASS'
urtrcon.pl -s $IP -P $PASS
#fin
############################
The 2nd script is useful by itself as 'players.sh' in ~/bin so while you are at a *nix console, you can see instantly the map and what players are online.
HTH!
Happy Fraggin!
PS - I think the slow sending of commands is the built-in flood control.
#!/bin/bash
#
# random-nuke.sh
#
# DEPS: urtrcon.pl and players.sh
#
# this pulls the player stats urtrcon.pl, strips
# off the crap (i should just re-write urtrcon
# but this works with little cost so wtf..)
###################################################
IP='YOURSERVERIPADDRESS'
PASS='YOURRCONPASS'
# this gets just the CID from quake and correctly sorts them
# to find the 'high' number for our range..
players.sh |gawk '{print $1}' |grep [0-9.] |sort -g >cids.tmp
# random is taken from /dev/srandom i believe
# range comes from the above CID listing..
RANGE=`tail -q -n1 cids.tmp`
sleep 3 #cause urtrcon or quake is choking on it..
number=$RANDOM
let "number %= $RANGE"
urtrcon.pl -s $IP -P $PASS -c "nuke $number"
rm -f cids.tmp
#fin
#!/bin/bash
#
# players.sh
# Who is on the server...
IP='YOURSERVERIP'
PASS='YOURRCONPASS'
urtrcon.pl -s $IP -P $PASS
#fin
############################
The 2nd script is useful by itself as 'players.sh' in ~/bin so while you are at a *nix console, you can see instantly the map and what players are online.
HTH!
Happy Fraggin!
PS - I think the slow sending of commands is the built-in flood control.
1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users
Advertisement