[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
https://raw.githubusercontent.com/ayhtyu/phBotPlugin/master/triviaBot.py
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
break
else:
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+"]")
break
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 …

https://raw.githubusercontent.com/Mo7ammadQ8/PhBotScripts/master/trviaXEONupdate

  • increased the speed of answering

thanks ryan for : https://projecthax.gitbook.io/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: