home *** CD-ROM | disk | FTP | other *** search
- SCRIPT
-
- ; SEMENU25.SCR v1.25 11/27/88
-
- ; Mike Atkinson Tippy Express BBS
- ; (219) 453-4046 300/1200/2400
-
- ; Use sysedit.tos to setup your main commands to execute this script
- ; with the confirmation message being something like: Space Empire!|
- ; can also be exececuted from your game menu
-
- ; If a player hangs up during play you will get an error message in your
- ; system log that the sysdata.dat file was not found - this has never
- ; caused any problems on my board. This will not happen if your bbs path
- ; and empire path is the same (if you like cluttered directories...)
-
- : You MUST have empire.tos, config.dat, and all other data files in the
- ; folder specified by [empire_path] for this script to work as written.
- ; Ignore the part in the sysop docs for Space Empire where it tells you to
- ; put empire.tos and config.dat in the same directory the BBS is run from.
-
- ; Compiling this script is a must for speed and you will also get line #'s
- ; if any errors occur. Don't nest your directorys more than 2 deep, this wil
- ; dramatically slow down your disk access. So "c:\games\empire\" is OK, but
- ; "c:\bbs\games\empire\" is much slower.
-
- abort off
-
- SETUP:
- clear variables
- ;----------------------------------
- ;! Change the following to fit your system
- ; All your Space Empire files should be in one folder (empire_path)
- ; The folder containing the files MUST be on the same drive as BBS!
- ; Define bbs_log as your system log file if your printer is off-line
- ; Change the BBS name at the end of script for your BBS
-
- define bbs_log = 'printer' ;or diskfile (c:\bbs\callers.log)
- define bbs_path = 'c:\bbs\' ;path BBS is run from
- define empire_path = 'c:\games\empire\' ;Space Empire path
-
- ; Set the following to the names in your seconfig.dat file
-
- define empire_prg = 'spcelite.tos' ;SE program name
- define setoday = 'senews.txt' ;Todays SE news filename
- define sescore = 'sescore.txt' ;SE score file
- define sefame = 'sefame.txt' ;SE Hall of Fame file
- define selog = 'spcemp.log' ;SE sysop log filename
- define seyesterday = 'senews.old' ;Yesterdays SE news filename
- define selogold = 'empold.log' ;SE yesterdays log filename
-
- ;define game_menu = N ; Use this if no main game menu is called
- define game_menu = 'i:\bbs\menus_80\games.hlp' ;script file to execute
-
- define cutoff = 5 ; minutes left at which play is not allowed
- define level = 2 ; user command level needed to play SE
- ;----------------------------------
-
- define Key_Inp ; 1 key input for user selection
- define entry
- entry = '&34'
- define actions
- define docfile
- define fc ; Variable for file copy
- integer cd ; Variable for directory changes
- define prompt ; prompt for command routine
- define time_used_call ; for time limit routine
- define time_left_call ;
- define time_used_day ;
- define time_left_day ;
- define time_on ;
- define time_ok ;
- define time_per_call = '&13' ;
- define time_per_day = '&14' ;
- define time_before = '&15' ;
- define spc_date ; for empire new day routine
- define spc_day ;
- define today_date = '&24' ;
- define date ; for empire status routine
- define id = '&31' ;
- define player ;
- define calls = '&27' ;
- define player_no ;
- define user_idx ;
- define se_name ;
- define se_player ;
- define player_idx ;
- define last_date ;
- define score ;
- define total_planets ;
- define food_planets ;
- define ore_planets ;
- define soldier_planets ;
- define unknown ;
- define troops ;
- define ally ;
- define population ;
- define food ;
- define fighters ;
- define credits ;
- define generals ;
- define def_stations ;
- define command_ship ;
- define player_name ;
- define agents ;
- define heavy_cruisers ;
- define carriers ;
- define turns ;
- define insurgents ;
- define dead_planets ;
- define plan_av
- define market
-
- TOP:
- prompt = '\g\i Space Empire\v\o\b\r\{123456-'
- if command_level (32)
- prompt = '[prompt]L'
- endif
- if game_menu # N
- prompt = '[prompt]DGX?\}\b:\v'
- else
- prompt = '[prompt]DX?\}\b:\v'
- endif
- goto menu
-
- COMMAND:
- abort off
- printe
- print '\b\o(&32 min)[prompt]' ; Hold the cursor on this line
- if time_exceeded ;check time limit at every game prompt
- printe ;blank line between game and BBS prompt
- actions = '[actions]TimeUp!/'
- gosub logprint
- exit ;let BBS log them off
- endif
- get_key Key_Inp ;get callers choice
- actions = '[actions][Key_Inp]/'
-
- SECHOICE:
- if Key_Inp = '?'
- printe '? See menu'
- goto menu
-
- ef Key_Inp = 1
- print 'Play Space Empire? \{y,N\}: '
- goto playemp
-
- ef Key_Inp = 2
- printe 'Today\"s Empire News'
- docfile = '[empire_path][setoday]'
- gosub docprint
- goto command
-
- ef Key_Inp = 3
- printe 'Yesterday\"s Empire News'
- docfile = '[empire_path][seyesterday]'
- gosub docprint
- goto command
-
- ef Key_Inp = 4
- printe 'Space Empire Scores'
- docfile = '[empire_path][sescore]'
- gosub docprint
- goto command
-
- ef Key_Inp = 5
- printe 'Space Empire Hall of Fame'
- docfile = '[empire_path][sefame]'
- gosub docprint
- goto command
-
- ef Key_Inp = 6
- printe 'Your Status/Activity'
- goto status
-
- ef Key_Inp = D
- printe 'Space Empire Doc\"s'
- docfile = '[empire_path]spcelite.doc'
- gosub docprint
- goto command
-
- ef Key_Inp = G
- goto gamemenu
-
- ef Key_Inp = L
- goto spc_log
-
- ef Key_Inp = X
- printe 'Exit to BBS..'
- gosub logprint
- exit
-
- endif
-
- INVALID:
- printe '\r\{?\}\b to see menu...' ; what happens upon invalid command
- goto command ; choice
-
- PLAYEMP:
- abort off
- get_key Key_Inp
- actions = '[actions][Key_Inp]/'
- if Key_Inp # Y ;did they really want to play?
- printe 'No'
- goto command
- else
- printe 'Yes'
- endif
-
- HIACCESS:
- if command_level (level)
- else
- printe
- printe '\r\i Sorry, your access level\visn\"t high enough. \b\o'
- actions = '[actions]LEVEL!/'
- goto command
- endif
-
- TIMELIMIT:
- increase cutoff
- if &29 = 300 ;if 300 baud, cut them off
- cutoff = [cutoff] + 5 ;5 minutes sooner
- endif
- time_on = &32
- time_left_call = [time_per_call] - [time_on] ;time left for this call
- time_ok = 'Play'
- if time_left_call < cutoff
- printe '\n Sorry, you don\"t have enough time\vleft for this call to play.'
- time_ok = 'Call Limit'
- endif
- time_used_day = [time_before] + [time_on]
- time_left_day = [time_per_day] - [time_used_day] ;time left for today
- if time_left_day < cutoff
- printe '\n Sorry, you don\"t have enough time\vleft for today to play.'
- time_ok = 'Daily Limit'
- endif
- actions = '[actions][time_ok]/'
- if time_ok # 'Play'
- goto command
- endif
-
- NEWDAY:
- if &34 > 23:59:30 ;Oops! Empire may not get running
- printe ;before the date changes at 12:00am
- print ' Starting Play On New Day,\v Time: &23'
- endif
-
- MIDNITE:
- if &34 > 23:59:30 ;count down till midnite so that
- backspace 11 ;BBS will create yesterdays news
- print '&23' ;file. This is for the caller who
- for Key_Inp = 1 to 1000 ;logs on before midnite to be the
- endfor ;first on the new day...
- goto midnite
- endif
-
- if file_exists '[empire_path][setoday]' ;check for first time startup
- key_inp = 'yes'
- open '[empire_path][setoday]',input ;Input date on Space Empire News file.
- finput spc_date 2
- close
- else
- goto nonews
- endif
-
- today_date = '&24'
- spc_day = copy spc_date,10,2 ;Copying the day from SE news file
- date = copy today_date,4,2 ;Copying the day from current date
-
- if date # spc_day ;If date is not today then make todays, yesterdays news.
- printe '\n BBS news file maintenance.\v\vPlease Wait...'
- fc = file_copy '[empire_path][setoday]', '[empire_path][seyesterday]'
- fc = file_copy '[empire_path][selog]', '[empire_path][selogold]'
- endif
-
- NONEWS:
- printe '\n\g\i Loading Space Empire \b\o\n'
- cd = file_chgdir '[empire_path]'
- open ('sename.bbs', output) ; NOTICE TO EXPRESS SYSOPS!
- fprinte '&1' ; Do NOT modify this part, or it will not
- close ; work when SE is in Express mode!
- GEM '[empire_path][empire_prg]'
- cd = file_chgdir '[bbs_path]'
- goto command
-
- SPC_LOG:
- if command_level (32)
- else
- goto invalid
- endif
- print '\r\{T\}\boday\"s \r\{Y\}\besterday\"s Log: '
- get_key Key_Inp
- actions = '[actions][Key_Inp]/'
- if Key_Inp = 'T'
- printe 'Today\"s Log'
- docfile = '[empire_path][selog]'
- gosub docprint
- ef Key_Inp = 'Y'
- printe 'Yesterday'
- docfile = '[empire_path][selogold]'
- gosub docprint
- else
- goto command
- endif
- goto command
-
- STATUS: ;get user player status
- if file_exists '[empire_path]elitplr.dat'
- else
- printe '\n \rPlayer data file does not exist!\b'
- goto command
- endif
- print '\n \gLoading Status\b.'
- player_no = '1'
- player_idx = '2'
- open '[empire_path]elitplr.dat', input ;! SE player data
-
- FIND_SE_PLAYER:
- print '.'
- if player_no = '25'
- close
- printe '\n\n Sorry, You Have No Player!'
- goto command
- endif
- finput se_name player_idx
- player_idx = '22'
- if se_name = &1
- goto list_player
- else
- increase player_no
- goto find_se_player
- endif
-
- LIST_PLAYER:
- player_idx = '1'
- finput last_date
- finput score
- finput total_planets
- finput food_planets
- finput ore_planets
- finput soldier_planets
- finput unknown
- finput troops
- finput ally
- finput population
- finput food
- finput fighters
- finput credits
- finput generals
- finput def_stations
- finput command_ship
- finput player_name
- finput agents
- finput heavy_cruisers
- finput carriers
- finput turns
- close
-
- open '[empire_path]insurge.dat', input
- finput insurgents player_no
- close
-
- if insurgents = 0
- insurgents = 'PEACEFUL'
- ef insurgents =1
- insurgents = 'MILD INSURGENCY'
- ef insurgents = 2
- insurgents = 'VIOLENT DEMONSTRATIONS
- ef insurgents = 3
- insurgents = 'RIOTS'
- ef insurgents =4
- insurgents = 'POLITICAL CRIME'
- ef insurgents = 5
- insurgents = 'TERRORISM'
- ef insurgents = 6
- insurgents = 'GUERRILLA WARFARE'
- ef insurgents =7
- insurgents = 'REVOLUTIONARY WARFARE'
- ef insurgents = 8
- insurgents = 'UNDER COUP'
- endif
-
- if file_exists '[empire_path]deadp.dat'
- open '[empire_path]deadp.dat', input
- finput dead_planets player_no
- close
- endif
-
- if file_exists '[empire_path]planav.dat'
- open '[empire_path]planav.dat', input
- finput plan_av
- close
- endif
-
- if file_exists '[empire_path]market.dat'
- open '[empire_path]market.dat', input
- finput market
- close
- endif
-
- printe
- printe
- printe 'Empire status'
- printe '========================================================================='
- printe '[player_name]\"S Empire Last played: [last_date]'
- printe 'Score: [score]'
- printe 'Turns: [turns]'
- printe 'Credits: [credits]'
- printe 'Pop: [population] Million'
- printe 'Food: [food] Megatons'
- printe 'Agents: [agents]'
- printe 'Insurgency: [insurgents]'
- printe 'Com.Ship: %[command_ship] completed'
- printe 'Military: \{Troops=[troops]\} \{Fighters=[fighters]\} \{Generals=[generals]\} \{Def. Stations=[def_stations]\}'
- printe ' \{Heavy Cruisers=[heavy_cruisers]\} \{Carriers=[carriers]\}'
- printe 'Planets: \{Food=[food_planets]\} \{Mining=[ore_planets]\} \{Soldier=[soldier_planets]\} \{Total=[total_planets]\}'
- printe '========================================================================='
- printe 'Markets: \{Planets=[plan_av]\} \{Food=[market] megatons\}'
- if file_exists '[empire_path]sem.[player_no]'
- printe
- print '\r\iPress any key to see events in your empire...\b\o'
- get_key Key_Inp
- printe
- printe
- view '[empire_path]sem.[player_no]'
- else
- printe
- printe '\g\iNothing happened in your empire\vsince you last played.\b\o'
- endif
- goto command
-
- MENU:
- clear screen
- printe
- printe ' \g\i Tippy Express \o\b' ; Your BBS name goes here
- printe ' \g\i Space Empire Elite \o\b'
- printe ' \g\i ------------------ \o\b'
- printe ' \g\i &23 \o\b'
- printe
- printe ' \r\{1\}\b Play Space Empire Elite'
- printe ' \r\{2\}\b Today\"s Empire News'
- printe ' \r\{3\}\b Yesterday\"s News'
- printe ' \r\{4\}\b Empire Scores'
- printe ' \r\{5\}\b Empire Hall of Fame'
- printe ' \r\{6\}\b Your Current Status'
- printe
- if command_level (32)
- printe ' \r\{L\}\b Empire System Log'
- endif
- printe ' \r\{D\}\b Documentation'
- if game_menu # N
- printe ' \r\{G\}\b Main Game Menu' ;if you re-exec your game script
- endif
- printe ' \r\{X\}\b Exit to BBS'
- printe ' \r\{?\}\b This Menu'
- printe
- goto command
-
- DOCPRINT:
- if file_exists '[docfile]'
- printe '\n\r\i >> Control-S to pause,\vControl-X to abort \b\i\n'
- view '[docfile]' ;formats text output
- else
- printe '\n Sorry, that file is unavailable...'
- endif
- return
-
- GAMEMENU:
- if game_menu # N
- printe 'Exit To Game Menu...'
- gosub logprint
- execute '[game_menu]'
- else
- goto invalid
- endif
-
- LOGPRINT:
- open '[bbs_log]', append ;logs callers activity
- fprinte '[entry] &34 SEmenu : [actions]'
- close
- return
-
- EOF:
- close
- if key_inp = 'yes'
- goto nonews
- endif
- actions = '[actions]FUBAR!/'
- bell
- print '\n\n FUBAR!'
- bell
- printe '\v\vFile data wrong type or truncated.'
- goto command
-