*$Id: babel_connection_information.cos,v 1.6 2001/02/21 12:03:58 aharman Exp $
new: comp 1 1 201 "babel" 2 0 9000
** Display
pat: fixd 1 "babel" 1 0 0 1 "WhiteOnTransparentChars"
imsk 1
attr 48
setv ov00 0
flto -1000 -1000
show 0
tick 100


scrp 1 1 201 73
	inst
	doif keyd 17 = 1 and keyd 16 = 1
		doif _p1_ = 'B'
			doif ov00 = 0
*				trigger fast info
				setv ov00 1
				rtar 1 1 58
				doif targ ne null
					mesg writ targ 1000
				endi
			elif ov00 = 1
*				trigger full info too
				setv ov00 2
* Fly to mid screen...
				setv va90 wndw
				divv va90 2
				setv va91 wndh
				divv va91 2
				setv va92 wdth
				divv va92 2
				setv va93 hght
				divv va93 2
				subv va90 va92
				subv va91 va93
				flto va90 va91
* Update Display!
				show 1

				mesg writ ownr 1000
			elif ov00 eq 2
*				get rid of fast info
				setv ov00 3
				rtar 1 1 58
				doif targ ne null
					mesg writ targ 1001
				endi

			elif ov00 eq 3
				setv ov00 0
				flto -1000 -1000
				show 0
				rtar 1 1 58
				doif targ ne null
					mesg writ targ 1001
				endi

			endi
		endi
	endi
endm


** Timer - update screen!
scrp 1 1 201 9
	doif ov00 = 2 or ov00 = 3
		mesg writ ownr 1000
	endi
endm

** Update Display
scrp 1 1 201 1000
	inst
	sets va00 read "Babel Connection Info Text" 0
	sets va01 read "Babel Connection Info Text" 1
	sets va02 read "Babel Connection Info Text" 2
	sets va03 read "Babel Connection Info Text" 3
	sets va04 read "Babel Connection Info Text" 4
	sets va05 read "Babel Connection Info Text" 5
	sets va06 read "Babel Connection Info Text" 6
	sets va07 ""
	sets va08 read "Babel Connection Info Text" 7
	sets va09 read "Babel Connection Info Text" 8
	sets va10 read "Babel Connection Info Text" 9
	sets va11 read "Babel Connection Info Text" 10
	sets va12 read "Babel Connection Info Text" 11
	sets va13 read "Babel Connection Info Text" 12
	doif net: line = 1
		sets va99 va00
** Your UserID is:
		adds va99 va11
		sets va70 net: user
		adds va99 va70
** And your Nickname is:
		adds va99 va12
		adds va99 game "user_of_this_world"
		adds va99 "."
		adds va99 "\n"
		adds va99 "\n"
** The server you are connected to is:
		adds va99 va06
		adds va99 "\n["
		adds va99 net: host
		adds va99 "]"
		adds va99 "\n"
		adds va99 "\n"
** Get the statistics
		net: stat va50 va51 va52 va53
** There are X people connected to the server
		adds va99 va01
		adds va99 vtos va51
		adds va99 va02
		adds va99 "\n"
		adds va99 "\n"
		adds va99 va13
		adds va99 vtos va52
		adds va99 va08
		adds va99 vtos va53
		adds va99 va09
		adds va99 "\n"
		adds va99 "\n"
		adds va99 va03
		setv va80 va50
		divv va80 1000
		adds va99 vtos va80
		adds va99 va04
		divv va80 60.00
		adds va99 vtos va80
		adds va99 va05
	elif net: line = 0
		sets va99 va00
** Your UserID is:
		adds va99 va11

		sets va70 net: user
		doif va70 <> ""
			adds va99 va70
		else
			adds va99 read "Babel Connection Info Text" 15
		endi
** And your Nickname is:
		adds va99 va12
		adds va99 game "user_of_this_world"
		adds va99 "."
		adds va99 "\n"
		adds va99 "\n"
** The server you are connected to is:
		adds va99 read "Babel Connection Info Text" 13
		adds va99 "\n"
		adds va99 "\n"
** There are X people connected to the server
		adds va99 read "Babel Connection Info Text" 14
		adds va99 "\n"
		adds va99 "\n"
		adds va99 va13
		adds va99 "0"
		adds va99 va08
		adds va99 "0"
		adds va99 va09
		adds va99 "\n"
		adds va99 "\n"
		adds va99 va03
		adds va99 vtos 0
		adds va99 va04
		adds va99 vtos 0.0
		adds va99 va05
	endi
	part 1
	frmt 8 8 8 8 3 0 0
	ptxt va99
endm


rscr
enum 1 1 201
	kill targ
next