Another triviabot :)
Not sure if anyones done this one, cant see it anywhere so here goes..
TriviaBot v.2.2 Lua5 (http://www.wooshman.ath.cx/downloads/TriviaBot%20V.2.2.Lua5.zip)
Nice as usual Jelf.Seculite next?? hehehe :D
Raflmao
Now I know your joking , right???
Hehehe
You know your dying to do it :D
Can u please help me with this script X( no matter wot i do as soon as i reboot theres no scores!! they dissapear any ideas?
you have to manually save the scores by typing " tbsavescores "
and after reboot load the scores by typing " tbloadscores "
hope it helps
Does anybody has a right click menu for trivia that or an inproved zrightclick menu with trivia????????
[10:46:42] <[BOT]?Adrenaline?>
Top 0 Trivia scores in this hub
Pos Score Nick
[10:46:42] <[AD]maksalaatikko> topten
[10:46:45] <[BOT]?Adrenaline?> [AD]maksalaatikko you have 14023 points!
It doesn't work
Yip ur right still doesnt work..no matter if i do savescores :( as soon as i reboot the scores are either overwritten or are deleted... ?(
QuoteOriginally posted by Jelf
Another triviabot :)
Not sure if anyones done this one, cant see it anywhere so here goes..
nice script but some one help me to modify
elseif (string.lower(firstWord) == string.lower(RestartTrigg)) then
if (curUser.bOperator) then
SendToPlayers("TriviaBot restarted. All points etc are lost!")
SendToPlayers("If Save is used now it will overwrite the old save!")
pointArray = {}
StopQuiz(1)
end
operator to not restart trivia, and lose the point.
just master may to use
Try this one:
elseif (string.lower(firstWord) == string.lower(RestartTrigg)) then
if (curUser.iProfile == 0) then
SendToPlayers("TriviaBot restarted. All points etc are lost!")
SendToPlayers("If Save is used now it will overwrite the old save!")
pointArray = {}
StopQuiz(1)
end
Cheers
10x a lot
yw
another little problem :D ,
trivia work just fine , but when stop and start the hub server , dont save the score , and when i start`it it dont load score automaticaly
sopose to hapen a reboot of the pc ,and i am not on computer , i lose the score ;(
How can I remove the join/Part function, I want everyone to automaticly join it without having to type any commands etc
cheers//Dj_OcTaGoN
another bummer - once I reload the scores topten function still shows 0 scores but show scores shows all the users and scores....
weird -
can we please work on this autosave / load as this is a little frustrating when the hub restarts and you need to dickabout with the trivia before anyone logs into it ;)
regards
I agree, loadscore does load the score but doesn't show them in Top Ten
cheers//XposEx
is there a way of autoloading these scores as its beginnign to get right on ones nerves now :) hehe
please please please help
regards
QuoteOriginally posted by Dj_OcTaGoN
How can I remove the join/Part function, I want everyone to automaticly join it without having to type any commands etc
cheers//Dj_OcTaGoN
edit this bit here
-- Should the bot auto login every user on connect ?
boolAutoLogin = 1 -- (nil = off, 1 = on)
yeah i have already changed that, but as I have understood, it means every user who connects to the hub will automaticly join, so if someone starts the Trivia and there are users in the hub already that means they whont auto join...or have I missunderstood?
cheers//Dj_OcTaGoN
QuoteOriginally posted by Dj_OcTaGoN
yeah i have already changed that, but as I have understood, it means every user who connects to the hub will automaticly join, so if someone starts the Trivia and there are users in the hub already that means they whont auto join...or have I missunderstood?
cheers//Dj_OcTaGoN
NOT TESTED, but I think its right...
Taking a brief look at it - the bit that sends all the info to the players is the func SendToPlayers (below)
I guess if you are playin in main chat then this should already be set up...
set the other responses to the Send PM if playing in PM
function SendToPlayers(msg)
if ((lngMode > 2) or (lngMode < 0)) then
lngMode = lngDefMode
end
if (lngMode == 0) then
SendToAll(BotName, msg)
elseif (lngMode == 1) then
for index, value in playerArray do
SendToNick(index, "<"..BotName.."> "..msg)
end
elseif (lngMode == 2) then
for index, value in playerArray do
SendPmToNick(index, BotName, msg)
end
end
end
a little modification , solve problem whit score load at hub start and restart
download from [URL=http://www.dragossto.3x.ro/Trivia.doc]here[/URL]
it not a doc , it a rar file
i test the script , but never know when a bug appear
QuoteOriginally posted by Dj_OcTaGoN
yeah i have already changed that, but as I have understood, it means every user who connects to the hub will automaticly join, so if someone starts the Trivia and there are users in the hub already that means they whont auto join...or have I missunderstood?
cheers//Dj_OcTaGoN
If the hub had users (that didn't join the game) before the restarting the scripts with the boolAutoLogin = 1 change, the ones that didn't reconnect wouldn't be able to play without logging in.
Cheers
hmm some ideea , it not a specific function ho make .. something after script restart .
i thing one way to do this it when user connect
to make a for or while ho check other4 users online
it a player or not
other ideea i dont have
Nice script :)
But i got a question;
I'm scripting for mIRC and im totally n00b with DC++ scripting. But i made a trivia for mIRC a few years ago but its another system. I got 2 files, ?ne with questions and ?ne with answers. Is it possible to change this Trivia script so it can read from that 2 files? Without description, just a question file and a answer file.
Thanks in advance
Ps; Sorry for my bad English, i'm Dutch.
it possible but i think it a little to hard because u fave to
synchronize answer whit question or to read from same line from both file.
So i thing it little easy to put them in one file
Thanks for the answer.
But i got questions.txt with 7991 questions and answers.txt with 7991 answers. I got the tool EditPlus 2 but how can i make from this 2 txt's one txt?
Thanks in advance.
the syntax for the file should be something like this:
QuoteFinish The Song Line: And she's buying a stairway _ _*to heaven
this is the question:
Finish The Song Line: And she's buying a stairway _ _
and this is the answer:
*to heaven
ps.: the answer always comes after the "*",
Good Luck !
heres a script that should help, but theres 1 thing the lines must be exact in both cases.
eg: (file 1, line 1)what programming language are we using?
(file2,line1) lua !!!.
the script :
--By Dessamator
--Simple file(lines) "joiner"
file1 ="file1.txt" -- first file
file2 ="file2.txt" -- second file
file3 ="file3.txt" -- output file
function Main()
local line1,temp,i="","",nil
for line in io.lines(file1) do
if i~= nil then
temp=temp..line.." *"..line1.."\r\n"
end
for line2 in io.lines(file2) do
if i==nil then
temp=temp..line.." *"..line2.."\r\n"
i="1"
else
line1=line2
end
end
end
i=nil
io.output(file3)
io.output()
local file = io.open(file3, "w+") -- "w" write
file:write(temp)
file:close()
end
Nevermind. I changed everything to one file :)
what i'm doing wrong if i change some things..
i put now in trivia.dat this...
breinkraker: 97 - 90 =---------- *7
breinkraker: 31 - 30 =---------- *1
breinkraker: 99 - 90 =---------- *9
breinkraker: 27 - 20 =---------- *7
breinkraker: 13 - 10 =---------- *3
breinkraker: 44 - 40 =---------- *4
and more of this
but its not working X(
if i put the anwser in the main chat.. is nothing happend.
?( ?( ?(
no errors if i start the script
o syntax errors in script file Trivia.Lua5.lua
Script started.
what must i do to make it working?
Very strange. Your .Dat file is looking good...
But i got a questions;
What do i need to change so normal users can start the Trivia also?
Please can you help - I have made a couple of ammendments to this script to include the autoload at start - a skip function and changed the way the points work a little... problem is - since Lua 5.
If I run this for more than 10 mins it makes my PtokaX run at 100% cpu and kills the hub...
here is the code - can you test it with my question file too
CODE (http://rpgbooks-cymru.no-ip.org/trivia.txt)
Question File (http://rpgbooks-cymru.no-ip.org/question2.txt)
Many thanks in Advance
Also in reply to make anyone start trivia try changing
elseif (string.lower(firstWord) == string.lower(StartTrigg)) then
if (curUser.bOperator) then
if (lngWord == 0) then
playerArray[curUser.sName] = 1
SendToAll(BotName, strStart)
if (lngMode == 2) then
SendToPlayers(strStart)
end
StopQuiz(1)
else
SendToAll(BotName, "There is already a game going on type "..JoinTrigg.." to join!")
end
else
curUser:SendPM(BotName, "Only Operators can start the Trivia because it might be off for a reason.")
end
to
elseif (string.lower(firstWord) == string.lower(StartTrigg)) then
if (lngWord == 0) then
playerArray[curUser.sName] = 1
SendToAll(BotName, strStart)
if (lngMode == 2) then
SendToPlayers(strStart)
end
StopQuiz(1)
else
SendToAll(BotName, "There is already a game going on type "..JoinTrigg.." to join!")
end
I dont know ..
meaby you can try this...
-- TriggStart is what char the commands should begin with I use ! but you can use # or whatever
TriggStart = "+"
now you can start the game with +tbstart
but i dont know of a normal user can start the game with this command :)
nothing to do with what character prefix you use....
its the line if (curUser.bOperator) then
that ask if current user is an operator then let them
see my previous post above !!!
QuoteOriginally posted by Stravides
nothing to do with what character prefix you use....
its the line if (curUser.bOperator) then
that ask if current user is an operator then let them
see my previous post above !!!
It works perfect! Can you do the same with tbstop? Thanks!
well maybe ya coulda worked it out ....
change 1st to 2nd.....
elseif (string.lower(firstWord) == string.lower(StopTrigg)) then
if (curUser.bOperator) then
HoldQuiz()
StopQuiz()
SendToAll(BotName, strStopp)
if (lngMode == 2) then
SendToPlayers(strStopp)
end
end
elseif (string.lower(firstWord) == string.lower(StopTrigg)) then
HoldQuiz()
StopQuiz()
SendToAll(BotName, strStopp)
if (lngMode == 2) then
SendToPlayers(strStopp)
end
Please can you help - I have made a couple of ammendments to this script to include the autoload at start - a skip function and changed the way the points work a little... problem is - since Lua 5.
If I run this for more than 10 mins it makes my PtokaX run at 100% cpu and kills the hub...
here is the code - can you test it with my question file too
CODE (http://rpgbooks-cymru.no-ip.org/trivia.txt)
Question File (http://rpgbooks-cymru.no-ip.org/question.txt)
Many thanks in Advance
can u add right click cmds for the trivia bot 2.2
maybe something along these lines ... make sure the commands at the end match the triggers used in the main code
function Trivia(user)
user:SendData("$UserCommand 255 7")
user:SendData("$UserCommand 0 3")
user:SendData("$UserCommand 1 3 *** "..frmHub:GetHubName().." Trivia ***$<%[mynick]>#124;")
user:SendData("$UserCommand 1 3 Admin\\Trivia\\Start Trivia$<%[mynick]> !trivia|")
user:SendData("$UserCommand 1 3 Admin\\Trivia\\Stop Trivia$<%[mynick]> !tbstop|")
user:SendData("$UserCommand 1 3 Trivia\\Join Trivia$<%[mynick]> !tbjoin|")
user:SendData("$UserCommand 1 3 Trivia\\Leave Trivia$<%[mynick]> !tbpart|")
user:SendData("$UserCommand 1 3 Admin\\Trivia\\Save Scores$<%[mynick]> !tbsave|")
user:SendData("$UserCommand 1 3 Trivia\\Show Players$<%[mynick]> !tbwho|")
user:SendData("$UserCommand 1 3 Trivia\\Show Top Ten$<%[mynick]> !topten|")
user:SendData("$UserCommand 1 3 Trivia\\Show Question$<%[mynick]> !tbquestion|")
user:SendData("$UserCommand 1 3 Trivia\\Hint Question$<%[mynick]> !hint|")
user:SendData("$UserCommand 1 3 Trivia\\Skip Question$<%[mynick]> !skip|")
end
function NewUserConnected(user)
Trivia(user)
end
Please can you help - I have made a couple of ammendments to this script to include the autoload at start - a skip function and changed the way the points work a little... problem is - since Lua 5.
If I run this for more than 10 mins it makes my PtokaX run at 100% cpu and kills the hub...
here is the code - CODE (http://rpgbooks-cymru.no-ip.org/trivia.txt)
Question File (http://rpgbooks-cymru.no-ip.org/question.txt)
I'm having so many problems running this script I am unsure where I can look for the fault - at least someone give me some ideas how to possibly trap the error :)
many thanks - Stravides
QuoteOriginally posted by Stravides
Please can you help - I have made a couple of ammendments to this script to include the autoload at start - a skip function and changed the way the points work a little... problem is - since Lua 5.
If I run this for more than 10 mins it makes my PtokaX run at 100% cpu and kills the hub...
here is the code - CODE (http://rpgbooks-cymru.no-ip.org/trivia.txt)
Question File (http://rpgbooks-cymru.no-ip.org/question.txt)
I'm having so many problems running this script I am unsure where I can look for the fault - at least someone give me some ideas how to possibly trap the error :)
many thanks - Stravides
Hi there m8.
Had a quick look, did some small changes and tested it for 15 minutes and seems to work OK now.
Wherever you find:
handle = io.open(file, "w")
replace it with
handle = io.open(file, "w+")
As you can see, an extra "+".
Guess that's the only problem.
Ah, another hint, you could use these for less repetition:
OpConnected = NewUserConnected
OpDisconnected = UserDisconnected
ToArrival = ChatArrival
Cheers m8
greatly appreciated - will test it now...
Well - sadly --- No hung the Ptokax Server process
at 99.99% ie nothing was processing - dont know why the cpu is being churned so much - any ideas ??
QuoteOriginally posted by Stravides
greatly appreciated - will test it now...
Well - sadly --- No hung the Ptokax Server process
at 99.99% ie nothing was processing - dont know why the cpu is being churned so much - any ideas ??
Tried running it again and it also hung up. So, my hints were wrong :(
Did you change something in the script?
Did this happen with the first Lua 5 version of the bot?
very minor changes -
added a skip function and renamed some of the triggers.
changed the point values to reflect 4 hints ie 5,4,3,2,1 points
and changed the way the result is displayed to the user...
:)
apart from that no ;) hehe
QuoteOriginally posted by Stravides
very minor changes -
added a skip function and renamed some of the triggers.
changed the point values to reflect 4 hints ie 5,4,3,2,1 points
and changed the way the result is displayed to the user...
:)
apart from that no ;) hehe
Well, I left the first Lua 5 version by Jelf running till now (about 45 minutes) and it didn't crash, but, the memory usage is quite high (Mem: 2710 and GC: 4981) comparing to Trivia Ex. So, it can be something in the mods you made.
Ok I have re-enabled the original and had it working solo on a test hub for nearly an hour
I place the exact code into the live hub and it kills the hub in minutes...
I am running my own smeagol bot also and believe that there must be an incompatability or its jsut down to the number of users on the server
I dunno...
but now tried :-
empty hub with just triv running - OK
empty hub with triv & Smeagol running - OK
Full hub with just triv running - Crash
Full hub with triv & Smeagol running - Crash
so it must be the send to's that are killing the bandwidth surely ??? any ideas
Can someone give me the trivia that works perfect???
save lad everything automatically...
Please....
how do i start this script?
it says ""tbstart but nothing happens
i already changed TriggStart = "" to TriggStart = ! but then i get unexpected symbol near "!"
in main type
tbstart
may seem silly but try changing
TriggStart = "" to TriggStart = "!"
keep quotes !! :)
regs
are there more trivia databases?
plz can someone give me a workin trivia
try re-reading this topic again - its working for me...
regs
try this as a start...
Here is a link (http://rpgbooks-cymru.no-ip.org/WorkingTrivia.txt)
Can somebody please tell me what exactly do I have to change in the script to autoload/save scores ???
I only need to know where and what I have to change for this to work! I don't want all the script!
Can u please help and tell me what 2 change? ?(
I did this myself! I'm happy! It's my first time when I repaired a script! :)
can someone modify the script so that users dont have to join they can directly answer to the questions
this is already in the script !!
look for
lngDefMode = 2 -- (0 = game is played in chat!, 1 = game is played in chat but questions only show for players, 2 = game is played in pm with players)
lngMode = lngDefMode
set lngDefMode = 0
HTH
how to change the time interval from 15 seconds to 10 seconds
hi folks!
can anyone post the last version of the script plz?
since that was submited of several modifications...
best regards,
Re@SoN
Hey can u tell me ur e-mail adress? I will send it 2 u! BEcause the script is too big to post!
:P
I would like that as well :) suppose just attaching a zip with it wont work for ya?
please send to my mail: anna_lagerberg@hotmail.com
Please somebody upload to the script database too, I made it for this particular purpose.
hi, here it is:
reason_clcity@hotmail.com
tks!
best regards,
Re@SoN
Here's my address if you are kind to send me too the scripts of Trivia.
E-mail address (pavalcosmin@yahoo.com)
Sending this script via email is pretty futile as only those people will benefit from this, if the script is public (as here) everyone can use it.
So please if the script was changed/updated post the new version (or a fuctional dl link) here, possibly with a changelog file. thanks.
QuoteOriginally posted by Stravides
try this as a start...
Here is a link (http://rpgbooks-cymru.no-ip.org/WorkingTrivia.txt)
look at that, and I never even had to type it in ;)
These are damn clever forums ;)
:)
QuoteOriginally posted by kunal
QuoteOriginally posted by Stravides
try this as a start...
Here is a link (http://rpgbooks-cymru.no-ip.org/WorkingTrivia.txt)
Yes thanks I saw that one, but what are the changes?
I don't want users to autologin and some other features that was changed, how can i know features were modified and decide which version should I use?
you can change the features by editing the script such as these
boolAutoSaveScores = 1 -- (nil = off, 1 = on)
countSaveTurns = 1 -- After how many questions should the scores be saved
boolRevealAnswer = 1 -- (nil = off, 1 = on)
boolShowGuessesInPM = 1 -- (nil = off, 1 = on)
boolAutoHint = 1 -- (nil = off, 1 = on)
boolAutoLogin = nil -- (nil = off, 1 = on)
boolAddQuestion = 1 -- (nil = No, 1 = Yes)
QuoteOriginally posted by kunal
you can change the features by editing the script such as these
boolAutoSaveScores = 1 -- (nil = off, 1 = on)
countSaveTurns = 1 -- After how many questions should the scores be saved
boolRevealAnswer = 1 -- (nil = off, 1 = on)
boolShowGuessesInPM = 1 -- (nil = off, 1 = on)
boolAutoHint = 1 -- (nil = off, 1 = on)
boolAutoLogin = nil -- (nil = off, 1 = on)
boolAddQuestion = 1 -- (nil = No, 1 = Yes)
yup..thanks I know this..I was referring to code changes, happened after 2.2 until now, bugfixes and so on.
only autosaving and autoloading of scores is added .
if u want without the changes take the one on the first page of this thread.
QuoteOriginally posted by kunal
only autosaving and autoloading of scores is added .
if u want without the changes take the one on the first page of this thread.
You just don't get it do you? :) I know the changes, I read the discussion, but from 2.2 no one has written a changelog, how can people be aware of changes, without having to ask to you, or read the whole tread?
Look at this:
-- TriviaBot Version 3.01
-- TriviaBot written by Leon a.k.a. Don Leon
-- Changes by Spud (Dream~Masters)
-- Converted to Lua5 By Jelf 15/03/05
-- Tweaked by Stravides 20/05/05
--
-- Version 3.01 Changes
--
-- Added scores autosaving to automatically save scores when stopping Trivia
-- Added scores autoloading to automaticcaly load scores when starting Trivia
-- Added Right-click commands
--
--Version 2.2 Changes
-- etc. etc.
Stravides please can you include a changelog with your tweaked script? thanks.
Thats the idea - read the Whole Thread..
Thats What I did..
Changelog
2.2 Got it workin ;)
hehehe
Will write it up when I get home tonight ;)
where can i find full package with answers and all other things that go with it i'll post a link with full rar if you need it
I downloaded latest script and it shows no errors in script but where is the folder for answers and scores
My email is Hemarr@hemarr.com
Thanks
my email id is durvesht@gmail.com
can u pls send the whole working perfect trivia script
thanks in advance
:)