home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
WWIVMODS
/
PRE412.ZIP
/
LL10.DOC
< prev
next >
Wrap
Text File
|
1988-09-25
|
6KB
|
144 lines
LOGOFF LOTTERY
v1.0
by DOUG FIELDS
9/25/88
This file, LOGLOT10.ARC should contain the following: LL10.DOC, LOTTERY.C,
and INFO.DOC.
WHAT IT IS
----------
This is a small program for WWIV 4.0x (has been tested on 4.04 and 4.05)
which will allow the user, once he has chosen to log off, the option of
playing the pick-4 lottery. It will cost him three gold, and then he will be
prompted for his numbers and told whether he has won anything. The chances of
winning certain amounts are:
0 gold : very likely
2 gold : most likely
... : ...
16 gold : little likely
... : ...
64 gold : very little likely
... : ...
128 gold : very very very little likely
... : ...
512 gold : never been done
The actual amount of gold the user wins is determined by the following
formula. Gold won = (# matches)^2 * 2. This has proven to be the most workable
formula.
IMPLEMENTATION
--------------
This is rather simple to implement. Just follow the directions.
FIRST
The first thing you must do is add the following line to the end of the
FCNS.H file:
void lottery();
This will tell the compiler about the lottery program.
SECOND
Insert this line at the end of the #include statements at the beginning of
BBS.C:
#include "lottery.c"
and then copy the file lottery.c into your source file directory. This will
put the actual code into the BBS.
THIRD
A housekeeping addition. In your BBS.PRJ file, you must add lottery.c to the
list of dependencies for BBS.C. If the old like looked like:
bbs.c (net.h, fcns.h, vardec.h, vars.h)
the new line would look like:
bbs.c (net.h, fcns.h, vardec.h, vars.h, lottery.c)
Just add lottery.c to the end of the list.
FOURTH
In the file BBS.C once again, in the functions mainmenu() and dlmainmenu(),
you must add the following code to the case 'O':. The same code exerpt applies
to both spots.
LEGEND: -- orig. lines
-- case 'O': ** new lines
-- nl(); -* changed lines
-- nl();
-- prt(5, "Log Off? ");
-- helpl=12;
-- if (yn()) {
-- outchr(12);
** if (thisuser.gold >= 3.0)
** {
** prt(2, "Would you like to play the logoff lottery for 3 gold? ");
** if (ny()) lottery();
** nl();
** /* pausescr(); */ /* This line is optional. If you would like the
the screen to be paused after playing the
lottery, remove the /* and */ from around
the pausescr();. Don't type this text into
your code. */
** }
** nl(); nl();
-- print("Time on = ", ctim(timer()-timeon),"");
These additions will allow the user to play the lottery from the main or
transfer menus.
FIFTH
Fifth and finally, recompile the BBS! Test it out and if you have any
problems with the code contact me either via voice or on my BBS.
A LINKER ERROR
--------------
At some time in your WWIV compiling career, you might get a linker error,
'Too much global data defined in file.' This is a real pain in the neck. To
get rid of this error, (assuming you are using TC instead of TCC) go to the
options menu, choose compiler options, and choose code generation. In that sub
menu, toggle on the 'Merge Duplicate Strings' option. Save the configuration,
and then go ahead and recompile the whole BBS by going to the compile menu,
and choosing 'Build All'. Relink it, and you should not get that error anymore
(at least not for a while).
NOTES
-----
If you like this and/or other mods of mine, please send me a donation. If
you can't afford a donation, then give me a ring either voice or on my BBS. If
you can't afford that donation but can call long distance, then try to make it
a habit to log on once a week or once a month or some other regular schedual.
On my BBS you will find all my mods and utilities with the latest versions.
You will also see differences and other mods which I have not yet written docs
for. Some of these I might not write docs for until someone requests them.
Okay guys, have fun!
All mod/utility requests make on my board or by voice will recieve the
fastest attention, with the highest priority.
Doug Fields
100 Midwood Road
Greenwich, CT 06830-3837
(203) 661-2967 (VOICE)
T H E G A L A C T I C H E A D Q U A R T E R S ! ! !
HERE'S THE PLACE TO MAKE ALL MOD/UTILITY REQUESTS!
300-9600/24 HRS/8 DAYS
(203) 324-8960