Charmander

witty

Aug 10th, 2011
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.02 KB | None | 0 0
  1. on *:text:*!vote*:#: {
  2. if (%witty.stage == vote) {
  3. if ($2 isnum 1-) {
  4. if ($2 <= %witty.number) {
  5. var %witty.vote $2
  6. }
  7. }
  8. else {
  9. msg $nick Syntax is vote #
  10. halt
  11. }
  12. tokenize 32 %witty.answer [ $+ [ $2 ] ]
  13. if ($nick == $1) {
  14. msg $nick You can't vote for yourself!
  15. halt
  16. }
  17. if (!$findtok(%witty.voted,$nick,1,32) && $findtok(%witty.answered,$nick,1,32)) {
  18. set %witty.voted %witty.voted $nick
  19. set %witty.votes [ $+ [ %witty.vote ] ] %witty.votes [ $+ [ %witty.vote ] ] $nick
  20. msg $nick You voted for $+(04,%witty.vote,!)
  21. }
  22. }
  23. }
  24. on *:text:*!wittyend*:#: {
  25. if (($nick == firecape) && (%witty.witty == on) && ($me == firebot)) {
  26. msg $chan witty has been ended.
  27. unset %witty.*
  28. unset %a
  29. .timers off }
  30. elseif (($nick == wildeep) && (%witty.witty == on) && ($me == firebot)) {
  31. msg $chan witty has been ended.
  32. unset %witty.*
  33. unset %a
  34. .timers off }
  35. elseif (($nick == ditto) && (%witty.witty == on) && ($me == firebot)) {
  36. msg $chan witty has been ended.
  37. unset %witty.*
  38. unset %a
  39. .timers off }
  40. elseif (($nick == tennisace) && (%witty.witty == on) && ($me == firebot)) {
  41. msg $chan witty has been ended.
  42. unset %witty.*
  43. unset %a
  44. .timers off }
  45. elseif (($nick == nexus) && (%witty.witty == on) && ($me == firebot)) {
  46. msg $chan witty has been ended
  47. unset %witty.*
  48. unset %a
  49. .timers off }
  50. elseif (($nick == matthew) && (%witty.witty == on) && ($me == firebot)) {
  51. msg $chan witty has been ended.
  52. unset %witty.*
  53. unset %a
  54. .timers off }
  55. }
  56. on *:text:!next:#: {
  57. if (($nick == firecape) && (%witty.witty == on) && ($me == firebot)) {
  58. msg $chan 0,1Ok fine...
  59. wittygame $chan }
  60. elseif (($nick == wildeep) && (%witty.witty == on) && ($me == firebot)) {
  61. msg $chan 0,1Ok fine...
  62. wittygame $chan }
  63. elseif (($nick == ditto) && (%witty.witty == on) && ($me == firebot)) {
  64. msg $chan 0,1Ok fine...
  65. wittygame $chan }
  66. elseif (($nick == tennisace) && (%witty.witty == on) && ($me == firebot)) {
  67. msg $chan 0,1Ok fine...
  68. wittygame $chan }
  69. elseif (($nick == nexus) && (%witty.witty == on) && ($me == firebot)) {
  70. msg $chan 0,1Ok fine...
  71. wittygame $chan }
  72. elseif (($nick == matthew) && (%witty.witty == on) && ($me == firebot)) {
  73. msg $chan 0,1Ok fine...
  74. wittygame $chan }
  75. }
  76. on *:text:!witty:#: {
  77. if ((%witty.witty != on) && ($me == firebot)) {
  78. set %a 1
  79. wittygame $chan
  80. }
  81. }
  82.  
  83. alias wittygame {
  84. .timers off
  85. unset %witty.*
  86. set %witty.chan $$1
  87. set %witty.witty on
  88. if (%a == 1) {
  89. msg %witty.chan 0,1A new game begins! }
  90. if (%a < 6) {
  91. msg %witty.chan 0,1Round %a out of 5 begins! }
  92. if (%a == 6) {
  93. msg %witty.chan 0,1Game over, round 5 reached!
  94. msg %witty.chan 0,1Calculating winner...
  95. msg %witty.chan 0,1firecape wins!
  96. unset %witty.*
  97. unset %a
  98. .timers off }
  99. msg %witty.chan 0,1Get ready...
  100. set %witty.prompt $read(prompts.txt)
  101. msg %witty.chan 4,1Prompt:4,1 8,1 $+ %witty.prompt
  102. msg %witty.chan 0,1You have 60 seconds to come up with an answer!
  103. set %witty.stage answer
  104. .timer 1 60 endanswer
  105. .timer 1 30 /msg %witty.chan 0,1Hurry up! 30 seconds left!
  106. }
  107. on *:text:*:?: {
  108. if ($me != firebot) halt
  109. if ($1 == wittysubmission:) {
  110. msg firecape firecape, $nick has submitted $+(",$2,") as a witty prompt
  111. msg $nick Thank you, your submission will be reviewed and then added if you are not a retard.
  112. }
  113. if (%witty.stage == answer) {
  114. if ($nick !isin %witty.answered) {
  115. inc %witty.number
  116. set %witty.answer [ $+ [ %witty.number ] ] $nick $1-
  117. msg %witty.chan $+([,%witty.number,]) was submitted.
  118. msg $nick The answer $+(04,$1-,) was submitted.
  119. set %witty.answered %witty.answered $nick
  120. }
  121. else {
  122. set %witty.mexico 1
  123. while (%witty.mexico <= $var(%witty.answer*,0)) {
  124. if ($gettok($var(%witty.answer*,%witty.mexico),1,32) == $nick) {
  125. set $var(%witty.answer*,%witty.mexico) $nick $1-
  126. msg $nick Your submission was changed to $1- !+ .
  127. }
  128. }
  129. unset %witty.mexico
  130. }
  131. }
  132. if (%witty.stage == vote) {
  133. if ($2 isnum 1-) {
  134. if ($2 <= %witty.number) {
  135. var %witty.vote $2
  136. }
  137. }
  138. else {
  139. msg $nick Syntax is vote #
  140. halt
  141. }
  142. tokenize 32 %witty.answer [ $+ [ $2 ] ]
  143. if ($nick == $1) {
  144. msg $nick You can't vote for yourself!
  145. halt
  146. }
  147. if (!$findtok(%witty.voted,$nick,1,32) && $findtok(%witty.answered,$nick,1,32)) {
  148. set %witty.voted %witty.voted $nick
  149. set %witty.votes [ $+ [ %witty.vote ] ] %witty.votes [ $+ [ %witty.vote ] ] $nick
  150. msg $nick You voted for $+(04,%witty.vote,!)
  151. }
  152. }
  153. }
  154. alias endanswer {
  155. if (%witty.number >= 2) {
  156. msg %witty.chan Time is up...
  157. msg %witty.chan 4,1Prompt:4,1 8,1 $+ %witty.prompt
  158. set %witty.count 1
  159. while (%witty.count <= %witty.number) {
  160. tokenize 32 %witty.answer [ $+ [ %witty.count ] ]
  161. msg %witty.chan $+([,%witty.count,]) $+ $2-
  162. inc %witty.count
  163. }
  164. set %witty.stage vote
  165. msg %witty.chan 0,1 $+ Please start voting for the best candidate! You have 60 seconds to vote!
  166. .timer 1 60 endvote
  167. .timer 1 30 /msg %witty.chan Hurry up! Only 30 seconds left to vote!
  168. }
  169. else {
  170. msg %witty.chan 0,1 $+ Two people required to play witty, game over.
  171. unset %witty.*
  172. unset %a
  173. }
  174. }
  175. alias endvote {
  176. if ($me != firebot) { halt }
  177. unset %witty.stage
  178. msg %witty.chan 0,1Voting is over.
  179. msg %witty.chan 4,1Prompt:4,1 8,1 $+ %witty.prompt
  180. set %witty.count 1
  181. while (%witty.count <= %witty.number) {
  182. tokenize 32 %witty.answer [ $+ [ %witty.count ] ]
  183. inc %witty.points [ $+ [ $nick ] ] $numtok(%witty.votes [ $+ [ %witty.count ] ],32)
  184. msg %witty.chan $+([,%witty.count,],[,$1,]) $2- : $numtok(%witty.votes [ $+ [ %witty.count ] ],32)
  185. inc %witty.count }
  186. set %a $calc(%a + 1)
  187. wittygame %witty.chan
  188. }
Advertisement
Add Comment
Please, Sign In to add comment