
Welcome to the Tur-Games package. A few games consisting of
5050, BlackJack, Frags!, Jack Vegas, Russian Roulette & Slots.

5050, BlackJack, Jack Vegas and Slots are single player games.
Frags! and Russian Roulette are for 2 players.

Also included are two seperate scripts called alltimebank.sh and
alltimescore.sh.

Now, we before we start the installation, remember this:
These scripts were made a long time ago. Most of them in 2002.
I've updated them some so that I could release them, but they
have a few limitations. For one, they only work if you have ONE
credit section.
You can have more then one stat_section of course, but they must all be
"no" for seperate credits.

These scripts are generally non-supported. Dont ask silly questions
about them. If you want changes made in them, do them yourself.
Since they are so old, they are pretty easy to figure out. It generally
goes from top to bottom. The only proc_ is proc_output() which I added
just now since the previous bot-output used a customized bot.

Since they have been remade for release, its possible that a bug or two
sneaked in, so might update them for that, but do NOT expect me to 
change how they work or so.

We should test if the random function works on your box first. 
Copy extra/test.sh to /glftpd/bin and run it. Looks good? Great.
Then try:
chroot /glftpd
cd bin
./test.sh

If that still looks good, then you're ready to install the games.


* Copy all .sh files to /glftpd/bin.

* chmod each script to 755

* Load each one as a custom command in glftpd.conf, as:
  site_cmd 5050           EXEC    /bin/tur-5050.sh
  site_cmd SLOTS          EXEC    /bin/tur-slots.sh
  site_cmd FRAGS          EXEC    /bin/tur-frags.sh
  site_cmd BJ             EXEC    /bin/tur-bj.sh
  site_cmd JV             EXEC    /bin/tur-jv.sh
  site_cmd RR             EXEC    /bin/tur-rr.sh
  site_cmd MYSCORE        EXEC    /bin/alltimescore.sh
  site_cmd BANKSCORE      EXEC    /bin/alltimebank.sh

  custom-5050             !=NoGames *
  custom-slots            !=NoGames *
  custom-frags            !=NoGames *
  custom-bj               !=NoGames *
  custom-jv               !=NoGames *
  custom-rr               !=NoGames *
  custom-myscore          !=NoGames *
  custom-bankscore        !=NoGames *

* Optional:
  Create a group in glftpd called NoGames. If you want to disable gaming for any user, just
  toss them info the NoGames group.

* Now then, edit the scripts. Since they all run chrooted, no paths should include /glftpd so
  they should already be good to go.
  Four paths are important:

  GLLOGFILE=/ftp-data/logs/games.log -- you probably want to change this to glftpd.log.
                                        Read more below why its set to games.log

  TEMPPATH=/tmp  -- Make sure you have a /glftpd/tmp dir and that it is chmodded to 777.

  BACKUPPATH=/ftp-data/users/backup  -- Feel free to change this one. Make sure the dir exists
                                        and is chmodded to 777.

  LOGFILE=/ftp-data/logs/jv.log  -- This is the logfile where the highscores is saved. For this example
                                    its for Jack Vegas. Each game should have their own file. 
                                    Create these files and set chmod 666 on them.


* This script uses the TURGEN bot-trigger. You can change that if you want it to be something else so
  you can control which channel it goes through. Just look for proc_output() in each script and change
  TURGEN to something else.

  If you use SS5, you should change TURGEN to RAW. Should work from there.  

  --

  If you keep it default, later versions of pzs-ng already supports TURGEN out of the box (thanks guys).

  --

  Otherwise:

  Check first that TURGEN is not already added. Its used for a few other scripts as well.

  If you are using the old dark0n3s zipscript, the following goes to dZSbot.tcl.
  If you are using an older pzs-ng version, it goes into dZSconf.tcl

  Note: Depending on pzs-ng version, set msgtypes(DEFAULT) might not exist in dZSconf.tcl.
        If so, find it in dZSbconf.defaults.tcl, copy it into dZSconf.tcl and
        then add TURGEN to set msgtypes(DEFAULT) in dZSconf.tcl

  To 'set msgtypes(DEFAULT)', add TURGEN

  Add the following in the appropriate places:
  set chanlist(TURGEN)  "#YourChan"
  set disable(TURGEN)   0
  set variables(TURGEN) "%msg"

  If you are using Dark0n3s dZSbot.tcl, this goes to dZSbot.tcl as well:
  set announce(TURGEN)  "%msg"

  If, however, you are using pzs-ng (beta3 or higher), then this goes to your current theme file:
  announce.TURGEN = "%msg"

  --

  Now then, why is GLLOGFILE set to /ftp-data/logs/games.log ?

  Personally, I like to announce gaming on a second bot that the users can easely ignore if they 
  do not want to see it.
  The simplest way to make a "gaming only" bot is to copy your current sitebot to another bot.

  In the config for you botscript, instead of it reading glftpd.log, change it to read games.log.
  For pzs-ng, its: 
   set glftpdlog(NORMAL)       "$glroot/ftp-data/logs/games.log"
  You can set the loginlog and sysoplog to some dummy file so the gaming bot does not read them.

  Create games.log and chmod it to 666: 
  touch /glftpd/ftp-data/logs/games.log; chmod 666 /glftpd/ftp-data/logs/games.log

  Now, set GLLOGFILE in every script to /ftp-data/logs/games.log (default)

  There, we now have a bot that reads games.log instead of glftpd.log. 
  Only the games write to games.log.

  --

  If you'd rather just announce it into a second channel, you need to change TURGEN to something else
  in proc_output() for every script, then add the new word you used to the bot so its announced 
  in another chan. I dont recomend pointing TURGEN to another channel. While this would be the easiest
  way, TURGEN is used for a lot of other scripts as well.

* Now then, almost all games have a limit on how often they can be run by users. 5050, for example
  can only be played once every 15 minutes. Thats where the NODELAYPASS comes in.
  if you run 'site 5050 password', it will reset your timer so you can play again. This will not
  be announced.
  However, if you run 'site 5050 password username', it will reset that users timer and this will
  be announced to the channel.

* If a user logs out in the middle of a game, the LOCKFILE will still be present and the game wont
  run. This is partly so that two users can not play the same game at once AND so that people does
  not logout in the middle of a game if things are starting to go wrong for them. If they DO, they
  halt the game for everyone else, and you'll be able to see a pattern of cheaters after a while.

  Just be prepared to delete the LOCKFILEs manually from time to time.

  In tur-rr, I added a LOCKDELETEPASS. Giving this removes the lockfile. Only tur-rr has this
  function though.

* Make sure you run all the scripts without arguments to learn everything about them and their
  limits. In tur-bj for example, aces only counts as one if you manage to get two of them in
  the initial deal. Otherwise they always count as 11. Users hate this but I've been too lazy
  to change it.

* I've been running these games since 2002 and here are the results (from alltimebank.sh)

  Slots: Bank took 383 GB,  Bank gave 272 GB.
  BJack: Bank took 301 GB,  Bank gave 259 GB.
  50-50: Bank took 259 GB,  Bank gave 342 GB.
  JVegas: Bank took 242 GB,  Bank gave 52 GB.
  Total Taken: 1185 GB
  Total Given: 925 GB

  Thats all random of course.

* In the extras dir you'll find tur-fullfrags. Thats the initial FRAGS! script where users can
  buy/sell different weapons, HP, insurance etc, but it turned out too big. Also, a bit
  predictable after a while. A gloc user never wins agains someone with a rocket launcher.
  However, its a very fun game. I have not used it since 2002 though.

  Since it got too big, I stripped it down into the simpler version, tur-frags.sh.

  Add it as a custom command if you want to try it.


Have fun.