[Plugin] triviaBot Plugin (working with pearl and xeon)

Hi everyone firstly my english and coding is not very good so I may have mistakes.

This plugin uses for answer to chat event.
For those who do not know this event: [BOT]Events asks question from global and if you answer correctly with a pm, you win 25 silk.

Plugin automatically adds questions, no need manual typing.
Only tested in Pearl sro.
You just drag to the plugins folder and wait for the questions to save.

Here is plugin
Dont forget to change server variable in triviaBot.py file


it work with all server’s or just only Pearl sro?

I haven’t tried any other server but maybe it can work with minor changes

it’s dosn’t work on Electus server no have any reaction

it didnt work on Xeon server too,
no react
in xeon server the bot name is [BOT]
is that may consider a problem ?

so the plugin was working perfectly the last 2 months in XEON
until a new update came to the server , basically the new update change the way that sending the questing

the questions was sending in globals

but now, its sending by Notice

i tried to edit the bot by changing t ==7 instead of t ==1 and deleted the line where if player == [BOT]

and i re wrote it as :

elif server == “xeon”:
if “winner of this round” not in msg and “no winner for this” not in msg:
a = 0
while True:
if a == get_qa(‘l’,0):
save_q2_cache(msg) # save question if dont know
Timer(randrange(30,80), add_newq, ()).start() # automatically add questions to qafile and gui list
if get_qa(‘q’,a) == msg:
player == “[BOT]”
reply = get_qa(‘a’,a)
Timer(randrange(answertime[0],answertime[1]), phBotChat.Private, (player,reply)).start()
log(“triviaBot: [”+msg+"] question replied as ["+reply+"]")
a += 1

it didnt work could u update it or at least help me how could i fix the error ?

Updated the plugin for XEON:
and its working fine now …


  • increased the speed of answering

thanks ryan for : Introduction - phBot Plugins
it was really helpful…

thanks ayhtyu for : creating the plugin from scratch.

thanks JellyBitz for : your plugins because i learned few things from reading ur codes of other plugins :smiley:

Can this plugin be modified for PureSRO server?

show me the questions an example of the question how its show in globals,
and i will try if i could make it :smiley:

The questions are asked in notice and the answer should be sent as a private message to Kotsh or $Kotsh.

okay show me the kind of the question take a screen shot i should see if its asked by Notice or global … i need more details

when event start just take screen shot for it so i could try my best

I’m not home atm, but as soon as i get home after 4 hours i will take a screenshot to show you an example.

and i will tryy my best to do it :smiley:

How do you make it read globals? set t == 1?

[15:09:22] Python Error: ‘charmap’ codec can’t encode character ‘\u044e’ in position 28: character maps to
I get this often

Here’s the image

Plugin don’t work anymore on XEON
Anyone can help?

Its can work for other server ?