|
Post by azhaurn on Aug 11, 2016 17:15:38 GMT
How can I do a auto answer? For an example, when the trivia system gives a automatically question:
14:12 [ TRIVIA EVENT ] Question: Who are the only brothers to win the pga tournament? - Hint #1: ______ ___ ___ ______
I will answer: Lionel and Jay Hebert I've got a lot of questions and answers but I don't know how to put it for auto answering.
Thank you so much!
|
|
|
Post by Darth Maul on Aug 12, 2016 4:01:12 GMT
Hey azhaurn, Which server is this for? xD Do you have a screenshot of what it looks like? What color is the text? How often does the trivia event happen?
|
|
|
Post by azhaurn on Aug 12, 2016 6:48:40 GMT
Omg, sorry! I was talking about Noxious OT. It's purple the color text. It happens manually by a staff. I will try to screenshot next time and post here
|
|
|
Post by azhaurn on Aug 24, 2016 18:28:07 GMT
Hey azhaurn , Which server is this for? xD Do you have a screenshot of what it looks like? What color is the text? How often does the trivia event happen?
|
|
Masi
Senior Tutor
Staff Member
Posts: 241 Likes: 198
Mini-Profile Background: {"image":"https://media.giphy.com/media/2bIP0gHS5cLhS/giphy.gif","color":"6b8d6b"}
Mini-Profile Text Color: ffffff
Currently Offline
Last Online: Nov 23, 2019 2:02:15 GMT
View Profile
Registered On: Mar 31, 2016 16:11:57 GMT
|
Post by Masi on Aug 24, 2016 19:46:41 GMT
auto 200 foreach 'newmessages' $q if [$q.content ? 'QUESTION'] {say 'ANSWER'}
|
|
|
Post by Darth Maul on Aug 25, 2016 10:01:25 GMT
If you're able to detect the messages with the above script, you'd be able to store each question in a textfile, each on a separate line, followed by the answer. You should then be able to get elfbot to loop through all lines and check if it matches any of the questions, if so respond; if not save question on a new line and wait for answer to be displayed, then save that.
Doing this would allow you to use a single script to answer all possible trivia questions.
These would probably help:
$fileisline.'filename'.'linetext', it will return 1 if a certain line in the 'filename' equals to 'linetext', 0 otherwise. example: if [$fileisline.'test.txt'.'utani gran hur'] say 'Okay', it will make you say 'Okay' if there is a line with the words 'utani gran hur' in the file 'test.txt'.
$filerandomline.'filename', it will return a random line from the 'filename'. example: if [$curmsg.content ? 'hello' && $curmsg.isdefault] say "$filerandomline.'himsgsresponder.txt'", it will make you say a random line from the file 'himsgsresponder.txt' if someone says hello for you in the default channel.
$fileline.'filename.xyz'.n will return the nth line of the file filename.xyz example: say '[$fileline."testbot.txt".30]', it will make you say the 30th line of the file testbot.txt
filewrite {filename} {text} - writes some text to a file, but does not add a new line afterwards filewriteline {filename} {text} - writes text and inserts a line break afterwards in the file filedelete {filename} - deletes a file
Alternatively you could have the same script active 100+ times (depending on how many questions there are) with different questions.
|
|