_MM_IKKE

quiz.ini

Nov 21st, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 6.20 KB | None | 0 0
  1. [script]
  2. n0=on 500,543:TEXT:*:*: { halt }
  3. n1=
  4. n2=
  5. n3=;STILL NEEDS A REWORK USING "scon $bot_say($chan) "
  6. n4=
  7. n5=;+ auto-reset if user doesn't reply anymore
  8. n6=
  9. n7=on *:TEXT:!quiz:#: {
  10. n8=  if ($me == %bot1) {
  11. n9=    scon $bot_say($chan) msg $chan Quiz currently under construction.
  12. n10=  }
  13. n11=}
  14. n12=on *:TEXT:*:*: { halt }
  15. n13=
  16. n14=
  17. n15=on *:TEXT:!quiz:#: {
  18. n16=  if ($me == %bot2) {
  19. n17=    msg $chan To start the quiz, pm me
  20. n18=    .timer 1 2 msg $chan Use !setq <question> to set the question (query)
  21. n19=    .timer 1 4 msg $chan Use !seta <answer> to set the answer (query)
  22. 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.
  23. n21=    .timer 1 8 msg $chan 4NOTE: My owner ( $+ %owner $+ ) cannot see the answers, pms are being deleted right away
  24. n22=  }
  25. n23=}
  26. n24=on *:TEXT:!seta*:#: {
  27. n25=  if ($me == %bot2 && $1 == !seta) {
  28. n26=    msg $chan 4ERROR: This should be written in query
  29. n27=  }
  30. n28=}
  31. n29=on *:TEXT:!seta*:?: {
  32. n30=  if ($me == %bot2 && $1 == !seta) {
  33. n31=    if ($2 == $null) { .msg $nick 4ERROR: Usage: !seta <answer>  }
  34. n32=    elseif (%quizmaster != $null) {
  35. n33=      if ($nick == %quizmaster) {
  36. n34=        if (%quiz == answer) {
  37. n35=          set %answer $2-
  38. n36=          set %quiz done
  39. n37=          .msg $nick Answer set!
  40. n38=        }
  41. n39=        elseif (%quiz == question || %quiz == done) {
  42. n40=          set %answer $2-
  43. n41=          .msg $nick Changed " $+ %answer $+ " into " $+ $2- $+ ".
  44. n42=        }
  45. n43=        else {
  46. n44=          set %answer $2-
  47. n45=          set %quiz question
  48. n46=          .msg $nick Answer set!
  49. n47=        }
  50. n48=      }
  51. n49=      else { .msg $nick 4ERROR: %quizmaster is using the script }
  52. n50=    }
  53. n51=    else {
  54. n52=      set %quizmaster $nick
  55. n53=      set %answer $2-
  56. n54=      set %quiz question
  57. n55=      .msg $nick Answer set!
  58. n56=    }
  59. n57=  }
  60. n58=}
  61. n59=on *:TEXT:!setq*:#: {
  62. n60=  if ($me == %bot2 && $1 == !setq) {
  63. n61=    msg $chan 4ERROR: This should be written in query
  64. n62=  }
  65. n63=}
  66. n64=on *:TEXT:!setq*:?: {
  67. n65=  if ($me == %bot2 && $1 == !setq) {
  68. n66=    if (%quizmaster != $null) {
  69. n67=      if ($nick == %quizmaster) {
  70. n68=        if ($2 == $null) { .msg $nick 4ERROR: Usage: !setq <question>  }
  71. n69=        elseif (%quiz == question) {
  72. n70=          set %question $2-
  73. n71=          set %quiz done
  74. n72=          .msg $nick Question set!
  75. n73=        }
  76. n74=        elseif (%quiz == answer || %quiz == done) {
  77. n75=          set %question $2-
  78. n76=          .msg $nick Changed " $+ %question $+ " into " $+ $2- $+ ".
  79. n77=        }      
  80. n78=        else {
  81. n79=          set %question $2-
  82. n80=          set %quiz answer
  83. n81=          .msg $nick Question set!
  84. n82=        }
  85. n83=      }
  86. n84=      else { .msg $nick 4ERROR: %quizmaster is using the script }
  87. n85=    }
  88. n86=    else {
  89. n87=      set %quizmaster $nick
  90. n88=      set %question $2-
  91. n89=      set %quiz answer
  92. n90=      .msg $nick Question set!
  93. n91=    }
  94. n92=  }
  95. n93=}
  96. n94=on *:TEXT:!ask:?: {
  97. n95=  if ($me == %bot2) {
  98. n96=    .msg $nick 4ERROR: This should be written in a channel
  99. n97=  }
  100. n98=}
  101. n99=on *:TEXT:!ask:#: {
  102. n100=  if ($me == %bot2) {
  103. n101=    if ($nick == %quizmaster) {
  104. n102=      if (%quiz == done) {
  105. n103=        msg $chan Quizmaster:4 %quizmaster  Question:2 %question
  106. n104=        set %asked yes
  107. n105=        .timer 1 60 quiz $chan
  108. n106=      }
  109. n107=      elseif (%quiz == answer) { .msg $nick 4ERROR: The answer has not been set  }
  110. n108=      elseif (%quiz == question) { .msg $nick 4ERROR: The question has not been set  }
  111. n109=      elseif (%quiz == $null) { .msg $nick 4ERROR: The quiz has not been set up  }
  112. n110=    }
  113. n111=    else {
  114. n112=      if (%quizmaster == $null) { msg $chan 4ERROR: Nobody is using the quiz. }
  115. n113=      else { msg $chan 4ERROR: You are not the quizmaster }
  116. n114=    }
  117. n115=  }
  118. n116=}
  119. n117=alias -l quiz {
  120. n118=  ;Syntax: <chan>
  121. n119=  ;Usage: Internally used to check if someone answered the quiz already.
  122. n120=  if (%asked == yes) {
  123. n121=    msg $1 4FAIL:1 Nobody found the answer, it was: 2 $+ %answer
  124. n122=    resetquiz
  125. n123=  }
  126. n124=}
  127. n125=
  128. n126=
  129. n127=on *:TEXT:*:#: {
  130. n128=  if ($me == %bot2) {
  131. n129=    if (%quiz == answer) {
  132. n130=      if ($nick == %quizmaster) {
  133. n131=        if (%seta == 0) {
  134. n132=          .msg $nick 4ERROR: The answer has not been set
  135. n133=          set %seta 1
  136. n134=        }
  137. n135=      }
  138. n136=    }
  139. n137=    elseif (%quiz == question) {
  140. n138=      if ($nick == %quizmaster) {
  141. n139=        if (%setq == 0) {
  142. n140=          .msg $nick 4ERROR: The question has not been set
  143. n141=          set %setq 1
  144. n142=        }
  145. n143=      }
  146. n144=    }
  147. n145=    elseif (%asked == yes) {
  148. n146=      if (%answer isin $1-) {
  149. n147=        if ($nick == %quizmaster) {
  150. n148=          if (%QM == 0) { .notice $nick 4ERROR: Do not give away the answer | set %QM 1 }
  151. n149=        }
  152. n150=        else {
  153. n151=          msg $chan 4 $+ $nick won!!!
  154. n152=          set %answer $null
  155. n153=          set %quiz $null
  156. n154=          set %question $null
  157. n155=          set %quizmaster $null
  158. n156=          set %asked no
  159. n157=          set %seta 0
  160. n158=          set %setq 0
  161. n159=          set %askit 0
  162. n160=          set %QM 0
  163. n161=          halt
  164. n162=          if (!$exists(Stats\ $+ $nick $+ .txt)) {
  165. n163=            createaccount $nick
  166. n164=          }
  167. n165=          write -l2 Stats\ $+ $nick $+ .txt $calc($read(Stats\ $+ $nick $+ .txt, 2) + 1)
  168. n166=          if ($calc($read(Stats\ $+ $nick $+ .txt, 2) / 5) == $int($calc($read(Stats\ $+ $nick $+ .txt, 2) / 5))) {
  169. n167=            cookie $nick
  170. 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.
  171. n169=          }
  172. n170=        }
  173. n171=      }
  174. n172=    }
  175. n173=    elseif (%quiz == done) {
  176. n174=      if ($nick == %quizmaster) {
  177. n175=        if (%askit == 0) {
  178. n176=          .msg $nick Ask the question in any channel using !ask
  179. n177=          set %askit 1
  180. n178=        }
  181. n179=      }
  182. n180=    }
  183. n181=  }
  184. n182=}
Add Comment
Please, Sign In to add comment