Eggdrop Tcl Archive

Home | Contact | Forum | Submit a Script

View All Information: Script Id509

Script Name: MoxQuizz Version: 0.8.1 Author: Moxon Script Date: 20/07/2003 Category: Game Scripts Downloads: 238 File Name: moxquizz-0.8.1.tar.gz Short Description: Advanced trivia script with multi-language support. Can be configured to speak in English, French, German or Greek, and question sets containing thousands of entries for English, German, Malaysian and Norwegian are included.

Extended Description File

README for MoxQuizz
                         -------------------

              * This text corresponds to version 0.8.0 *

               - 0.8.x version are dedicated to Lefty -

0. Introduction
1. Quickstart
2. Detailed description
3. User commands
4. Commands to control the script
5. Configuration/Quiz features
6. Supplemental tools
   6.1. setup.pl -- set some variables in provided config and moxtools
   6.2. allstars.pl -- prettyprint the allstars table for MoxQuizz
7. Future thoughts (road map)
8. Contact
9. Credits


0. Introduction
---------------

This is a (not so) short README for Moxons quiz/trivia script.

MoxQuizz is a multilingual quiz/trivia script for the popular IRC bot
eggdrop, acting as a game master playing a quiz.  Normally, a question
is posted to the channel and all chatter is searched for the answer.
If something matches an answer or an optional regular expression, the
user who said it receives a score.  The high-score table will be
printed regularly (see rankdelay in TCL file).  When a player reaches
a certain score, he wins the quiz and the rankings will be reseted.
A score is recorded in the allstars table, too.

You can use your own question files (they are always welcome to be
included in future distributions).  See README.database for a
description of the file format.  Currently sets for several languages
are provides as well as language definitions for the messages MoxQuizz
emmits.

MoxQuizz was completely written from scratch.  It requires eggdrop
1.6.8 or later together with TCL 8.3.2 or later.

You can find an instance of MoxQuizz running in #quiz and #quiz.de on
DALNet (since November 2000).

The impatient read section 1 for the most important stuff.  If you are
not planning to run a script/bot for yourself, you can skip sections 4
to 6.  If you want to control the script, read section 4.  If you plan
to install a script/bot for you own, read 5 and 6 as well as the
INSTALL file.

All configuration variables mentioned can be changed in the file
moxquizz.rc  See section 5 for more information about configuration
and additional features like colors on/off, allstars computed monthly,
etc.


1. Quickstart
-------------

This section briefly tells, what you definitely must know before you
start listed as separate items.  You should have installed an eggdrop
and have read INSTALL.

	- You need the flags P and Q to be able to control the game.

	- To start the game, simply start the eggdrop with the script
          loaded and say:
	    !ask
	  in your quiz channel.

	- Control the quiz from a dcc connection to the script/bot.

	- All control commands are prefixed with:  .!

	- Safely shutdown the quiz (and the let the bot terminate)
          with:
	    .!exit
	  from within a dcc connection.

	- Pause a running game with .!pause and continue with .!cont


2. Detailed descripton
----------------------

This section needs to be written more thoroughly -- maybe this gets
never done, since many things are rather technical and should not
bother you if you are a normal user.  Besides that it might be
interessting.

- Channel desert detection

  MoxQuizz detects if nobody is talking to the channel for a while and
  halts the quiz automatically.  The time of silence is
  $useractivetime seconds and will be checked in the tip giving
  function.

- Regular Expressions -- regexp

  MoxQuizz is able to match answers with a regular expression.  This
  is a very powerful tool allowing you match a wide range of answers
  including alternatives, different orders (done with alternatives :),
  optional parts, common typos etc etc.  Search for regexp with the
  search engine you like to get enlightened, you will love it.

- Allstars table

  Allstars data is stored with username, so users playing with
  different nicks get several entries.  The hostmask is stored, so
  that the list can be edited by hand.  This might be replaced by
  something better.  You can use allstars.pl to prettyprint the table
  as ASCII, HTML or XML.

  The formula taken for the allstars computation is:

                   Points in game               1
  Sum over: 10 * ------------------ * ------------------------
                 log10(your points)   your duration in seconds

  By default the allstars table is computed for separately for each
  month.  The script always serves only the current month.  This can be
  changed (see optional features below).  The duration is the time the
  player needed to win, i.e. the time between his/her first score and
  the end of the game.

- Game state

  There are 5 game states: stop, halt, asked, waittoask and pause.
  Asked and waittoask will change mutually while a game is in progress
  and can temporary be left to pause (!pause) and then reentered with
  !cont.  Halt and stop can be reached from everywhere.  The
  difference among the last both is: from halt a new game can be
  started by users with !ask, whereas the stop state must be left
  explicit with !init or !halt (both change to state halt).

- Bot exit

  The script stores the ranks and all asked userquestions to disc (see
  configuration section below for filenames)

- Rehashing

  The script tries to survive rehashing.  To achieve this, it writes
  the ranks to disc and reloads them after the rehash.  Lofgiles are
  tried to be reopened, too.

- Optional features

  The script has some features, which might or might not be enabled in
  your bot.  Ask the botowner or check .!set from the partyline or
  read moxquizz.rc.  I'll talk about the defaults here.  Check section
  Configuration/Quiz Features for a detailed description.

  The script can give tips from time to time (every 30th question or
  so).  Currently it talks about common commands and features af the
  script, like how to post userquestions, how to check allstars, etc etc.
  This feature proved to be useful, since it learns users the basic
  commands.

  The script has a command !rules which show the user the channel
  rules.  If you installed the script/bot for yourself, you probably
  want to check moxquizz/quizdata/channelrules.txt.

  Some channels have sentinel bots, which +im a channel when danger is
  ahead.  MoxQuizz detects this and automatically pauses (this feature
  is disabled by default).  Let the game continue by -m your channel
  or .!cont from the partyline.
  
- moxtools.tcl

  This is a set of tool functions not directly associated with the
  quiz operation.  So far the following is included:

  Announce  -- let the script announce a single message to each user
               joining a channel the script is on.  Set the message with
               !announce as master.

  Antispam  -- If there is a file intl/antispam.txt, MoxQuizz will
               send it to any user who says !antispam in the
               channel.  This is meant to provide information about
               how to avoid spammers on IRC (which was a big problem
               on DALNet end of 2002).

  Bad words -- the script recognizes a small set of bad words and kicks
               of someone says them.  If the person repeats swearing
               within a certain time he/she is banned for 30 minutes.
	       Disabled by default.

  Identify  -- bot users with flag P can let a MoxQuizz manually
               identify itself agains a nickserv by !identify on the
               partyline.  This is because automatic identify doesn't
               always work correctly.

  Logfiles  -- function which creates a logfile for each channel the
               script/bot joins.  I did not like the fact, that all
               stuff is logged to a singe file not even tagged with
               the channel name.
  
  Nickserv --  The script is able to identify itself to nickserv.
               Specify hostmask and password.

  VHosts   --  The script can automatically be set up for use a vhost.
               Currently this works for me and probably won't work for
               you (since I don't know how you get your vhost, please
               tell me!)  Disabled by default.

  Jump     --  Allows users with flag Q to let the bot jump to a
               specific server (or to next server in list): !jump or
               !jump <server>

- Other channels

  The script/bot can join other channels, but the quiz can only take
  place in one channel at a time.  Note that the fun commands are
  aviable in all channels, the script/bot is in (they are now
  documented in README.moxfun)

- What MoxQuizz is not/cannot:

  . The game cannot run in more than one channel at a time (install
    another eggdrop if you want this).

  . Teamplay is planned since long, but still far ahead.  One can only
    play for oneself.

  . MoxQuizz will not help your users if they get addicted to quiz.

- Multilingual:

  Starting with version 0.8.0 MoxQuizz speaks several languages and
  comes with question databases in a wide range.  Currently there are:

  Language     Message set?  Question set?

  english      yes           5437
  french       yes           -
  german       yes           6524
  greek        yes           -
  malaysian    -             3444
  norwegian    -             566


3. User commands
----------------

Several commands can be invoked by the user besides solving a question
by simply saying them on the channel:

   !allstars <n>   - shows you the first n positions in the current
                     allstars table.  When ommitted, n defaults to 10.

   !ask           - starts the quiz after is was halted/initialized or
                    tells the user the actual question by /msg, if a
                    question is open.

   !comment <txt> - comment bugs, typos and any other things you want
                    to be said.  If you refer to a question, make sure
                    to mention it's number!

   !hi            - Lets the script greet known ppl (bot users and ppl in
                    the allstars table).

   !score <nick>  - tells you <nick>s current scores.  Without <nick>
                    it will be you own scores.

   !rank <n>      - shows you the first n positions in the current rank
                    list.  When ommitted, n defaults to 10.

   !revolt        - can be used to show that a user dislikes a question.
                    The script accepts revolts after at least one tip was
                    given & solves automatically, if more than 50 percent
                    of the people, who said something within the last
                    'useractivetime' seconds (default 4 minutes),
                    revolt.

   !qhelp <topic> - same as !qhelp per msg.  See below for a description

   !rules         - same as !rules per msg.  Lists the channel rules,
                    if the script is configured with any.

   !version       - reports version number and amount of known
                    questions of MoxQuizz similiar to the on-join
                    message.

Additionally, there are commands which can be sent as a /msg to the
bot to ask user questions and do other things:

   !userquest <question>::<answer>::<regexp>
                  - ask a user question.  Specify at least question
                    and answer.  Optional regexp is a TCL regexp to
                    match. "::" separates the elements.  You further
                    can enclose a region in the answer with #...# to
                    mark text for tip generation and answer match.
                    Your nick can then use !usertip, !usersolve
                    and !usercancel.
		  
                   Up to five questions will be scheduled, before a
                   question is rejected.
            Example: !userquest Who is my author?::Moxon

   !usertip <tip> - immediately places a tip while in your userquest.
                     Without <tip>, a default tip will be given.  The
                     <tip> will be inserted into the list of generated
                     tips and stored, too.
		  
   !usercancel    - cancel a given userquestion or your question ahead
		  
   !usersolve     - solves your userquestion
		  
   !qhelp <topic> - gives an help text on <topic> or an overview.

   !rules         - same as public !rules.  Lists the channel rules,
                    if the script is configured with any.



4. Commands to control the script
---------------------------------

The script is controlled by sending him commands via /msg and dcc.  They
are parted into commands which can be invoked by users known to the
bot as quizmaster (flag P), quizadmin (flag Q) or bot master
(flag m).  Note the user commands must be invoked by msg, whereas
those mentioned here must be invoked over a dcc chat session like
this (exceptions are !nuq, !uq and !listnuq):

	.!tip
or
	. !tip

The "!" is there because of historical reasons and to avoid clashes
with other dcc commands.

Quizmasters can control the quiz like starting and giving tips,
quizadmins can manipulate the rank list and move the quiz to other
channels, the master can set certain system variables and let the bot
join other channels to sit around and friends can let the bot talk on
any channel it is on.

The list following is ordered by function group, where each command is
preceeded with the flag needed.  Note, that you only have to send the
command without the flag.

# quiz running status

  P  !halt             	- halt the script, and closes an open question
                       	  (ranks are kept safe).  Users can restart the
                       	  quizz with !ask !
  P  !init             	- init the script. The game can be started with !ask
  P  !reset             - shortcut for sequence .!stop, .!rankreset, .!init
  P  !stop             	- stop the script, and closes an open question
                       	  (ranks are kept safe).  Quiz can only go
                       	  continued with !halt or !init.
  P  !pause            	- pauses the actual game.  A running game can
                       	  be continued with !cont (NOTE: !ask will not
                       	  continue here, but questions are kept open.)
  P  !cont             	- continues a previously paused game.
  P  !status           	- report the current status to you via /msg
  m  !exit             	- causes the script to save all its data (rank and
                       	  user questions), leave the current channel
                       	  and quit. 
  m  !aftergame <act>   - Specify what the script shall do after the current
                          or next (if none open) game.  Valid values
                          are: halt, stop, exit, newgame.  Except the
                          last one all correspond to the !<act>
                          command.  newgame will just start a new game.
                          Note that aftergame is only considered when
                          the game is won or the channel is detected
                          desert.  This command is for automatic
                          shutdown and stuff.

# quiz configuration

  m   !load              - load configuration from $configfile
  m   !save              - save current configuration to $configfile
  m   !set <key value>+
                         - set some values from the configuration
                           file.  This replaces !tipdelay, !askdelay,
                           !tipdelay, !setwinscore and !restrict from
                           0.6.x and prior.  Lists options and their
                           value if no or a single argument is given,
                           lists available keys if single argument
                           matches more than one.

# quiz control stuff like speaking and channel hopping

  P   !say <txt>     - let the bot say something.  txt can start with
                       #<chan> to talk to <chan>.  Default is quizchannel.
  P   !act <txt>     - let the bot act in some way.  txt can start with
                       #<chan> to act in <chan>.  Default is quizchannel.
  m   !allsay <txt>
  m   !allact <txt>  - say <txt> or act <txt> on all active channels.
  Q   !join <chan>   - join a channel to sit around
  Q   !part <chan>   - part a channel
  Q   !quizto <chan> - move quiz to <chan> (without leaving the channel)
  Q   !quizleave     - part current channel where the quiz is on.

# question related stuff

  P   !solve          - solve current question
  P   !tip <tip>      - give a generated tip or the optional <tip>.  If
                        it is an optional tip, it will be inserted into
                        the generated tip list.
  P   !setscore <n>   - sets the score for the current question to
                        <n>.  This will be noticed to the channel.

  P   !skipuserquest  - skip the next (not the current) user question
  m   !qsave          - save all user questions (in fact, they will be
                        appended to their file, so that nothing gets
                        lost).  The internal list will be cleared, so
                        that the file contains questions only once.
			Only questions already asked are saved, unless
                        you specify 'all' as parameter.
  Q  !reload <set>    - reload the question files.  Shows a list of
                        avialbe sets without param.

  P  !nuq <nick>      - stops nick!*@* and *!ident@*.subdomain.domain
                        from adding userquestions for the next 45
                        minutes
  P  !uq              - reverts this
  P  !listnuq         - lists all !nuq entries
  P  !clearnuq        - clears all !nuq entries

# commands to manage players and rank

  P   !allstars <n>      - shows the first n allstar ranks.  n
                           defaults to 5.
  m   !allstarssend      - sends you the current alltars file by dcc,
                           if module filesys was loaded
  m   !allstarsload      - reloads the allstars file.
  P   !rank <n>          - show the first n rankings.  The rank-show
                           timer will be reset.  n defaults to 5.
  Q   !rankdelete nick+  - remove all given nicks from the rankings
                           (and userlist)
  m   !rankload          - replace ranks in memory with the ones saved
                           to disk
  m   !ranksave          - save current rankings (in fact, it saves
                           all known users)
  Q   !rankreset         - resets the rankings and clears the userlist
  Q   !rankset <nick score>+  - sets all given nicks to the
                                corresponding score, if they are
                                known to the script.  If not, no score
                                will be set. Score can be one if -n, n
                                and +n whether tosubsctract, set
                                absolute or add score.

# miscellaneous commands

  -   !comment <txt>     - same as public !comment command.  Records
                           txt as a comment.  If you refer to
			   questions, please mention it's number.


5. Configuration/Quiz features
------------------------------

Besides that you can tune the script by changing several variables,
there are some features you can choose to enable/disable.  There is no
need to change the script itself, all changes you make are done in
moxquizz.rc in the quiz directory.

Files and directories (these are defined in the script itself, but you
won't change them):

   quizbasedir        moxquizz
   datadir            $quizbasedir/quizdata
   configfile         $quizbasedir/moxquizz.rc
   
   rankfile           $datadir/rank.data
   allstarsfile       $datadir/rankallstars.data
   userqfile          $datadir/questions.user.new
   commentsfile       $datadir/comments.txt
   channeltipfile     $datadir/channeltips.txt
   channelrulesfile   $datadir/channelrules.txt

Configuration variables in moxquizz.rc:

   Things you sure wish to change:
   -------------------------------

   channelrules = yes      Print channel rules on !rules.  Please
                           visit the channelrulesfile (defaults to
                           $datadir/channelrules.txt) and insert
                           _your_ rules. (yes/no)

   questionset = en        All files in datadir with this extension
                           will be considered as question sets and
                           will be loaded on quiz startup.

   quizchannel = #quiz     Channel the script will join on server connect
                           and make the quiz.

   language    = en        Besides having different sets of questions,
                           the script speaks other languages than
                           english.  It comes with a german language
                           set, more will be added.

   Features you might wish to enable/disable/change:
   -------------------------------------------------

   channeltips      = yes  enable/disable channeltips -- small
                           helptexts postet now and then.  See
                           or edit quizdata/channeltips.txt for the
                           tips. (yes/no)

   colorize         = yes  shall the script use colors? (yes/no)

   monthly_allstars = yes  compute allstars table per month (yes/no)

   msgwhisper       = no   If enabled, all information to users is
                           given as PRIVMSG.   If disabled, it is
                           given by NOTICE.  This affects all messages
                           to users.

   pausemoderated   = yes  automatically pause if channel get
                           moderated?  Some protection scripts
                           do that. (yes/no) 

   userquestions    = yes  allow users to post questions on their own
                           with /msg <BOT> !userquestion (see above)

   prices           = yes  Whenever a user wins a game, he will
                           receive a trophy. Check intl/*/prices.txt
                           for a list of them

   stripumlauts     = no   If you encounter problems with umlauts,
                           enable this option.  All umlauts will be
                           converted to their transliteration (this
                           feature might vanish in the future).

   Restriction Variables:
   ----------------------

   lastwinner_restriction = 1  Stops answer bots and too elite ppl.
                               After winning lastwinner_max_games the
                               user is ignored for the next game.  Can
                               be controlled with !restrict win_rows.

   lastwinner_max_games   = 2  Max number of games on is allowed to win
                               in a row.


   overrun_protection     = yes
                               don't accept anwers from new players
                               after overrunlimit points have been
                               reached by at least one player (yes/no)

   Things which affect the gameplay and script behaviour (timers and
   such).  You normally don't want to change these:
   --------------------------------------------------------------

   Don't change things here too often, since some affect the allstars
   score calculation!

   maxranklines     = 25   maximum number of rank or allstarslines
                           which will ever be shown.  Don't set this
                           too high, since it blocks all other output
                           by msg such as help and stuff.

   tipcycle         = 5    number of automatic tips generated

   winscore         = 40   score to win the game

   askdelay         = 15   Delay in seconds between solution and next
                           question.

   tipdelay         = 30   Delay in seconds between tips.  After the
                           tip list is printed completely and another
                           $tipdelay period, the question will be
                           solved automatically.


   System features which you probably don't want to change:
   --------------------------------------------------------

   userqbufferlength  = 5  Number of user questions scheduled max

   quizloglevel       = 1  Loglevel the script logs it's stuff to.

   useractivetime     = 240 Seconds a user must have said something to
                           be considered active (so he gets counted
                           in !revolt code)


6. Supplemental tools
---------------------

This section describes the supplemental tools found below the
directory named supplemental.

6.1. setup.pl -- set some variables in provided config and moxtools
----

This perl script sets some variables mentioned in INSTALL for you.  It
should work with a modified config file (if you changed values), but
probably will fail if you added a list of servers.  Nevertheless, you
can use it with the config files which come with MoxQuizz.

6.2. allstars.pl -- prettyprint the allstars table for MoxQuizz
----

To support your quizchannel, allstars.pl prettyprints your allstars
file as a ASCII table or as a HTML table.  Invoke with --help to get a
list of commands and parameters.


7. Future thoughts
------------------

Here is a small roadmap:

   - team code
   - tipmode to mix generated and given tips
   - game styles, like most scores in 30 minutes and such


8. Contact
----------

You like this?  You hate it?  Tell me about!

Author: Moxon AKA Sascha Lüdecke
IRC:    #quiz and #quiz.de on irc.dal.net
EMail:  moxon@meta-x.de
WWW:    http://www.meta-x.de/moxquizz



8. Credits
----------

Special thanks to (no order):

- Michee <Michee@sonnet.de>, since artwork was done with heavy support
  of him, and he edited numerous questions.
- Julika for constructive discussing a lot of issues and editing a
  large amount of questions, too.
- Neo for making a lot of constructive critics.
- all people on the quizchannels on (no longer existent) irc.sonnet.de
  for being patient when they encountered bugs, as well as all the
  people from #quiz and #quiz.de in DALNet.
- Imran Ghory for providing more than 600 english questions.
- ManInBlack for providing the VHost code for moxtools.tcl
- Quake <quake@giga4u.de> for providing another 400 german questions
- |casiotone| for editing _all_ english questions.  What a huge amount
  of work done, thanks!
- Stanstimer for editing lots of english userquestions and providing
  hundreds of own ones
- Magic2000 for providing lots of english questions
- Julia33 for providing an initial set of about 500 norwegian
  questions
- BriZen for prodivind more norwegian questions
- ^MaKaM^ <makam@adinet.com.uy> for providing 1048 spanish questions
- "Gun@gnoo.org" <Gunslinger@ifrance.com> for the french translation
- bibib <skaterz@cytanet.com.cy> for the greek translation
- stuff^ for a plethora of new english questions

 
Lots of others for providing questions, translations, suggestions,
bugs and more.  If you are not listed here, please mail me.

------------------------------------------------------------------------

$Id: README,v 1.48 2002/07/05 18:57:27 chat Exp $

## Local Variables:
## mode: text
## End:

Latest News

27 Dec 2018 Eggdrop v1.8.4 Stable Release 22 Dec 2018 Eggdrop v1.8.4 Release Candidate 3 15 Dec 2018 Eggdrop v1.8.4 Release Candidate 2 12 Dec 2018 Eggdrop v1.8.4 Release Candidate 1 04 Feb 2018 Eggdrop v1.8.3 Stable Release 13 Jan 2018 Eggdrop v1.8.3 Release Candidate 2

Resources

Eggdrop Community Forum Download Eggdrop Eggdrop Set-up Using your Eggdrop Enhancing Eggdrop Eggdrop Tcl Commands Eggdrop 1.8.3 Documents Eggdrop Config File Unix Shell Commands
Donate Help TclArchive.org with server costs. By donating, you help keep these scripts available to everyone. PayPal

© 2015 - 2023,  Greenwood Web Design