Friday, June 21, 2013

Tat's Trivia Bot 3.69

Tat's Trivia Bot 3.7

I think I found the dialog issue. When you'd open it it would beep due to crashing. I also added in KAOS questions. I didn't know what they were before, but apparently they are like Total: except you don't lose for not getting all the answers. More or less. I also added a hint for the KAOS questions, which similarly works for total as a piggy backed the question type. I also expanded the dialog a nice chunk. Like replaced all the stuff and took up more room. It looked horrible on my system and my system's fairly modern so maybe it sucks other places too.

Latest Version: Tat's Trivia 3.69

Also if you need an eggdrop tcl trivia script for IRC I do recommend:
Seemed like a pretty reasonable script, and seemed to have pretty clean execution. Runs on an entirely different platform than my mIRC bot (so don't bother if you don't know what it is).


Joe Public said...
This comment has been removed by the author.
Ikoslog said...

Hi tat.

I have been using your trivia script in mIRC to play trivia on my stream.

I have a few command based issues I need help with.

I've ignored most of the problems so far.. but today I had a regular user (not an op, mod etc) -- type !strivia and it stopped the trivia. No regular user should be able to stop the trivia, it is becoming problematic and I have tried to set the !strivia command to every option from Voice to Op and it still allows anyone to use the command. However !trivia is only usable by the people I set it to. So not sure what is going on.

Perhaps you could help me through email..

Please email me at

It would be easier to get this worked out that way.

I appreciate your time!


Tatarize said...

if (%ctok == 6) { if ((!$isdis(29)) && ($trivia.on) && ((!$team) || ($nick isop $iden))) { strivia $iden $nick } }

The line seems legit. It should check the user levels and various quirks and make sure it works. You could disable strivia or change the name with the translation script or any other sort of odd work around. But, it really should properly block the command. I'll test to make sure it works on mine. Before writing it off.

Any other problems? You can ignore them, I can ignore them. But, I'd still kind of want to know what they are.

Tatarize said...

Checked my own version. Seemed to work right. I went to commands I set the strivia command to voice and couldn't stop the bot without voice.

In theory, they could be marked as a friend. If they are in the friend list of the bot, they will trump even ops. But, it seems to work fine on my system. Though I seem to recall something odd about's somewhat non-standard implementation of IRC like servers.

Tatarize said...

If it's something specific to Justin.TV you might want to set the command level to FRIEND. Then add the people who should qualify as friends. I forget the specifics but I think Justin.TV had some issues with regard to the standardized modes or something.

Ikoslog said...

Glad you are repsonding so quickly. . I was checking email.

Ok here are the issues I know of:

These commands don't seem to respond in chat: !next !answer -- Ok I think I know whats up with the commands, I have a bot in the channel with commands of the same name -- (not my bot) so I didn't realize it till I investigated.

So with that in mind, Anyway I can change commands for any command that a bot shares? Change the name? Or change the trigger. I'd like to keep !trivia and so on.. and not change the trigger for everything -- so any somewhat 'easy' work around for a few commands that are conflicting with a bot with the SAME commands? Either in code, or otherwise? If in code please be thorough explaining ,.. as I don't really program.

Other than that --

Question -- I have added lots of themes.. by going to default tab -- then clicking on themes, and naming, adding text file, and so on. They work fine. However,.. I notice the scoring system doesn't tie into the main "questions.txt" file.

I notice that under the General tab there is a "Channel properties" area and has questions.txt (but I don't have my other text files here..) -- Is this causing the score listing issues? -- I tried to add some of my themes here as well and it just combined them in one big trivia when I typed !trivia.. I don't want all the categories combined for obvious reasons.

Question: On the general tab do the points per answer, hint reduction, and such options apply to all my themes? Or just the main !trivia one? Again, this seems to be related to not having anything on this general tab but the default "questions.txt".

Little help there , sounds like I am not configuring something correctly.

Also, while I'm at it -- Under general tab -- clicking on Trivia ranks (define) button.. It shows the ranks but there is no button or way I can see to "edit" them. It lets me add of course. This just not something editable?

That'l do for now. -- I think your software is sound for the most part.. just some issues on my part as I've explained.

Thank you sir,

Ikoslog said...
This comment has been removed by the author.
Ikoslog said...
This comment has been removed by the author.
Ikoslog said...

Ok, .. update. I got a more recent version of your script -- I must have just downloaded it before you put out the new version. Reloaded it, and it fixed the !strivia issue.

Now.. I'm still leary about some of the other issues --

Mainly the whole themes question I have/had -- Where the scores don't show properly when I use other themes instead of just the default !trivia.

Am I supposed to put my themes under the General tab (first screen under trivia options) ? -- As I add them as I mentioned above by

"by going to default tab -- then clicking on themes, and naming, adding text file, "

Do I need to do it in both places? --

And, still have the question of the general tab and it's options of points per question, and other options -- do they apply to only the files on that screen (text files) -- or to the theme files under the default tab as well?

Tatarize said...

The scoresfile on your themes and your default are different. You likely use a different scoresfile for the channel and mayhaps the default scores file for all the themes.

Ikoslog said...

How should I configure it (the score files and themes/text files) so they all share one score file?

As I mentioned when I added other trivia category .txt files under the "General" tab in trivia settings it seemed to combined the two files when you issued the !trivia command without any theme options. I need the categories all separated as I have about 1 million questions in many files and it bogs down the computer if any more than 100,000 or so are put in any one file.

Though, I would like the scores to all tally in one file.


Tatarize said...

If you aren't actually using radically different settings in a radically different settings mode. You don't need themes.

Just add all the question files into the questions part of the setup, and the one scores file you're using and call it a day. It'll randomly select a question, from any of the files and use it. If you want you can tag on a #Category at the end of the question file and the bot will say the category of the question.

It doesn't sound like you need themes at all. Just multiple question files, and that's just general settings.

Ikoslog said...

Thanks for the help/reply. However, I have dozens of categories -- and people choose specific categories/themes to have questions only from that category in the specific trivia session.

It's not a big deal,.. I can just leave things as they are. Was just curious.

Guess I can ask another question while I'm at it -- I've been familiarizing myself with irc scripting.. and written some code for a few of my bots in my channel. But I'm still new to it.

Not a big deal,.. but anyway I can change the number of points it takes for each person to move from the default 1-2-3-4-5-6 rankings? I notice I can add new ones, but the ones that exist I can't edit the points value for the existing trivia ranks? So I imagine I'd have to do this in the code. The "points required" is greyed out when you go into that option.

Thanks for great trivia script.

Tatarize said...

Yeah, to do that, you'd want to use themes. Specifically only modifying the questions being used between the themes.

It should totally work. I'm unaware of any problems setting that up, and have a few setup themes doing exactly that.

Anonymous said...

I really dont get why im getting this error. Check out > - bot ignoring answers from users, randomly. I dont see anything on my system that could be blocking that file from updating. Any clue?

Btw, thanks a lot, im using your script for years! Keep up the good work!

Tatarize said...

write $iif($readn,-l $+ $readn) $scoresfil %newline

It's just the write command.

It can be a few things, but most all of them have to do with your OS. Is your harddrive completely full? Do you have permissions for the file.

Try to open and edit the file yourself /run (filename) and it'll open it from mIRC.

The answer is that there's something wonky and it won't let you save. mIRC has no error catching so there's nothing I can do except tell you that you aren't able to write to that file and you need to be to have it save such things.

Anonymous said...

So i use this and i like it alot but about 3 times so far i have had this happen

1. It will sometimes reset all the trivia settings in the trivia settings file

2. It will somehow remove the settings from the file or something until you reload it (happened to me like yesterday i had to reload it)

3. It will write all of the trivias script code as folder names in my mIRC dur (this just happened 5 mins ago that i seen as i just only checked and it didn't do it yesterday)

4. You cannot use or unlimited with a theme file it will always do what you have it set to

Anonymous said...

This just writing the code as folders/files just happened again (again i cant be pure but it wasnt there last night when i went to sleep so my guess is it just happened when right before mirc crashed?)

I am on windows so it can write and i have 6+ gigs free on both harddrives

I could take a pic of the files its writing as i didnt delete them yet
This is what it looks like but theres 800+ files it makes

Guess it could be something to do with my mIRC i dont know

Tatarize said...

That's really really really weird.

Tatarize said...

Those are lines of code. There's seemingly nothing in my script that would ignore that bit and then write the rest of the script as separate files. It doesn't really even make sense.

Do you happen to know which file was first? Like the first line of code that got made into a file? The line before that line of code is likely wonky.

Anonymous said...

Next time it does it ill try to sort the files from when they were made and see what one was first

I deleted them now so i can't do it =/

Feature maybe you could add in if you use !disable it only works for the room its used in as right now it disables it in every room (and im in more than 2 channel)

Anonymous said...

dline $twin %prev

Is the last file in the sort list by time by all of them were created at the same time (i used sort by time to get that text)

This just did this 5 hours ago from the date

Tatarize said...

echo -a ... $gettok($line($twin,%fline),1,59) ... $gettok($line($twin,%fline),$gttok(address),59)

There's nothing about that that would do anything like that. I dunno. Make sure it's properly my version and not modified in some strange way.

Maybe you have the set score file as the actual trivia script. Like in settings when it wants a scorefile like triviascores.fil you have the actual script itself there. Or as one of the entries there. That'd cause a screw up kind of like that.

Downlord said...

hello tat
Great work on the bot, i dont have any isseus at all, theme's or general works fine, i just have 1 general question file, and the ohers on the theme settings, work nice, Jtv does have many isseus lateley in chat, i wanted to ask you about the !triviaadd, it doesnt seems to work for me, were are the add's posted, i try to post a msg in chat every 30 minutes.

Maybee you have a idea whats up with it.

I use !triviaad 30 (txt wich i want posted)

also is there a specific version of mirc that i should be using?

again thnx for the bot

playing trivia on

(we get banned a lot if we not there just ad +1 to the channelname)

Tatarize said...

The code would be /triviad 30 Hello.

Or some such thing as that. But, really you're better off getting some understanding of mIRC timers and just coding your own.

/timer 0 1800 /say #channel Hello. And Welcome. !Blah blah blah.

alias triviad {
if (($1 >= 1) && ($2)) { .timertriviaad 0 $calc($$1 * 60) $chan $2- }
else { .timertriviaad off }

Nery said...

Hello Tat,

I've been using your trivia for years and everything works great as usual.

My question is .. can i have the bot using describe instead of msg? I would really love to use it. Can you help me please? Thanks in advance and keep up the good work ;)

Tatarize said...

>>My question is .. can i have the bot using describe instead of msg?

Yeah, last tab, in commands. The default respond message pulldown box has "describe channel" as the last option.

Nery said...

Hey Tat, thanks for your fast reply. I changed a few commands on that tab before, but what i really want is having the questions and answers, starting trivia and stopping trivia using that method.

Looking forward for your response! Thanks again ;)

Tatarize said...

It's there. It's the default reply method. As I said. Don't change the individual commands, change the default method of reply.

Nery said...

Hello again Tat.

I've done what you asked and still doesnt work the way i would like to. I think i cant change that unless i change the script, which i wont cos i wouldnt know how or wher eto start.
Here is an example, showing how changing the default response to describe will not change how answers, questions, hints, starting, stopping trivia show up on screen. Check it out


Tatarize said...

Those are clearly descriptions to the channel. What is it you would like the bot to do. Because /describe the text to the channel doesn't seem to be the whole of it.

Nery said...

Hey Tat,

That's what i was talking about. I can only use the describe for bot commands. I would like to be able to have all the rest using describe, such as "starting trivia, questions, hints, stopping trivia", etc. So , all the ones i cant change on last tab. Im sorry, english is not my first language, maybe im not explaining properly. ;)

Thanks for your patience. Cheers.

Tatarize said...

That looks to be what it's doing.

(Name): text, is msg
(Name) text, is describe especially in a different for the name.

LikeaSsur said...

Hey Tat.

First of all, thanks so much for making this bot. I'm excited to use it in future streams, and will definitely send anyone who's curious your way.

I'm facing one issue, though. When I try to start up a round of trivia, everything appears great on the mIRC client, but the actual twitch chat adds random numbers before and after seemingly random words. It did this even when the "Decheater" was turned off. Any ideas?

Thanks in advance, and here's a picture to clarify:

Tatarize said...

The numbers aren't random they are the colors. Twitch doesn't process them like mIRC does. Go into settings and turn them off.

Ainsley-Aude Croteau said...

Hi, thanks for making this trivia bot, it's awesome!
I've discovered the same issue with colors on my Twitch chat, however I'm not certain which settings I need to be accessing to turn off the colors.
I've looked through both Twitch and mIRC and can't really find an option to strip colors entirely. Is there any advice you can offer me?
Thank you so much!

Tatarize said...

Go to the settings part dealing with colors. Click the big box marked Colors. That turns off the colors.

Tatarize said...

I dunno if either the twitch translation script or mIRC would have such a thing. Turn them off within Tat's Trivia Script.

Commands, Trivia, Trivia Options, Defaults, Colors

Downlord said...

Thnx m8

Stupid me, i missed the part that said /triviaad only starts from mirc window.

i was putting command on the site that had the chatroom embedded.

Thnx from all our trivia players, we enjoy your work that you did on it and created very nice chat trivia.

Greetings Downlord4ever Channel Star Trek Caster (most banned Jtv Channel)

Brett said...

Hey Tat, for some reason !themes does not seem to work at all. in mIRC it gives me a NOTICE Unknown command error.

Also for some reason when creating themes, running a theme will also use any other question files that have been added under the general tab - I don't recall having an issue with this in the past but I recently upgraded to 3.69 and it started having this issue.

Tatarize said...

Tried Themes. They still work.

Also /NOTICE is a perfectly valid command in mIRC. It shouldn't say it's invalid. But, it's a communication method. So likely somewhere the default response type or something is saying notice isn't a command. You can change it away from notice.

Also, if you were so inclined, you could also make an alias for the command:

/alias /notice /msg $1-

In your command bar will define an alias for /notice which will use msg.

It is a command.

mIRC help:

/notice nickname message

Sends a private message to nickname without opening a query window for either you or them.

BIGCountrysTV Walker said...

Hi. I just started using mIRC and created a bot. I am fairly new to this stuff but I ahve alot of features so far. the issue I am having with your Trivia bot is the format. This is what it types in the mIRC chat line:

Stopping the trivia. !trivia to restart.

Which is fine but this is how it shoes up in the Twitch chat.

7Stopping the trivia.12 !trivia 7 to restart.

See the 7's and the 12? Is it do to color coding or something. I have looked for those announcement lines in the code but cant seem to find it to edit it. Can you suggest a fix for me plz?

Tatarize said...

@BigCountrysTV, The color codes in the bot do not work for twitch. In mIRC mIRC sees them as colors. In Twitch, Twitch sees them as an errant character 3, and some numbers. It gets rid of the character 3 and shows the numbers.

In short, turn off the colors. You can't use em with twitch.

BIGCountrysTV Walker said...

!Tatarize TY! That worked on the formatting. One more question plz. Is there a way to slow it down? It will ask the qeustion then like 5 sec later start giving hints. I have it set to 3 hints and its like 5 sec between each hint. How can I increase this duration?

Thanks again

Tatarize said...

In Trivia Settings, Defaults, You'll find a box labelled Time. Those values should be basically everything you need.

Stefan Tepic said...

Hi Tat! Thanks for sharing this awesome piece of coding :)

I'm a total noob so please don't mind my questions. I wanna separate categories, but when I try to create themes, I just get questions from other categories.

Another thing, I don't have a lot of questions and I'd like them not to be shuffled. Is there any way I can do this?

Thanks in advance :)

Tatarize said...

Categories are setup in the question files like they have a hashtagged bit of info after them

question 1*answer
question 2*answer
question 3*answer
#Category A
question 4*answer

And so questions 1,2,3 are in category A. Themes let you replace question files not redo them.

Your question file is shuffled but it doesn't repeat them. It goes through the entire list before starting over. Going in order doesn't fix that but sure it's totally doable. I think I did it with a special that would call set a variable then each time it would ask a question it would trigger /ask %variable thereby making each question force the questions in order.

But, it was and still is a dreadful idea. I think you can simply do it by setting up a special award that on each question asked calls the command "askrotate" which does exactly that and should be in the bot for the last few versions. So award on any question with special askrotate, then you can see how bad it sucks.

Stefan Tepic said...

Okay, thanks for the answer and the time you put into it!
My next question would be: Do I have to create separate text files for categories, or can I have one big file and separate the categories with hashtags? Do I go and create themes in the Defaults tab as well? What's the course of action to properly execute this?

If the questions don't repeat, I have 0 problems with them being shuffled. I was, however, under the impression that they do repeat. Thanks again Tat!

Stefan Tepic said...

Oh and another thing ^^

For example, I want to scramble 3 words, but I want them all scrambled into 1. Currently, when I scramble 3 words they turn into 3 scrambled ones.


Again, total noob here. Cheers!

Tatarize said...

It's not exactly a thing that needs solving as dividing them up as they are is the correct answer. But, I'd figure if you found this code:

alias -l scramble {
tokenize 32 $1-
var %i = 1, %temp.smbl
while (%i <= $0) {
var %word = $eval($+($,%i),2)
while (%word != $null) { var %rand = $rand(1, $len(%word)), %temp.smbl = %temp.smbl $+ $mid(%word, %rand, 1), %word = $left(%word, $calc(%rand - 1)) $+ $right(%word, $calc(-1 * %rand)) }
%temp.smbl = %temp.smbl $+ ;
inc %i
return $lower($replace(%temp.smbl,;,$chr(32)))

Which does the scramble, and you changed the tokenization from 32 (space) to something like 42 (*) it would break at the wrong bits and divide everything up as one big generally wrong blob.

Also you can simply cheat and drop the spaces.

Scramble*RockyMountainHigh*Rocky Mountain High

Then have a second answer with the space. This might be the easiest. And wouldn't require the bot work in a technically wrong manner.

Sergio Martinengo said...

I would like to know if you could add an option to detect lower and upper case (I need this for certain questions). Also, the Join message it's not working. As last petition, is it possible to give a score based on an entire round, similar as this:

"Username" has won "X" out "Y" rounds he/she has participated. This way shows how good a player is based on % of victories and loses.

Thank you.

Sergio Martinengo said...

And as a last petition, block the right click or ctrl+c on the channel, because my community is based on fast typers, and there would be questions that you just have to repeat the sentence as fast as you can.

Sergio Martinengo said...

As a last question, is it possible to create a round choosing a question for each category randomly?, like

one question of "X" category
then one question of "Y" category
then one question of "Z" category

So it's basically a loop.

Thank you!

Tatarize said...

>>I would like to know if you could add an option to detect lower and upper case (I need this for certain questions).

Generally no. In reality, if you wanted to alter the code in a specific way. It would also prevent Fish Stick from being fish stick or fIsh stick.

alias fix {
if ($getset(status,nospellfix)) { return $lower($strip($1-)) }
var %temp.fix = $lower($strip($1-))

The code in the fix alias includes the ever important $lower() command which reduces all strings to lower case for compares.

alias fix {
if ($getset(status,nospellfix)) { return $strip($1-) }
var %temp.fix = $strip($1-)

That might work. I stress might. Also fix only fixes lower case letters so capital letters won't be switched out.

>>Also, the Join message it's not working.

Should be. But, it was generally stupid anyway. It can be done with an award in the bot. Just trigger it when somebody joins and send a message hello or whatnot.

>>"Username" has won "X" out "Y" rounds he/she has participated. This way shows how good a player is based on % of victories and loses.

Generally again, no. Because there typically aren't rounds. There are often times people in the channel not in the game which would give them losses? One could count times they get at least one point. But, there's no code for doing anything of the sort at round end, or variables in the scores file to save that data.

Sergio Martinengo said...

I'm not sure if you got the notification. I wanted to tell you that what I did was replace the first code that you posted, for the second one, I guess that's the process, I mean on the script editor, right?, I'm kind of novice on mIRC, well, it didn't actually work. Let's say, this is an example of what I'm looking for:

Symbol of Potassium, the answer is "K", but if it's "k", shouldn't work, that's what I want to achieve, for example, Gold would be Au, not au or aU, haha.

Thank you, sorry for asking too much, is just that the community of the games I'm trying to make, they are very excited about it, and this seems like our best opportunity to apply an objective focused game, with no possibilities of cheating.

Tatarize said...

>>block the right click or ctrl+c on the channel, because my community is based on fast typers, and there would be questions that you just have to repeat the sentence as fast as you can.

That's not within the scope of the bot. They control whether they cut or paste. The program however has something called decheater. Which randomly interleaves character 160 (looks like a space) with character 32 (space), when it asks the questions. So oddly enough, you can try cutting and pasting. Odds are actually really good that it will not work, if decheater is on. You'd have to type it.

Tatarize said...

>>and also, everytime I answer a question, it bans me, why is that?, how can I avoid that to happen? Thank you!

In settings, the award tab, delete the cheater awards routines that ban people for typing beyond world record words per minute.

Sergio Martinengo said...

And as last question, sorry I'm adding things, but, would be possible to show every user time of answer?, like it shows the first one time, but would be possible to allow everyones time?, that way every can now the speed of their answer?, also the WPM?, thank you :)

Tatarize said...

The bot typically doesn't keep listening for answers after the first one is found. Because the typical use case is getting the right answer to the question is the right answer. Generally what you want is akin to multi, but rather than accepting multiple correct answers you want it to keep accepting the same answer accept just one. After all, in a typical use case, once somebody guesses the right answer, everybody knows the answer. It is however the case that it wouldn't be hard to add a non-typical case like that (at least for me, if I remember how the coding works).

Gimme a bit.

Tatarize said...

@Sergio Martinego,

Okay, I updated the bot. That kind of weird question mode is now built in.

Knowledge21 said...

So I'm having an issue with the actual trivia bot not actually recognizing answers or commands from stream viewers at all. Everything is up and running, and the trivia bot works, all the questions are working and playing, but when a viewer in the stream states a correct answer, it doesn't pick it up, it just sits there and does nothing until the question times out, any idea what's wrong or how I can fix it?

neotargetone said...

Someone comes into my trivia room and is always stopping the trivia. Is there a way to prevent the public from stopping the trivia game???