Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [script]
- n0=on 500,543:TEXT:*:*: { halt }
- n1=
- n2=
- n3=;STILL NEEDS A REWORK USING "scon $bot_say($chan) "
- n4=
- n5=;+ auto-reset if user doesn't reply anymore
- n6=
- n7=on *:TEXT:!quiz:#: {
- n8= if ($me == %bot1) {
- n9= scon $bot_say($chan) msg $chan Quiz currently under construction.
- n10= }
- n11=}
- n12=on *:TEXT:*:*: { halt }
- n13=
- n14=
- n15=on *:TEXT:!quiz:#: {
- n16= if ($me == %bot2) {
- n17= msg $chan To start the quiz, pm me
- n18= .timer 1 2 msg $chan Use !setq <question> to set the question (query)
- n19= .timer 1 4 msg $chan Use !seta <answer> to set the answer (query)
- n20= .timer 1 6 msg $chan After you have done this, type !ask in this channel. You get one cookie for each 5 correct answers.
- n21= .timer 1 8 msg $chan 4NOTE: My owner ( $+ %owner $+ ) cannot see the answers, pms are being deleted right away
- n22= }
- n23=}
- n24=on *:TEXT:!seta*:#: {
- n25= if ($me == %bot2 && $1 == !seta) {
- n26= msg $chan 4ERROR: This should be written in query
- n27= }
- n28=}
- n29=on *:TEXT:!seta*:?: {
- n30= if ($me == %bot2 && $1 == !seta) {
- n31= if ($2 == $null) { .msg $nick 4ERROR: Usage: !seta <answer> }
- n32= elseif (%quizmaster != $null) {
- n33= if ($nick == %quizmaster) {
- n34= if (%quiz == answer) {
- n35= set %answer $2-
- n36= set %quiz done
- n37= .msg $nick Answer set!
- n38= }
- n39= elseif (%quiz == question || %quiz == done) {
- n40= set %answer $2-
- n41= .msg $nick Changed " $+ %answer $+ " into " $+ $2- $+ ".
- n42= }
- n43= else {
- n44= set %answer $2-
- n45= set %quiz question
- n46= .msg $nick Answer set!
- n47= }
- n48= }
- n49= else { .msg $nick 4ERROR: %quizmaster is using the script }
- n50= }
- n51= else {
- n52= set %quizmaster $nick
- n53= set %answer $2-
- n54= set %quiz question
- n55= .msg $nick Answer set!
- n56= }
- n57= }
- n58=}
- n59=on *:TEXT:!setq*:#: {
- n60= if ($me == %bot2 && $1 == !setq) {
- n61= msg $chan 4ERROR: This should be written in query
- n62= }
- n63=}
- n64=on *:TEXT:!setq*:?: {
- n65= if ($me == %bot2 && $1 == !setq) {
- n66= if (%quizmaster != $null) {
- n67= if ($nick == %quizmaster) {
- n68= if ($2 == $null) { .msg $nick 4ERROR: Usage: !setq <question> }
- n69= elseif (%quiz == question) {
- n70= set %question $2-
- n71= set %quiz done
- n72= .msg $nick Question set!
- n73= }
- n74= elseif (%quiz == answer || %quiz == done) {
- n75= set %question $2-
- n76= .msg $nick Changed " $+ %question $+ " into " $+ $2- $+ ".
- n77= }
- n78= else {
- n79= set %question $2-
- n80= set %quiz answer
- n81= .msg $nick Question set!
- n82= }
- n83= }
- n84= else { .msg $nick 4ERROR: %quizmaster is using the script }
- n85= }
- n86= else {
- n87= set %quizmaster $nick
- n88= set %question $2-
- n89= set %quiz answer
- n90= .msg $nick Question set!
- n91= }
- n92= }
- n93=}
- n94=on *:TEXT:!ask:?: {
- n95= if ($me == %bot2) {
- n96= .msg $nick 4ERROR: This should be written in a channel
- n97= }
- n98=}
- n99=on *:TEXT:!ask:#: {
- n100= if ($me == %bot2) {
- n101= if ($nick == %quizmaster) {
- n102= if (%quiz == done) {
- n103= msg $chan Quizmaster:4 %quizmaster Question:2 %question
- n104= set %asked yes
- n105= .timer 1 60 quiz $chan
- n106= }
- n107= elseif (%quiz == answer) { .msg $nick 4ERROR: The answer has not been set }
- n108= elseif (%quiz == question) { .msg $nick 4ERROR: The question has not been set }
- n109= elseif (%quiz == $null) { .msg $nick 4ERROR: The quiz has not been set up }
- n110= }
- n111= else {
- n112= if (%quizmaster == $null) { msg $chan 4ERROR: Nobody is using the quiz. }
- n113= else { msg $chan 4ERROR: You are not the quizmaster }
- n114= }
- n115= }
- n116=}
- n117=alias -l quiz {
- n118= ;Syntax: <chan>
- n119= ;Usage: Internally used to check if someone answered the quiz already.
- n120= if (%asked == yes) {
- n121= msg $1 4FAIL:1 Nobody found the answer, it was: 2 $+ %answer
- n122= resetquiz
- n123= }
- n124=}
- n125=
- n126=
- n127=on *:TEXT:*:#: {
- n128= if ($me == %bot2) {
- n129= if (%quiz == answer) {
- n130= if ($nick == %quizmaster) {
- n131= if (%seta == 0) {
- n132= .msg $nick 4ERROR: The answer has not been set
- n133= set %seta 1
- n134= }
- n135= }
- n136= }
- n137= elseif (%quiz == question) {
- n138= if ($nick == %quizmaster) {
- n139= if (%setq == 0) {
- n140= .msg $nick 4ERROR: The question has not been set
- n141= set %setq 1
- n142= }
- n143= }
- n144= }
- n145= elseif (%asked == yes) {
- n146= if (%answer isin $1-) {
- n147= if ($nick == %quizmaster) {
- n148= if (%QM == 0) { .notice $nick 4ERROR: Do not give away the answer | set %QM 1 }
- n149= }
- n150= else {
- n151= msg $chan 4 $+ $nick won!!!
- n152= set %answer $null
- n153= set %quiz $null
- n154= set %question $null
- n155= set %quizmaster $null
- n156= set %asked no
- n157= set %seta 0
- n158= set %setq 0
- n159= set %askit 0
- n160= set %QM 0
- n161= halt
- n162= if (!$exists(Stats\ $+ $nick $+ .txt)) {
- n163= createaccount $nick
- n164= }
- n165= write -l2 Stats\ $+ $nick $+ .txt $calc($read(Stats\ $+ $nick $+ .txt, 2) + 1)
- n166= if ($calc($read(Stats\ $+ $nick $+ .txt, 2) / 5) == $int($calc($read(Stats\ $+ $nick $+ .txt, 2) / 5))) {
- n167= cookie $nick
- n168= describe $chan gives4 $nick 6a cookie for having answered $read(Stats\ $+ $nick $+ .txt, 2) 6questions. $nick has now2 $read(Stats\ $+ $nick $+ .txt, 3) 6cookies.
- n169= }
- n170= }
- n171= }
- n172= }
- n173= elseif (%quiz == done) {
- n174= if ($nick == %quizmaster) {
- n175= if (%askit == 0) {
- n176= .msg $nick Ask the question in any channel using !ask
- n177= set %askit 1
- n178= }
- n179= }
- n180= }
- n181= }
- n182=}
Add Comment
Please, Sign In to add comment