|
NAMEeif —
Empire InterFace
SYNOPSIS
DESCRIPTIONWhat is eif?Theeif program is an alternative to the empclient that
comes with the Wolfpack Empire server. eif supports
aliases with parameters, command history, substitution, etc. (Courtesy of GNU
readline), variables, rudimentary conditionals and various forms of file
redirection, piping and execution.
What doesn't eif do?eif does not play your game for you. Use GEET or Xemp.
eif knows next to nothing about the game of empire.
eif does not use Xwindows, Sunview, etc. It is command
line based.
AutoconnectionThe variable "AUTOGAME" is set if there is a game name specified in the runtime options. I.E.,eif mygame would be equivalent to setvar AUTOGAME mygame from the When the last line in the .eifrc file is: connect ${AUTOGAME:?} an autoconnect function is served. Runtime OptionsThe following options are available:-D
varname value Equivalent to "setvar varname
value" on the eif command prompt.
-r Disable reading of $HOME/.eifrc at startup.
GENERAL SYNTAXThere are 2 types of input. First, command level. This is the normal input. The second is "secondary" input, in which a command asks you a question. Such as doing a "map" command without specifying a range.Command LevelAny line with a "#" as the first non-space character is a comment line, and is ignored. Any line with a "&" as the first non-space character is marked as only for secondary input, and is ignored. More on this later."$var"s are replaced with the value of the variable "var". See below. Leading spaces on a command line are ignored, and not sent to empire. Multiple commands may be entered on the same line, with the commands seperated by a ";" character. IE, "nation ; power" will perform a nation, then a power command. ";"s inside of quoted strings (") are ignored for this. (NOTE that ";" will not seperate lines inside of telegrams and announcements. Otherwise you can't get ";" into them. Not sure if this is proper, but....) Output is redirected using ">".
Piping is supported, through the "|" type syntax. list | more Aliases are supported. If the first non-space string on a command line matches an alias, the string is replaced with the alias. NOTE that string in this context can have any characters but spaces, not withstanding any other special characters. (#,&,!!,^) Command history is supported.
Secondary InputThis is input that commands request. IE, asking questions that you didn't answer in the command line, or were unable to answer until the command was started.This creates problems for exec files, aliases, etc, since you are not always sure how many questions will be asked. Thus, you can mark secondary input lines with a leading "&". This prevents the secondary input lines as being attempted as commands. IE, "read >>read ; &y ; &n" will avoid that annoying problem of telegrams arriving while reading. And, "build plane 16,2 ; &fighter 2 ; & " fixed the problem of not being able to specify multiword entries in a single line. (Typing "build plane 16,2 fighter 2 100" would try to build you a 'fighter 1' at tech 2.) This example is outdated now. Preconditioning:
This preconditioning is not done for telegrams and announcements, through a special case which examines the prompt string. EscapingIf one the characters '$' ';' '"' '\' is not to be parsed by eif, it can be escaped with a \. Note that a '$' can also be escaped as "${}".Aliases
The variables $0, $1, $2, ... are supported for aliases. They are the "words" in the command that the alias is working on. Also, these variables can be conditional.
"words" are space delimited, or surrounded by "s. Example: local% alias tt "echo 0-$0 1-$1
2-$2" local% tt a b c d e f 0-tt 1-a 2-b c d e f local% tt "a b" c d e
f 0-tt 1-a b 2-c d e f Exec
exec's are allowed to be recursive, but at this time there is a minor bug when the exec file ends on secondary input. Input is redirected to stdin, and not the calling exec file. Fixed some day. Output redirection handles recursive execs. Variables
If %name is used instead of name as first argument to either setvar or unsetvar, the environment is used instead of eif's local variable scope. CommandsThe current list of commands are:
The file "$HOME/.eifrc" is read in and executed as an exec file. Other ThingsWhen "connecting" to a game, the program does a chdir to the directory specified in the "addgame" command. Thus, you can have multiple games, in multiple directories, so that your data files for things like "ve" don't get messed up. NOTE that the directory name in "addgame" is relative to your home directory.EXAMPLESExample .eifrc# Games addgame cvis blitz.wolfpackempire.com 6789 visitor visitor .empire.chg addgame zvis blitz.wolfpackempire.com 5678 visitor visitor .empire.zeb # Read system eifrc exec /usr/local/lib/eif/eifrc.include # Prevent name clashes by defining abbreviations ourselves alias ex "expl c ${1} 1" alias pl plane alias sh ship alias m map alias b bmap alias sh ship alias x exit alias c connect # Run the sat command on all planes in wing S (see eifrc.include) alias sats "pwith S do sat \[\]" # If a game was passed as argument, connect to it. conn ${AUTOGAME:?} SEE ALSOreadline(3)http://www.stack.nl/~marcolz/empire/ http://www.wolfpackempire.com/ COPYRIGHTBy far most of the code is from the original author: Doug Hay. Very little has been modified, but most of that is done by Marc Olzheim (marcolz@stack.nl)
Visit the GSP FreeBSD Man Page Interface. |