Maltriv

From Botdom Documentation

Jump to: navigation, search
Read general information about Maltriv on the Botdom Wiki.

Maltriv is the name for a module for Futurism by photofroggy, in PHP. This module allows the user to operate trivia in any chatroom desired. This page documents the instructions on how to set up the module on your bot, and how to use the commands.

Contents

Installing

Installing the module is different depending on which bot you are using, so take note of which bot you are using.

Download

First thing you will need to do is download the actual module. Head over to the wiki page to download a copy of Maltriv, but remember, you'll want a different module depending on the bot you are using, just check which file you are downloading.

Unzip

Once you have the files, you need to know what to do with them. Regardless of which bot you are using, you will need to unzip the files, and place them in their own folder, inside your bot's module folder, so after this, config.php would be in C:\bot\modules\trivia\config.php, if your bot was installed in the folder C:\bot\, of course.

That's all you need to do to install! Run your bot and it should work! If your bot was already running, restart it.

Commands

Now, this module requires you to use quite a few commands to use it properly. Below is a list of the commands, and explanations of how to use them. Please read this carefully, as it is very useful. These commands are commands which work with Maltriv 1.9, and were last tested on Futurism 0.3.3 using PHP 5.2.2, so please keep this in mind, although these commands should work with future versions of the module.

Below is the documentation for commands and how to use them. For
the syntax of each command replace "!" with the trigger of your bot, if it is a
different character. Anything in brackets is optional, and anything in square
brackets is something needed, but something which you need to change to what
you want it to be.

1. trivia
	1. about
		
		Syntax: !trivia about
		
		This will return basic information on the module, linking
		to the wiki page of the module.
	
	2. on
		
		Syntax: !trivia on (chatroom)
		
		This command will turn trivia on. You need to have at least
		three questions saved before starting. You can start trivia
		in a specific chatroom, by replacing (chatroom) with either
		the ID number of the chatroom you wish to use or the actual
		name of the chatroom you wish to use, in the above syntax.
		Leave out the chatroom to use the room you are in. The
		chatroom you use must be saved as a trivia channel to be used.
	
	3. off
		
		Syntax: !trivia off (channel)
		
		This command will disable trivia until you choose to start
		it up again. Replacing (channel) with the name or id number
		of a trivia channel will turn trivia off in the specified
		trivia channel if it is already switched on. Do not include
		(channel) to switch off trivia in the room you are in.
	
	4. config
	
		Syntax: !trivia config (channel)
		
		This command will show the configuration settings for trivia.
		Replacing (channel) in the above syntax with the name or id
		of a trivia channel will display the configuration settings
		for that trivia channel only.
	
	5. tchan
	
		1. add
			
			Syntax: !trivia tchan add [channel]
			
			Replace [channel] with the chatroom name of your choice in
			the above syntax. This will add [channel] as a trivia
			channel, and will be given an id number.
			
		2. [ID]
			
			Syntax: !trivia tchan [ID] [channel]
			
			In the above syntax replace [ID] with the id of the trivia
			channel you want to change and replace [channel] with the
			channel you wish to change it to.
		
	6. timeout
	
		Syntax: !trivia timeout (channel) [time in seconds]
		
		Replace (channel) with either the id or the name of the trivia channel
		timeout you want to change and replace [time in seconds] with the amount
		of time that you want to allow people to have to answer each question. 
		Leaving (channel) blank will change the timeout for the channel you are
		in. The	time should be in seconds! Default is 45 seconds. 
	
	7. qinterval
		
		Syntax: !trivia qinterval (channel) [time in seconds]
		
		Same as the timeout command, although this changes the
		amount of time in between each question. Default is 10
		seconds.

	8. cat(egory)
	Note: Admin only commands.
	
		Syntax: !trivia cat (channel) (show)
		
		This command will return what questions are being used and
		ignored in (channel). Leaving out (channel) will show the
		questions for the channel you are in.
		
		1. use
		
			Syntax: !trivia cat (channel) use [category]
		
			This command will set [category] as one of the categories
			which are used by (channel). Leaving out (channel) will
			set [category] as a category being used in the channel you
			are in. Replacing [category] with "all" will make (channel)
			use all questions.
		
		2. ignore
		
			Syntax: !trivia cat (channel) ignore [category]
		
			This is the same as the above command, except this command
			will set [category] as a category which will never be used
			by (channel).
		
		3. rem(ove)
		
			Syntax: !trivia cat (channel) remove [category]
		
			This command removes [category] from the categories being used
			and ignored by (channel). Leaving out (channel) will remove the
			category from the room you are in. Using "all" as a category
			will remove all of the categories from (channel).
		
	9. score
	
		Syntax: !trivia score [person] (channel)
		
		In the above syntax, replace [person] with a username, 
		and replace (channel) with a trivia channel name or id.
		This will display the score for [person] in trivia room
		(channel). To show [person]'s total score for all trivia
		rooms operated by the bot, replace (channel) with "all",
		and if you leave (channel) blank, it will show the score
		for the chatroom you are in, if it is a trivia room. Use
		"me" to view your own score.
		
		
	10. top
	
		Syntax: !trivia top (#) (channel)
		
		Replace (#1) with any number and replace (channel) with a trivia
		channel name or id number in the above syntax. This will return the
		top (#) scores for trivia players in (channel). If you leave (channel)
		blank, the scores for the channel you are in will be shown if you
		are in a trivia channel. Replacing (channel) with "all" will show the
		top scores for all trivia channels operated by the bot. If you leave (#)
		blank, the top 5 scores for the room you are in will be displayed. If you
		replace (#) with "all", all the scores will be shown for the selected
		trivia channel.
		
	11. players
		
		1. Syntax: !trivia players
			
			This will show all of the trivia players in the order that
			they started playing! Hover over a username to view the
			time they started playing and their score.
			
		2. d(el(ete))
			Note: Admin only.
			
			1. all
				
				Syntax: !trivia players d [channel] all yes
				
				Replace (channel) with name or id number of a trivia
				channel containing user data in the above syntax. This
				will delete all of the player data stored for [channel].
				Replacing [channel] with "all" will delete player data
				for all chatrooms.
				
			2. [username]
				
				Syntax: !trivia players d [channel] [username]
				
				Replace [username] with someone's username, and replace
				[channel] with the name or id number of a trivia channel.
				This command will delete the [channel] score data stored
				for [username]. Replace [channel] with "all" to delete data
				for [username] in every trivia channel operated by the bot.
			
	12. cat(egorie)s
		
		1. (list)
			
			Syntax: !trivia cats list (or) !trivia cats
			
			Shows a list of the categories available and their id numbers.
			
		2. add
			Note: Admin only
			
			Syntax: !trivia cats add [category name]
			
			This command allows you to add a question category, so long as
			the category isn't already set.
			
		3. del(ete)
			Note: Admin only
			
			Syntax: !trivia cats delete [category]
			
			This command allows you to delete a question category. Simply
			replace [category] in the above syntax with either the ID
			number of the category or the actual name of the category that
			you want to delete. You can't delete the category "General Trivia"
			because that category is needed for the module to work properly.
			
	13. message(/msg)
		
		1. (show)
			
			Syntax: !trivia message (channnel) show (or) !trivia message [id]
			
			Replace (channel) with a trivia channel name or id number. This will
			show the question message for trivia channel (channel). Leaving
			(channel) out will show the question message for the channel you are
			in.
		
		2. example
			
			Syntax: !trivia message (channel) example
			
			Replace (channel) with a trivia channel name or id number. This will
			give an example question message for the channel selected. This command
			has been made so you can see what your question message will look like.
			Leaving out (channel) will show an example question message for the
			channel you are in.
		
		3. e(dit)
			Note: Admin only
			
			Syntax: !trivia message (channel) edit [message]
			
			This command changes the message that (channel) uses for asking trivia
			questions to [message]. When you change the message, make sure that you
			include the variables below, as they are shown:
				%id%
				%question%
			The above variables are needed in the message! %id% will be replaced by the
			questions ID, and %question% will be replaced by the question. Below are some
			variables which are not required, but are recommended:
				%qtime%
				%category%
				%hits%
				%misses%
				%answers%
			Below is an example of how to use the variables in the command, if you want to
			change the message:
				
				!trivia message #botdom edit <b>Question #%id%</b><br/>%question%<br/><sub><b>Hits:</b> %hits%<b>; Misses:</b> %misses%<b>;</b></sub>
				
			If you do not include the required variables in your custom message, then the 
			command will return an error.
			
	14. channels(/chats)
		
		Syntax: !trivia channels
		
		This will return the different trivia channels used by the bot. Any channels in which
		trivia is active will be bolded.
		
	15. tag
		
		Syntax: !trivia tag [ID] [tag]
		
		Replace [ID] with the id number of the question you want to tag, and replace [tag]
		with your tag, or the reason you are tagging the question. This will tag question
		[ID] with [tag].
		
	16. tags
	Note: Admin only command.
		
		1. *default*
			
			Syntax: !trivia tags
			
			This command will return a list of questions that have been tagged by users.
			
		2. view
			
			Syntax: !trivia tags view [ID]
			
			Replace [ID] with the id number of a tagged question in the above syntax. This
			command will show all of the tags for the question specified.
			
		3. d(el(ete))
			
			Syntax: !trivia delete [ID]
			
			Replace [ID] with the id number of a tagged question in the above syntax. This
			command will delete all of the tags that have been set for the specified question.
			
		
	17. credits
		
		Syntax: !trivia credits
		
		This command returns the credits for Maltriv, which can also be found on the Maltriv
		botdom wiki page
	
2. q(uestions)
NOTE: You can either type !q or !questions in the following commands.

	1. q(uestion)
	
		Syntax: !q q [question]
		
		Replace [question] with a question in the syntax above. The
		question can be of any length, and should end in a question
		mark (?). You will be given an ID for the question, which
		is used to refer to the question you made, throughout the
		module.
	
	2. e(dit)
	
		Syntax: !q e [ID] [question]
		
		Replace [ID] with the ID of the question you want to change
		and replace [question] with the question you want to change
		it too in the above syntax. This will replace question [ID]
		with [question].
	
	3. c(ategory)
	
		Syntax: !q c [ID] [category]
		
		Replace [ID] with the ID of the question you want to
		categories, and replace [category] with either the name of
		the category, or the ID number of the category, which you
		want to categorise the chosen question as, in the above
		syntax. This will categorise question [ID] as [category].
		The default category for all questions is "General Trivia".

	4. a(nswer)
	
		Syntax: !q a [ID] [answer]
		
		Adds an [answer] to question [ID] as the answer of the
		question.
		
	5. h(int)
		
		Syntax: !q h [ID] [hint]
		
		Same as the answer command, but this adds a hint to the
		specified question.
		
	6. d(el(ete))
	
		1. a(nswer)
			
			Syntax: !q d a [question ID] [answer ID]
			
			This command deletes the specified answer from the
			specified question. Put "all" as the answer ID to 
			delete all of the answers for that question.
			
		2. h(int)
		
			Syntax: !q d h [question ID] [hint ID]
			
			This command deletes the specified hint from the
			specified questions. Put "all" as the hint ID to
			delete all of the hints for that question.
			
	7. clear
		
		Syntax: !q clear yes
		
		This command will delete all of the questions for the
		trivia module. This cannot be reversed, so be warned!
		
	8. list
		
		Syntax: !q list (category)
		
		This returns a list of all of the questions that are
		saved on the bots system. If you replace (category)
		with either the ID number of a category or the name
		of a category, in the above syntax, then the bot will
		only show the questions saved under the chosen category.
		
	9. f(ind)
		
		Syntax: !q find (search term)
		
		This command searches for (search term) through all of the
		stored questions. Using quotations in the search term will
		make the command search for the whole term, and return
		questions containing it (example: "Who made"). If you don't
		include quotations, then the bot will search for each word
		separately (example: Who made). Using quotations should make
		the search more accurate.
		
3. hint

	Syntax: !hint
	
	Shows a hint for the current question. You are only allowed
	to use this command once per question!
	
4. repeat
	
	Syntax: !repeat
	
	This repeats the current question, and shows how much time
	you have left.


Thank you for reading, I hope that this documentation is of some help to you.

Personal tools