PtokaX forum

Archive => Archived 4.0 boards => Finished Lua 4 scripts => Topic started by: c h i l l a on 07 January, 2004, 15:13:55

Title: trivia ex
Post by: c h i l l a on 07 January, 2004, 15:13:55
my first trivia release.
still very small but lost to come I hope.

--Trivia Ex by chill
--Ex = Expert and not experimental, although its still the other way around.
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
trivbot = "RasTriv"
--149
--164
--1
---------------------------------------------------------------------------------------
-- GLOBALS
---------------------------------------------------------------------------------------
RevealChar = strchar(149)
ReggaeTrivQues = {}
QFile = "fullques.txt"
Scores = {}
seeks = {}
Max1 = 10
GetQues = 1
trivtimerset = { 0,0,0 }
curTriv = 0
curCat = ""
curQues = ""
curAnswer = ""
TrivFolder = "txt"
TrivPrefix = "+"
cmd1 = "score"
---------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------
function Main()
dofile(TrivFolder.."/seeks.txt")
QuestionsTotal = getn(seeks)
dofile(TrivFolder.."/Scores.txt")
SetTimer(25*1000)
StartTimer()
end
---------------------------------------------------------------------------------------
function OnTimer()
foreachi(trivtimerset, function(i,_) trivtimerset[i] = trivtimerset[i] + 1 end)
if trivtimerset[2] >= 3 then
if GetQues == 1 then
WriteScore(Scores, "Scores", "Scores.txt")
if getn(ReggaeTrivQues) == 0 then
GetQuestions(Max1)
end
curTriv = ReggaeTrivQues[1][4]
curCat = ReggaeTrivQues[1][1]
curQues = ReggaeTrivQues[1][2]
curAnswer = ReggaeTrivQues[1][3]
tremove(ReggaeTrivQues,1)
points = 0
curHint = gsub(curAnswer,"(%S)",function (w)  points = points + 1 return(RevealChar) end)
SendQuestion(curCat,curQues,curHint)
trivtimerset[1] = 1
GetQues = 0
end
if trivtimerset[1] > 1 then
curHint = RevealOneChar(curAnswer,curHint)
if curAnswer ~= curHint then
SendQuestion(curCat,curQues,curHint)
else
SendToAll(trivbot,"Okey smokeys it was:  "..curHint)
GetQues = 1
trivtimerset = { 0,0,0 }
end
end
end
end
---------------------------------------------------------------------------------------
function DataArrival(curUser,data)
if (strsub(data,1,1) == "<") then
local _,_,sdata = strfind( data, "%b<>%s(.*)%|$")
if curAnswer and strlower(sdata) == strlower(curAnswer) then
SendToAll(trivbot,"Correct "..curUser.sName.." the answer was \""..curAnswer.."\", You get "..points.." Points.")
Scores[strlower(curUser.sName)] = Scores[strlower(curUser.sName)] or 0
Scores[strlower(curUser.sName)] = Scores[strlower(curUser.sName)] + points
SendToAll(trivbot,"That gives you a total score of "..Scores[strlower(curUser.sName)].." Points.")
trivtimerset = { 0,0,0 }
GetQues = 1
elseif TrivFuncs[strlower(sdata)] then
curUser:SendData(trivbot,TrivFuncs[strlower(sdata)]())
end
end
end
---------------------------------------------------------------------------------------
-- Send a question
---------------------------------------------------------------------------------------
function SendQuestion(curCat,curQues,curHint)
SendToAll(trivbot,"QUESTION - Nr. "..curTriv.." from "..QuestionsTotal.." Questions.\r\n"..
"\t----------------------------------------------------------------------\r\n"..
"\t- Category: "..curCat.."  -  Points:  "..points.."\r\n"..
"\tQUESTION: "..curQues.."\r\n"..
"\tHINT:  "..curHint.."\r\n"..
"\t----------------------------------------------------------------------")
end
---------------------------------------------------------------------------------------
-- Reveal a char
---------------------------------------------------------------------------------------
function RevealOneChar(answer,toreveal)
local Revealed,revealchar,ctoreveal = {},0,toreveal
for i = 1,strlen(toreveal) do
if strsub(toreveal,i,i) == RevealChar then
tinsert(Revealed,i)
end
end
if getn(Revealed) == 0 then
SendToAll(answer.."  "..toreveal)
end
revealchar,toreveal = Revealed[random(getn(Revealed))],""
for i = 1,strlen(answer) do
if i == revealchar then
toreveal = toreveal..strsub(answer,i,i)
else
toreveal = toreveal..strsub(ctoreveal,i,i)
end
end
points = points - 1
return(toreveal)
end
---------------------------------------------------------------------------------------
-- Get a bunch of questions
---------------------------------------------------------------------------------------
function GetQuestions(howmany)
local handle = openfile(TrivFolder.."/"..QFile,"r")
if handle then
for i = 1,howmany do
local num = random(getn(seeks))
seek(handle,"set",seeks[num])
local line = read(handle)
local _,_,cat,ques,ans = strfind(line,"(.*)%$%$(.*)%$%$(.*)")
if cat then
tinsert(ReggaeTrivQues,{cat,ques,ans,num})
end
end
closefile(handle)
end
end
---------------------------------------------------------------------------------------
-- Write Score
---------------------------------------------------------------------------------------
function WriteScore(table, tablename, file)
local handle = openfile(TrivFolder.."/"..file, "w")
write(handle,tablename.." = {\r\n")
for i,v in table do
write(handle,"\t["..format('%q',i).."] = "..v..",\r\n")
end
write(handle,"}")
  closefile(handle)
end
---------------------------------------------------------------------------------------
-- TRIVFUNCS
---------------------------------------------------------------------------------------
TrivFuncs = {
[tostring(TrivPrefix..strlower(cmd1))] = function()
TCopy = {}
for i,v in Scores do
tinsert(TCopy,{i,v})
end
sort(TCopy,function(a,b) return(a[2]>b[2]) end)
local msg = " -- Trivia Scores --\r\n\r\n"
for i = 1,getn(TCopy) do
msg = msg.."\t# "..i.."  -  "..TCopy[i][1].."  Points: "..TCopy[i][2].."\r\n"
end
return msg
end,
}


here is the full one with questions and the seek file.

** edit **
sorry can't, need another host...
may last one sucked anyways. lol.
any ideas.

optimus will you host a 2 mb big file?
Title:
Post by: c h i l l a on 08 January, 2004, 22:12:41
lets see how long this one holds :)

my first trivia bot

http://mitglied.lycos.de/shashamane/ (http://mitglied.lycos.de/shashamane/)
Title:
Post by: plop on 09 January, 2004, 04:20:24
QuoteOriginally posted by c h i l l a
lets see how long this one holds :)

my first trivia bot

http://mitglied.lycos.de/shashamane/ (http://mitglied.lycos.de/shashamane/)
gues you found a host, if not just email it 2 me.
got enough space left 2 hold a tiny 2MB file for you.

plop
Title:
Post by: *??G??* on 09 January, 2004, 04:51:23
Is there any way to set the game on a timer.  So that after the game is played for so long it will stop for a set amount of time and then starts back up on its own?
Title:
Post by: c h i l l a on 09 January, 2004, 17:49:28
yepp its done :)

and thanks plop...  I will get back to you, as soon as they close this one again ;)

http://mitglied.lycos.de/shashamane/p.scripts/ (http://mitglied.lycos.de/shashamane/p.scripts/)
Title:
Post by: *??G??* on 11 January, 2004, 02:56:34
hmmmm......so i guess there is no way to put this on a timer then.
Title:
Post by: lazyj189 on 11 January, 2004, 07:05:59
Ive been running this trivia bot for some time now and it is running quite perfectly.  All users seem quite impressed with the layout and scoring.  still havent had any bugs to report since the last fix.
Title:
Post by: c h i l l a on 11 January, 2004, 14:42:11
thanks lazyj189 ;),

*??G??* its on this site,

http://mitglied.lycos.de/shashamane/p.scripts/ (http://mitglied.lycos.de/shashamane/p.scripts/)

and you need to edit the Max7.
Title:
Post by: D-J Valhala on 11 January, 2004, 15:19:10
WHY TRIVIA EX ?

-         Stable and fast.

-         Over 90.000 questions, no dupes.

-         Only 5 ? 10 MB memory usage.

-         Works in PM and Main.

 

WHY NOT.

-         It only works with the Questions above.



i can't have my own Questions???

and id you can please post one Questions to see how is the trivia work?
10x m8

CyA all
Title:
Post by: c h i l l a on 11 January, 2004, 15:39:57
there is a question file on the site...  it works, I know :).

well you could have if they are formatted in the right way. But, there is a problem with the LUA in Ptokax, it doesn't always set the curser to the beginning of a line when, doing a line = read(handle)  thats why I have to create a seek file bofore that, with a standalone lua binary.
Title:
Post by: Event_Horizon on 11 January, 2004, 16:30:10
nice bot..... :D :D

could you implement !trivskip for skip a question PLZ

would be nice :)
Title:
Post by: *??G??* on 12 January, 2004, 03:34:33
Thanks Chilla.......keep up the good work.
Title:
Post by: Event_Horizon on 14 January, 2004, 10:09:44
Sup C H I L L A ???

to busy to do some more changes on your Trivia bot??

1st remember !trivskip PLZ ( would be very nice )

2nd about saving scores, this also should be done after stopping the trivbot... I lost few points cause I stoped before the score was saved....

just few ideas
Title:
Post by: c h i l l a on 14 January, 2004, 10:36:25
sometimes I don't post, updates here, so you need to check the site for yourself.

enjoy :)


Trivia EX (http://mitglied.lycos.de/shashamane/p.scripts/)
Title:
Post by: D-J Valhala on 16 January, 2004, 19:07:52
can you pls change it "<-RasTriv-> QUESTION - Nr. 18834 from 93913 Questions."

and add +hint
and +trivstart 1 (the trivia start with 1 Question)
+trivstart 20 (the trivia start with 20 Question)
Title:
Post by: c h i l l a on 16 January, 2004, 21:46:13
?(

I don't know why I should do it, when the script gets a question it gets a random questions, so latest the next questions, is random again.

And dunno if trivhint is worth it, I mean the script gives hints by itsself.

Guess you'll have to code it yourself.
Title:
Post by: c h i l l a on 17 January, 2004, 14:43:58
ahm...  done that triv hint thingy ;).
Title:
Post by: c h i l l a on 21 January, 2004, 16:59:41
some new stuff



   *** TRIVIA EX by CHILL ***

-- 21.1.04: V 0.63

1. Added possibility to Have own Questions Files. (sometimes slower and not randome)
   Files Must be like this:  Category$$Questions$$Answer, $$ can be changed in the LUA file (DivideChar)
   You also need to set :  HowToGetQuestions = 2  for own Questions Mode)
2. Added a nother way to display the Answers, Hints.

the LOOKS :)

+trivhelp
<-RasTriv-> -- Trivia Help --

   Prefixes:  + - !

   trivscore   - Show the top trivias.
   trivmyscore   - Shows your score.
   trivplayers   - Shows you the Trivia Players.
   trivskip   - Lets you skipp the current question.
   trivhint   - Gives you a hint.
   ------------------------
   login   - Lets you login.
   logout   - Logs you out.
   ------------------------
   trivstart  - Start the Trivia.
   trivstop   - Stop the Trivia.
   trivmain   - Plays Trivia in Main Chat.
   trivpm   - Plays Trivia in PM to the bot.
   triviaskip on/off  - Enables/Disables TriviaSkip.
   triviahint on/off  - Enables/Disables TrivHint.
   triviashowhint   - Switches between the 2 questions modes.
   ------------------------
   trivscorereset   - Lets you reset the score.
   ------------------------
   trivhelp   - Shows you this help.

Another Question File (http://www.blue-lagoon.dk/dl_engine/redirect.php?dlid=77&PHPSESSID=292fd73c891f5febfa5671581c695805)

Trivia Ex V.0.63 (http://www.blue-lagoon.dk/dl_engine/redirect.php?dlid=78&PHPSESSID=6b44398c1ce761d1901935e67763b730)
Title: hello
Post by: kbeh273300 on 22 January, 2004, 04:27:49
i just wanted to say VERY NICELY MADE BOT .


H??? ? K??g? hub owner and proud member of the Dream~Masters network
Title:
Post by: Event_Horizon on 22 January, 2004, 11:40:25
THX CHILLA will check out the new one :D
Title:
Post by: c h i l l a on 22 January, 2004, 12:41:44
thanks :)

NICE to hear you like it.

Once again, I would appreciate it, if you guys could post links to question files. To make it bigger, and bigger. :).  Since it is built for huge question files.
Title:
Post by: c h i l l a on 23 January, 2004, 11:50:42
some fixes and memory released :))


-- 21.1.04 : V0.64

1. Switched to only have a question file, no seek file anymore. Less memory. Question get time is around 0.3 seconds. But runs now between 100 and 150 kb mem with over 80.000  questions. :)).
2. Some rewriting in how PM players are handled.
3. HowToGetQuestions changes now only between random and linear mode.
4. Added a few questions to the Trivia Rar. To show how it should look like.


Trivia Ex V0.64 (http://mitglied.lycos.de/shashamane/p.scripts/)
Title:
Post by: Event_Horizon on 23 January, 2004, 14:36:14
nice runns smoth :D

maybe some more features soon ??
Title:
Post by: c h i l l a on 23 January, 2004, 14:52:08
i guess only..  a reload question func..

like +trivload file

file in the trivia folder...

but else

I already tahught about. Multiple answers, but then I have a problem with revealing the chars.
 so I'll leav it.

Maybe only some more player stats.
Any other ideas?
Title:
Post by: lazyj189 on 25 January, 2004, 05:40:47
noticing just a little problem with the trivia

example:
<-RasTriv-> QUESTION - Nr. 36096 from 93913 Questions.
   ----------------------------------------------------------------------
   > Category: Misc  -  Point(s):  2
   QUESTION: What Did Abebe Bikila Go Without In Winning The 1960 Oylmpic Marathon?
   HINT:  S@@@@
   ----------------------------------------------------------------------
<-RasTriv-> QUESTION - Nr. 36096 from 93913 Questions.
   ----------------------------------------------------------------------
   > Category: Misc  -  Point(s):  0
   QUESTION: What Did Abebe Bikila Go Without In Winning The 1960 Oylmpic Marathon?
   HINT:  Sho@@
   ----------------------------------------------------------------------
shoes
<-RasTriv-> Correct Misseymnm the answer was "Shoes", You get 0 Point(s).
<-RasTriv-> That gives you a total score of 2681 Point(s).


example2:
<-RasTriv-> QUESTION - Nr. 74550 from 93913 Questions.
   ----------------------------------------------------------------------
   > Category: Music : Album Title  -  Point(s):  4
   QUESTION: Dark Side Of The _____ (pink Floyd)
   HINT:  @@@@
   ----------------------------------------------------------------------
<-RasTriv-> QUESTION - Nr. 74550 from 93913 Questions.
   ----------------------------------------------------------------------
   > Category: Music : Album Title  -  Point(s):  2
   QUESTION: Dark Side Of The _____ (pink Floyd)
   HINT:  @@@@
   ----------------------------------------------------------------------
<-RasTriv-> QUESTION - Nr. 74550 from 93913 Questions.
   ----------------------------------------------------------------------
   > Category: Music : Album Title  -  Point(s):  0
   QUESTION: Dark Side Of The _____ (pink Floyd)
   HINT:  @@o@
   ----------------------------------------------------------------------
moon
<-RasTriv-> Correct Misseymnm the answer was "Moon", You get 0 Point(s).
<-RasTriv-> That gives you a total score of 2709 Point(s).

there was an example where if someone had answered the question correctly, it would ahve taken points away from their score.  any ideas?  I'm easy to get a hold of when not sleeping in.
Title:
Post by: lazyj189 on 25 January, 2004, 05:43:21
example 3
<-RasTriv-> That gives you a total score of 2761 Point(s).
<-RasTriv-> QUESTION - Nr. 45376 from 93913 Questions.
   ----------------------------------------------------------------------
   > Category: Misc  -  Point(s):  -1
   QUESTION: What Was The Title Of Loisa M Alcott's Sequal To Little Women
   HINT:  G@@d W@@e@
   ----------------------------------------------------------------------
<-RasTriv-> QUESTION - Nr. 45376 from 93913 Questions.
   ----------------------------------------------------------------------
   > Category: Misc  -  Point(s):  -3
   QUESTION: What Was The Title Of Loisa M Alcott's Sequal To Little Women
   HINT:  Good W@@e@
   ----------------------------------------------------------------------
<-RasTriv-> QUESTION - Nr. 45376 from 93913 Questions.
   ----------------------------------------------------------------------
   > Category: Misc  -  Point(s):  -5
   QUESTION: What Was The Title Of Loisa M Alcott's Sequal To Little Women
   HINT:  Good W@ves
   ----------------------------------------------------------------------
good wives
<-RasTriv-> Correct Misseymnm the answer was "Good Wives", You get -5 Point(s).
<-RasTriv-> That gives you a total score of 2756 Point(s).
Title:
Post by: c h i l l a on 25 January, 2004, 15:32:25
yep noticed that also.
whitch trivia do you use and
and if you use the latest
what setting do you have here?
TrivShowHint = 1 or 2?
Title:
Post by: c h i l l a on 28 January, 2004, 14:08:50
-- 28.1.04 : V0.641

1. Hopefully fixed revealing of chars.
2. Added User Stats :)). Like longest Streak and so on.
3. Also changed the trivmyscore, you'll see.

trivia ex 0.641 (http://mitglied.lycos.de/shashamane/p.scripts/)
Title:
Post by: pHaTTy on 28 January, 2004, 14:20:43
QuoteOriginally posted by c h i l l a
-- 28.1.04 : V0.641

1. Hopefully fixed revealing of chars.
2. Added User Stats :)). Like longest Streak and so on.
3. Also changed the trivmyscore, you'll see.

trivia ex 0.641 (http://mitglied.lycos.de/shashamane/p.scripts/)

well me slowing my projects down, and gonna enjoy messing with some other scripts too, does this come with questions?, gonna have a play on a decent trivia bot ;)

wow host is real slow, only got 100k sec of them :S or me having probs, anyone get faster?  ?(
Title:
Post by: pHaTTy on 28 January, 2004, 14:32:14
bro u need to remove the answers, they come up in main, some newbies will not know how to fix it ;)
Title:
Post by: c h i l l a on 28 January, 2004, 15:07:36
ops thanks, I did it to test the score thing, got bored to wait for a question I could answer..
lol.

-updated-
Title:
Post by: c h i l l a on 28 January, 2004, 15:13:09
100k or 100kb ??, I get 100kb, not too fast but okey.
Title:
Post by: c h i l l a on 31 January, 2004, 22:42:58
If I get it, then soon trivia ex will have multiply answers, but only one answer will be as hint.


-- 31.1.04 : V0.642

1. Changed the getting of category, question, answer.
2. Added option to only divide Question and Answer by dividechar.Check for "GetQuestionMode".
3. Added showing, of the answering time.
 !!!!  Important  redownload the questions, if you don't have own questions  !!!!


Trivia ex 0.642 (http://fdw.ath.cx/p.scripts/games/Trivia-Ex-V.0.642.rar)

80.000 Questions (http://www.blue-lagoon.dk/dl_engine/redirect.php?dlid=90&PHPSESSID=44aefb1317a44c3a8159b917d52f3d58)
Title:
Post by: c h i l l a on 01 February, 2004, 12:23:12
mulitple answers...

but only the first answer will be hinted.

-- 1.1.04 : V0.643

1. Added Mulitple Answers support. FORMAT: Category$Question$Answer1$Answer2$...$AnswerN
or FORMAT: Question$Answer1$Answer2$...$AnswerN but then you need to check the "GetQuestionMode".
$ is the default "DivideChar" and can be changed.
2. Added more question Exsamples to the *.rar.

trivia ex 0.643 (http://fdw.ath.cx/p.scripts/games/Trivia-Ex-V.0.643.rar)

Due to the different supporting files, trivia ex now supports, it would become a mess to add a function where you can add questions, so just write a *.txt file, or have your useres write one, its simpler and better I think.
Title:
Post by: c h i l l a on 03 February, 2004, 17:31:25
a little update

-- 3.2.04 : V0.644

1. Added option to stop the hints when being lower than Max10 hints to show. If you don't want it then just, Set it to 0.
2. Made it only possible to answer from where it is played, in PM only in PM in Main only from Main.
Title:
Post by: toras on 05 February, 2004, 20:07:45
Well isn't it great, I've only been runn?ng the Trivbot for a couple of hours and already I'm bugging y'all for a small request  :rolleyes:
Are there any Swedish questions to trivia ex out there somewhere?
(Was actually thinking of translating them myself, but 80.000, hmm, well I gave that up)

And while I'm at it, NO I don't want to change any of my scripts or bots or whatever ;)
I'm perfectly happy as it is, and I'd rather go with the english questionfiles than change anything else.

Chilla btw, you're the MAN :)
Title:
Post by: c h i l l a on 05 February, 2004, 20:19:44
wow thanks :)), nice to hear that, will light one up :).

And I made trivia ex, able to read other question files,
so if you have one, then I'll show you how to set it up :).
Title:
Post by: c h i l l a on 09 February, 2004, 15:46:30
Just a little update

-- 9.2.04 : V0.645
1. Added Option, to allow users to put bot in PM and MAIN, see AllowUser
2. Rewritten Timer a little.
3. Max4 stands now for the time in minutes till a triviabreak.
5. Added Option to split answers, when beeing longer than "SplitQuesChars", its just a layout thing.

trivia ex v0.645 (http://www.blue-lagoon.dk/dl_engine//files/Trivia-Ex-V.0.645.rar)
Title:
Post by: c h i l l a on 14 March, 2004, 13:13:30
adde some stats

te 0.647 (http://www.blue-lagoon.dk/dl_engine//files/Trivia-Ex-V.0.647.rar)

would still be great to get some links to new question files.
new links = more questions ;)
Title:
Post by: c h i l l a on 14 March, 2004, 21:05:00
little fix

http://www.blue-lagoon.dk/dl_engine//files/Trivia-Ex-V.0.648.rar (http://www.blue-lagoon.dk/dl_engine//files/Trivia-Ex-V.0.648.rar)
Title:
Post by: gazzer on 26 March, 2004, 18:08:58
hi chilla,
i have setup your new .648 bot and questions but now have multi answer questions that appear very confusing for ordinary peeps to understand or play?

also i dont quite understand the setting up of the bot as there is no config file  for an op to set it up via hub. only from the actual script itself.
can you help please.
Title:
Post by: chill on 26 March, 2004, 18:42:14
what don't you understand?

maybe you wanna share your questions, dunno would be cool.
Title:
Post by: gazzer on 26 March, 2004, 18:50:24
ok here goes.........

i have set it up as it was until i figure out what needs altering to make it smoother as in timers but all i keep getting is this...........

<-RasTriv-> Trivia is started.
[17:38] <-RasTriv-> QUESTION - Nr. 43424 from 82337 Questions.
   ----------------------------------------------------------------------
   > Category: Misc - Point(s): 51 - Total Answers: 3
   QUESTION:
   HINT:  @@@@@ @@@@@ @@ @@@@@@@@ @@@@ @@@@@ @@ @@@@ @@ @@@@@@@@@ @@@@@
   ----------------------------------------------------------------------
i cant sus where to alter it so it actually shows the question lol
and the questions are yours i am assuming, but i will of course when i get this thing established and working get all ops to start contributing some questions into a new file to share on the forum.
Title: Hallo!
Post by: Hades on 26 March, 2004, 19:03:37
Can some one make somekind of tool to convert old trivia questions :
 question*ansver
into new questions for rastriv:
 category$question$answer
....
I cant make ras trriv to read questions from old trivia i had.
Tried changin $ to * in lua file and chcanged to random and reag question answer....Doesn't work.

Why??
Title:
Post by: chill on 26 March, 2004, 19:58:00
I added some stuff now.

TE 0.649 (http://www.blue-lagoon.dk/dl_engine//files/Trivia-Ex-V.0.649.rar)

-- 26.3.04 : V0.649
1. BugFix with Reading normal Trivia Questions e.g. Question*answer1*Answer2
2. Added another way to display questions. (RevealQues)

so now Trivia Ex will read normal question files for sure

some things to set up.

DivideChar = "*"  this is the char whitch divides Question from Answer , and more answers following, usually $, for Trivia Ex files.
Forgot to change it in this release so you need to edit it if you wanna use the normal trivia ex question files.

GetQuestionMode = 1 , set this to 2, if you use normal questionfiles, e.g Question*Answer...

plus check the question exsample files, if one of your question files has the format of any of these files, it should be able to be read by trivia ex.
Title:
Post by: chill on 26 March, 2004, 20:29:40
I fixed it now, the DiviedChar thing whitch I forgot, and another thing, now its done, link is above
Title:
Post by: gazzer on 26 March, 2004, 20:39:39
still cant get it working chilla have no questions at all now, showing in hub.

<-----BANGS HEAD SEVERLY AGAINST HUB WALL

i'm having a bad day i think (again)
Title:
Post by: gazzer on 26 March, 2004, 20:41:21
appologies chill keep adding an a on ya nik

SAID IT WAS BAD DAY



bangs head on other wall now------------------------------>
Title: hmmm
Post by: Hades on 26 March, 2004, 20:59:46
Still can't get it to work..
Besides what to change in script to have odl trivia scores inthere?
Title:
Post by: gazzer on 26 March, 2004, 21:05:15
ive gone back to older version .641 and running ok except the original probs it had lol
but atleast it is running.......


GUINNESS TIME me thinks
Title: I forgot to say
Post by: Hades on 26 March, 2004, 21:11:55
Very nice bot!!!
.........
Still having a little issues but as i can see chill is working hard releasing new fixes and options ant that's what keeps this project really cool!!
.........
Keep up the great Job!
Title:
Post by: gazzer on 26 March, 2004, 21:14:58
sorry chill..................

i did not mean to sound ungrateful over the triv bot, bin a long week at work.
it is a good bot best ive seen on ptokax so far, deffinately keep up the good work.
Title:
Post by: gazzer on 27 March, 2004, 09:15:16
morning folks.......
can someone tell me what i am doing wrong here please?

RevealChar = "*"         -- The revealchar: 149,164,1

QFile = "TriviaEx.Questions-1.txt"   -- The name of the Questionfile Questiondefaultformat = category$$questions$$answer)

TrivFolder = "TRIVIA"         -- The name of the Folder, for the Questionfile.
DivideChar = "@"         -- The Divied Char whitch divides the Category,Questions and Answer, (Only one character)
GetQuestionMode = 1         -- 1 = Gets "Category,Question,Answer", 2 = Only Gets "Question,Answer"
HowToGetQuestions = 1         -- Questions Mode 1 = Random, 2 = Sequential (e.g. 1,2,3)
RevealQues = 1            -- 1 = Random displaying of hints, 2 = Displays the first letters of the hint first (Grands Trivia).
--------------------------------------------
and in hub i get this........
[08:11] <-RasTriv-> The right answer was:  
[08:11] <-RasTriv-> Other answers were: ___ By Me, , Stand.
[08:11] <-RasTriv-> QUESTION - Nr. 153 from 82337 Questions.
   ----------------------------------------------------------------------
   > Point(s): 0 - Total Answers: 4
   QUESTION: 80s Films
   HINT:  
   ----------------------------------------------------------------------
[08:11] <-RasTriv-> The right answer was:  
[08:11] <-RasTriv-> Other answers were: ___ Shop of Horrors, , Little.
[08:11] <-RasTriv-> QUESTION - Nr. 154 from 82337 Questions.
   ----------------------------------------------------------------------
   > Point(s): 0 - Total Answers: 4
   QUESTION: 80s Films
   HINT:  

nothing appears to be correct on reading questions pack!!!
has to be the way i have it set and the question pack i am using is (TriviaEx.Questions-1) with this (TriviaEx.Questions-1-seek)
so it must be me i am assuming. but it is pointing at correct pack of question names but maybe wrong question pack?

anyone help me on this problem please :(
Title: ok i'm a twat............
Post by: gazzer on 27 March, 2004, 10:19:19
bots working fine on question packs supplied with it.

format that is supplied is...............

ReggaeTrivia$album & arstist: Live at Maritime Hall$twinkle brothers
........................................
format of question pack i have is..........

1980s GrabBag$$The last team Tom Seaver tried to pitch for$$new york mets

so can script be altered to take this second format of questions please as 8+ thou questions is a lot to alter lol
Title:
Post by: chill on 27 March, 2004, 12:39:02
thx guys :),
If you have any good ideas, about how to show the hints, or anything else, then just post it, I usually always add new options :),

and grazzer,  use these questions, they are a bit better edited. well as good as one can edit, 80.000 questions

Q 80.000 (http://www.blue-lagoon.dk/dl_engine//files/TriviaEx.Questions.1.rar)

and if you use these questions, then you needn't need to change anything in the script.

if you use this one

Trivia Ex 0.649 (http://www.blue-lagoon.dk/dl_engine//files/Trivia-Ex-V.0.649.rar)

and Haddes, just post your probs issues, and we'll get em' fixed.
Title: question pack
Post by: gazzer on 27 March, 2004, 13:28:09
chill....................
you are a damm saint m8ee, ty for q-pack1 saved me loads of typing lol
can bugger off and watch the rugby now.

GUINNESS time folks

GO ON ENGLAND
Title:
Post by: [SLUT]W??FY on 27 March, 2004, 14:03:17
never mind go on england gaz ,,  

GO GUINNESS GO GO GO  GO GO :D
Title:
Post by: gazzer on 28 March, 2004, 18:55:03
woofers ya sluttttttttttttttttttttttttttt.
i done the GUINNESS m8 from 1.30 pm right uptil 9.45pm
and england did go lol............

home empty handed useless wazzuks
Title: triv bot
Post by: gazzer on 30 March, 2004, 23:48:45
hi folks.............

would like to explain our man chill to a few peeps here.
i'm fairly new to ptokax and lua as are many others but know what i want.
and mr chill, has bin in memo after memo to help me on my needs.
so thanks chill, you are why this forum and its masters of lua are  the best to me.
regards gazzer :)




gazzernpeachy.no-ip.org

UK HUB RUN BY UK PEEPS FOR ALL OF DC
Title:
Post by: chill on 31 March, 2004, 00:15:09
thanks a lot :), hope I can keep it up and no prob at all.
Title:
Post by: Mort on 09 May, 2004, 15:04:19
Getting page cannot be displayed when trying to download trive ex 0649

anywhere else i can download from?

cheers

Mort
Title: About Trivia ex :)
Post by: toras on 13 May, 2004, 21:07:40
Hi Chilla,
i've been running the trivia ex-bot in my hub for three or four months now, and i haven't had any problems at all with it since start :D
Great work man!
Hugs toras.
Title:
Post by: chill on 15 May, 2004, 12:22:48
Mort will paste a link soon, when I have rewritten some parts of the script,

toras, good to hear that it is running so well, :).

I am thinking of new methods to display the answeres, anybody got any ideas?
Title:
Post by: chill on 23 May, 2004, 12:06:46
Trivia Ex 0.65

 <-RasTriv-> -- Trivia Ex V.0.65 by chill --

Prefixes: ! + -

trivscore   - Shows the top 100 scorers.
trivmyscore   - Shows your score.
trivstats   - Shows the top 10 player stats.
trivplayers   - Shows you the Trivia Players.
trivskip   - Lets you skipp the current question.
trivhint   - Gives you a hint.
------------------------
login   - Lets you login.
logout   - Logs you out.
------------------------
trivstart  - Start the Trivia.
trivstop   - Stop the Trivia.
triviaskip   - Enables/Disables TriviaSkip.
triviahint   - Enables/Disables TrivHint.
triviaquestion QuesNr.   - Starts with QuesNr.
trivmain   - Plays Trivia in Main Chat.
trivpm   - Plays Trivia in PM to the bot.
------------------------
trivscorereset   - Lets you reset the score.
------------------------
trivhelp   - Shows you this help.


[12:03] <-RasTriv-> QUESTION - Nr. 56789 from 134743 Questions.
----------------------------------------------------------------------
> Category: Capital cities - Point(s): 4 - Total Answers: 1
QUESTION: What is the capital of Peru
HINT:  @@@@
----------------------------------------------------------------------
[12:03] lima
[12:03] <-RasTriv-> Correct chillo the answer was "lima", You get 4 Point(s). Answer solved in 3.64 sec.
[12:03] <-RasTriv-> chillo's Stats, Score: 14 Point(s), Answerd Questions: 3, Average Answering Time: 4.75 sec.

Trivia Ex 0.65 (http://www.bbfree.com/cannaforum/index.php?act=Attach&type=post&id=995)
Title:
Post by: night_hawk on 29 September, 2004, 05:07:54
having trouble with both your Trivia-Ex-V.0.65 and Trivia-Ex-V.0.645....for Trivia-Ex-V.0.645 scores do not log in right way takes a very long time can you look into this thank you...aand for Ex-V.0.645 i added the extra questions and it repeats itself and will not run the queastion ramdum...But it does it in order such is 1,2,3 and so on...and the question repeat them selfs and when i restart my hub trivia start off bye number one  again....can you please look into this please and get back to me i like this script very much thank you....
Title:
Post by: chill on 01 October, 2004, 13:09:36
yepp I'll take a look and see what the mistake is, I'll also try to add some other stuff, i saw someone else wanted, here and on the other forum, like auto stop when nobody is playing and autostart when anybody wants to play.

so laterz
Title:
Post by: night_hawk on 01 October, 2004, 13:26:48
thank you and check out you extra questions some repeat them selves...let me know when it new one is ready i really like the trivia games you make thank you...
Title:
Post by: gazzer on 24 October, 2004, 16:31:25
hi chill
lost my triv bot on a major pc failure and got the new .65 script but now have no questions pack bud.
any chance of sorting out somewhere i can grab em please m8ee.
Title:
Post by: chill on 24 October, 2004, 17:47:29
sure I will see what I can do, due to my poor bandwidth I can't host it myself :(, Telekom suckssssssss.
Title:
Post by: gazzer on 24 October, 2004, 17:57:11
hi chill could ya zip it up and mail it to me please m8ee.
gazzer1@blueyonder.co.uk
then i'll post in here with it attached so all can grab it if needed
Title:
Post by: chill on 29 October, 2004, 19:32:27
thx to Hawk who hosts the file,
you can download like 100.000 questions in english
for trivia

once more this file is quite big I think, and it only grew because there were people working TOGETHER,
so if you have any new questions, just send a PM,
or post the link where to find them :)

http://www.hawks-world.com/chill/TriviaEx.Questions-1.rar
Title:
Post by: _Satan_ on 07 November, 2004, 11:18:57
how can the time interval between two consecutive question be reduced
Title:
Post by: chill on 07 November, 2004, 17:00:51
with the new version here (http://lua.uknnet.com/attachment.php?attachmentid=67&sid=70ea8621e0bde666cac373e035bad520)

you can set it in the *.lua file by editing this variable

TrivEx._Sets.showques = 15

15 is the number in seconds

in the old version it was

TrivEx.Sets.showques = 15

they are somewhere at the beginning of the file
Title:
Post by: _Satan_ on 24 November, 2004, 07:38:52
I have problems in changing the questions from random mode to sequential  mode i have this line

TrivEx._Sets.showquesmode = 2               -- Questions Mode 1 = Random, 2 = Sequential (e.g. 1,2,3)

but it doesnot seems to work . add a command for that.
Title:
Post by: chill on 25 November, 2004, 20:55:16
QuoteAdd a command for that.

Hmm.. I think that is a order so to make it correct you have to do

Add a command for that!

If my grammar is right,
so just you know how to consult people next time.

But it works here. So I will check it out.
Title:
Post by: chill on 25 November, 2004, 21:45:39
Well I also think the command comes in quite handy,
so no offence but , Could you add..., is defetly the
better way to ask.

Ahm delete your old config file before installing the new version.

V 0.68 (http://lua.uknnet.com/attachment.php?attachmentid=75&sid=37ff0c2c735f4f799fc587e5af55482d)
Title:
Post by: Odin on 26 November, 2004, 14:31:05
Syntax error: `=' expected;
  last token read: `function' at line 20 in file `F:\PtokaX\scripts\Trivia-Ex-V.0.68.lua'

What did I o wrong?
Title:
Post by: chill on 26 November, 2004, 15:05:43
I don't know, if you did something wrong or me, but I'll
check it out, till then you could try a clean install, maybe back up your old settings and scores, and just install
the script from the package, and hope the error is gone.
Title:
Post by: night_hawk on 26 November, 2004, 17:07:32
what are the profile for.
\and i can not get the commands to work

what are they and if it is controld bye the prifiles can you add mine that i use in my hub please here they are

0|Master|11111111111111111111000000000000
1|Operator|11111100011101111100000000000000
2|VIP|10000000000000000000000000000000
3|Reg|10000000000000000000000000000000
4|Moderator|11111110011101111111000000000000
5|NetFounder|11111111111111111111000000000000
Title:
Post by: chill on 26 November, 2004, 18:06:19
Odin I am sorry, but I couldn't recall the error,
could you tell me when the error occured, here,
it would have happened when the function OnExit()
is called.
Does anybody else usning this script have the same error?


night_hawk here is a exsample,

TrivEx._Profiles = {}

TrivEx._Profiles.Normal = {
[0] = "Master",
[1] = "Operator",
[2] = "VIP",
[3] = "Reg",
[-1] = "Noobs",
}

TrivEx._Profiles.Config = {
[0] = "Master",
[1] = "Operator",
[2] = "VIP",
[3] = "Reg",
}

TrivEx._Profiles["Config+"] = {
[0] = "Master",
[1] = "Operator",
}

now if you want all your profiles to be allowed to use all commands

you would have to do this

TrivEx._Profiles = {}

TrivEx._Profiles.Normal = {
[0] = "Master",
[1] = "Operator",
[2] = "VIP",
[3] = "Reg",
[4] = "Mod",
[5] = "NetFound",
[-1] = "Noobs",
}

TrivEx._Profiles.Config = {
[0] = "Master",
[1] = "Operator",
[2] = "VIP",
[3] = "Reg",
[4] = "Mod",
[5] = "NetFound",
}

TrivEx._Profiles["Config+"] = {
[0] = "Master",
[1] = "Operator",
[2] = "VIP",
[3] = "Reg",
[4] = "Mod",
[5] = "NetFound",
}

as you can see the name is actually not important, but
the Profileindex is.
I can almost assure you to 99% that it works. And you
should get results when typing, +trivhelp
Unless I coded some weird things again that only work
in my hub
Title:
Post by: night_hawk on 26 November, 2004, 18:14:33
i only want ops mod netfounder and masters to be able to change trivia settings how do i set it up for that..
Title:
Post by: night_hawk on 26 November, 2004, 18:43:42
one more they my users told me it doesnot show there scores adding up when they answer a question and there seed to here is and example from the lold on eif you can get it to do this in the new one it would be great

  Correct dildi the answer was "isis", You get 3 Point(s). Answer solved in 39.09 sec.
[12:40] dildi's Stats, Score: 7 Point(s), Answerd Questions: 2, Average Answering Time: 63.58 sec.

shows usewr got 3 poits then total score 7 than average time

in the new one it dose not do this can you set t up to do that again thank you..
Title:
Post by: Odin on 26 November, 2004, 20:13:31
QuoteOriginally posted by chill
Odin I am sorry, but I couldn't recall the error,
could you tell me when the error occured, here,
it would have happened when the function OnExit()
is called.
Does anybody else usning this script have the same error?

My fault, wordwrap in notepad :/. I've even done that before :D
Title:
Post by: _Satan_ on 27 November, 2004, 04:57:11
QuoteCould you add..., is defetly the the better way to ask

Thanx chill, for replying my both questions . I am sorry if i hurt ur ego.  In fact I was getting erroneous results. It was fine when i configured it in editplus(editor) .This is a great game scriptand best trivia .and the question file of 134744 question is too much to ask about.
Title:
Post by: chill on 27 November, 2004, 12:50:26
hey _Satan_ its okey and forgotten, hope you can still
make use of the command lol.

Odin you also managed to set it up :).

night_hawk to get the full detailed stuff, do this

TrivEx._Sets.showcorrectanswer = 1

and your profiles should look like this

TrivEx._Profiles.Normal = {
[0] = "Master",
[1] = "Operator",
[2] = "VIP",
[3] = "Reg",
[4] = "Mod",
[5] = "Net",
[-1] = "Noobs",
}

TrivEx._Profiles.Config = {
[0] = "Master",
[1] = "Operator",
[4] = "Mod",
[5] = "Net",
}

TrivEx._Profiles["Config+"] = {
[0] = "Master",
[1] = "Operator",
[4] = "Mod",
[5] = "Net",
}

Hawk also put up another questionfile for me,
it is smaller but has less doubles, and no Movie
and Year questions.
80.000 Questions (http://www.hawks-world.com/chill/TriviaEx.Questions.80k.rar)

Other thing is does anybody know, if there are any
convetions about the questions file, I know usually
they are devided by *, but do they also divide by
category by *  or maybe by : ?,
Just the $ sign was from early trivia, when I thaught
we would need 2 $$ to identify Question and Answer
Title:
Post by: VidFamne on 12 December, 2004, 22:02:08
I got a runtime error so I change the line; 399 to this;
self:SendToPlayers(curUser.sName.."'s Stats, Score: "..self._Scores[curUser.sName].Score.." Point(s), Answerd Questions: "..self._Scores[curUser.sName].AvTime[2]..", Average Answering Time: "..format("%.2f",self._Scores[curUser.sName].AvTime[3]).." sec.")Dont know if its correctly done by me, but the script runs very well.
Nice work chill. :)
Title:
Post by: chill on 13 December, 2004, 20:15:12
Thx Vidfamme :)

The code looks good, so I'd say everybody should
change it to that line...
Title:
Post by: MusicMan? on 10 March, 2005, 19:15:42
Hi Chill,

I've tried converting your script to LUA 5.2 to use with the new PtokaX hub version 0.3.3.0 build 16.05.

however m8 when i go into the script editor to check the script i get this error.

Syntax [string "-- Trivia Ex V 0.68 by chill..."]:20: `=' expected near `function'

I know that error has been reported before m8, but i think it was with LUA 4 hub.

Any help would be much appreciated.

Thanx

MusicMan?  :D  :D  :D
Title: Syntax Error
Post by: MichaelD on 28 March, 2005, 03:06:59
Hi

I've just installed this on a new hub running Ptokax 0.3.3.0 build 16.06

When I start it up, I get the following error:

Syntax C:\Program Files\Hub\scripts\Trivia-Ex-V.0.68.lua:294: unexpected symbol near `%'

Line 294 is %self._PMPlayers[nick] = nil

Anyone know how to fix this please?

Michael  :))
Title:
Post by: Psycho_Chihuahua on 28 March, 2005, 03:42:46
try this one, works fine on freshly installed 16.08 so should work on yours to

Trivia-Ex-V.0.68.lua5.lua.zip (http://ptokax.psycho-chihuahua.net//Lua%205%20Scripts/Trivia-Ex-V.0.68.lua5.lua.zip)
Title: chill
Post by: night_hawk on 13 April, 2005, 06:12:10
can you change over your Trivia-Ex-V.0.66 over to lua for me i can send you the script if you give me your email addy thank you...or any one
Title:
Post by: jiten on 13 April, 2005, 12:34:54
QuoteOriginally posted by night_hawk
can you change over your Trivia-Ex-V.0.66 over to lua for me i can send you the script if you give me your email addy thank you...or any one

Check this (http://board.univ-angers.fr/thread.php?threadid=3927&boardid=26&sid=ec280e58367fd55b04d9dfb03337fb3f&page=2) thread.

Best regards,

jiten
Title:
Post by: night_hawk on 13 April, 2005, 17:34:48
that is not what i want...i want the verion i use chaged over...My user like it and do not like the new verion at all....
Title:
Post by: jiten on 13 April, 2005, 17:43:54
QuoteOriginally posted by night_hawk
that is not what i want...i want the verion i use chaged over...My user like it and do not like the new verion at all....

If u had more attention u would have seen that I posted the link to Trivia Ex v0.65 (Lua 5) in that thread.
Title:
Post by: night_hawk on 13 April, 2005, 17:55:34
i did see that i need the Ex-V.0.66 not the Ex-V.0.65

i tried the Ex-V.0.65 verion and it does not show the scores or the winning streaks at all..
Title:
Post by: gazzer on 13 April, 2005, 18:13:18
night_hawk the new trivbot has options to show or not show streaks m8ee, and will auto take the question pack from old lua4 script  ver .68.
if ya want i'll mail it ya gazzer1@blueyonder.co.uk
Title:
Post by: jiten on 13 April, 2005, 18:32:53
QuoteOriginally posted by night_hawk
i did see that i need the Ex-V.0.66 not the Ex-V.0.65

i tried the Ex-V.0.65 verion and it does not show the scores or the winning streaks at all..

Fixed those bugs. Grab it here (http://mznetwork.mozdesigners.com/i/forum_files/Trivia-Ex-V.0.65.lua5.lua).

Cheers
Title: Trivia Ex V 0.68a problem
Post by: culivert on 18 September, 2005, 20:50:57
hi ,i m using Trivia Ex V 0.68a by chill,for my hub.i m encountering following problem. whenever trivia bot ask a particular question(question no.420) it sticks there.it keep asking the same question again and again.the only soln is to restart the script.after restarting it works fine for a while then again problem comes.plz help