📄 start.sh
字号:
#!/bin/tcsh# This script starts the BlueSky_2007 team. When player numbers are # supplied before the (optional) host-name and team-name arguments only# these players are started, otherwise all players are started.# Usage: start.sh <player-numbers> <host-name> <team-name>## Example: start.sh all players default host and name# Example: start.sh machine all players on host 'machine'# Example: start.sh localhost BS all players on localhost and name 'BS'# Example: start.sh 127.0.0.1 BS all players on 127.0.0.1 and name 'BS'# Example: start.sh 1 2 3 4 players 1-4 on default host and name# Example: start.sh 1 2 remote players 1-2 on host 'remote'# Example: start.sh 9 10 remote BS players 9-10 on host remote and name 'BS'# Example: start.sh 0 start coach on default host set wait = 0set host = "localhost"set team = "BlueSky_2007" set dir = "src"set prog = "${dir}/BlueSky_player"set coach = "${dir}/BlueSky_coach"set pconf = "${dir}/player.conf"set fconf = "${dir}/formations.conf"echo "*************************************"echo "* *"echo "* RoboCup 2D Simulation *"echo "* *"echo "* BlueSky 2007 - by GPRA (AIAI) *"echo "* Test version *"echo "* *"echo "*************************************"#first check if the last two supplied arguments are no numbers and represent#<host-name> or <host-name> <team-name>if( $#argv > 0 && ($argv[$#argv] !~ [0123456789]* || $argv[$#argv] =~ *.* ) ) then @ second_last = $#argv - 1 if( $#argv > 1 && ($argv[$second_last] !~ [0123456789]* || $argv[$second_last] =~ *.* ) ) then set host = $argv[$second_last] set team = $argv[$#argv] else set host = $argv[$#argv] endifendif#then if first argument is a number, start only the players with the numbers#as supplied on the prompt, otherwise start all players.if( $1 =~ [0123456789]* && $1 !~ *.* ) then echo "$argv[$#argv]" echo "$1" foreach arg ($argv) if( $arg =~ [123456789]* && $arg !~ *.*) then ${prog} -num ${arg} -host ${host} -team ${team} -f ${fconf} -c ${pconf} & sleep $wait else if( $arg =~ [0]* ) then sleep 2 ${coach} -host ${host} -team ${team} -f ${fconf} & endif endelse set i = 1 while ( ${i} <12 ) ${prog} -number ${i} -host ${host} -team ${team} -f ${fconf} -c ${pconf} & sleep $wait @ i++ end sleep 2 ${coach} -host ${host} -team ${team} -f ${fconf} &endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -