/*
 * This script is used with permission.
 *
 * Copyright 1993, 1994 Daniel Cedras
 * Copyright 1995, 1996 Daniel Cedras and Jeremy Nelson
 */

/*
	Country code lookup
	Country information compiled by Daniel Cedras (cedras@texas.net)
	Software written by Jeremy Nelson
	Requires ircII-EPIC3.
	Last modified (03/03/96) by Jeremy Nelson

	How to use:

		/country

		Brief Usage Instructions.


		/country <arg>

		With no flags, the alias attempts to look up the
		userhost of the argument "as-if" it were a nickname.
		If the userhost lookup is successful, it then figures
		out the name of that nick's domain.  If the lookup is
		not successful, then it will try to do a lookup on the
		name itself.


		/country <flags> <arg>

		Supported for backwards compatability are the ability
		to specify flags.  All flags (except for -n, which is
		strictly ignored) have the same effect, and that is
		to circimvent the userhost lookup and do a direct
		lookup on the argument.  The previous meanings of the
		flags are no longer supported as they make no sense now.


		/lcountry <country>
		/lcode <code>
		Do a forced lookup


		NOTE:
		You can (and should) use wildcards anywhere you want.
*/

alias country 
{
	switch ($0)
	{
		()
		{
			echo *** USE: /country <nickname>  or  /country <country_code>
			echo ***      Will tell you what country nickname is from or
			echo ***      What the country corresponding to the Isometric code is
			echo ***      /country <country_name>  
			echo ***      Will tell you what the Isometric code is for that country
			echo ***      Using any flag besides -n will bypass the nick lookup.
			echo ***      This is required for arguments with asterisks in them.
		} 
		(-n)
			{country $1-}
		(-*) 
			{country.lookup $1-}
		(*\\**)
		("* *")
			{country.lookup $*}
		(*) 
		{
			@ c.args = [$*]
			userhost $0 -cmd {
				if ([$3] == [<UNKNOWN>])
				{
					country.lookup $c.args
				}
				{
					country.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.args = []
			}
		}
	}	untry.lookup $after(-1 . $4)
				}
				@ c.ar