Charmander

witty again

Aug 11th, 2011
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.75 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. }
  91. if (%a < 6) {
  92. msg %witty.chan 0,1Round %a out of 5 begins
  93. }
  94. if (%a == 6) {
  95. msg %witty.chan 0,1Game over, round 5 reached!
  96. msg %witty.chan 0,1Calculating winner...
  97. msg %witty.chan 0,1firecape wins!
  98. unset %witty.*
  99. unset %a
  100. .timers off
  101. }
  102. msg %witty.chan 0,1Get ready...
  103. set %witty.prompt $read(prompts.txt)
  104. msg %witty.chan 4,1Prompt:4,1 8,1 $+ %witty.prompt
  105. msg %witty.chan 0,1You have 60 seconds to come up with an answer!
  106. set %witty.stage answer
  107. .timer 1 60 endanswer
  108. .timer 1 30 /msg %witty.chan 0,1Hurry up! 30 seconds left!
  109. }
  110. on *:text:*:?: {
  111. if ($me != firebot) {
  112. halt
  113. }
  114. if ($1 == wittysubmission: && %witty.stage != answer) {
  115. msg firecape firecape, $nick has submitted $+(",$2,") as a witty prompt
  116. msg $nick Thank you, your submission will be reviewed and then added if you are not a retard.
  117. }
  118. if (%witty.stage == answer) {
  119. if ($nick !isin %witty.gaveanswer) {
  120. inc %witty.number
  121. set %witty.answer [ $+ [ %witty.number ] ] $nick $1-
  122. msg %witty.chan $+([,%witty.number,]) was submitted.
  123. msg $nick The answer $+(04,$1-,) was submitted.
  124. set %witty.gaveanswer %witty.gaveanswer $nick
  125. }
  126. else {
  127. set %witty.mexico 1
  128. while (%witty.mexico <= $var(%witty.answer*,0)) {
  129. if ($gettok($var(%witty.answer*,%witty.mexico).value,1,32) == $nick) {
  130. set $var(%witty.answer*,%witty.mexico) $nick $1-
  131. msg $nick Your submission was changed to 04 $+ $1- $+ .
  132. }
  133. inc %witty.mexico
  134. }
  135. unset %witty.mexico
  136. }
  137. }
  138. if (%witty.stage == vote) {
  139. if ($2 isnum 1-) {
  140. if ($2 <= %witty.number) {
  141. var %witty.vote $2
  142. }
  143. }
  144. else {
  145. msg $nick Syntax is vote #
  146. halt
  147. }
  148. tokenize 32 %witty.answer [ $+ [ $2 ] ]
  149. if ($nick == $1) {
  150. msg $nick You can't vote for yourself!
  151. halt
  152. }
  153. if ($findtok(%witty.gaveanswer,$nick,1,32)) {
  154. if (!$findtok(%witty.voted,$nick,1,32)) {
  155. set %witty.voted %witty.voted $nick
  156. set %witty.votes [ $+ [ %witty.vote ] ] %witty.votes [ $+ [ %witty.vote ] ] $nick
  157. set %witty.mexico2 [ $+ [ $nick ] ] $2
  158. msg $nick You voted for $+(04,%witty.vote,!)
  159. }
  160. else {
  161. set %witty.mexico 1
  162. while (%witty.mexico <= $var(%witty.votes*,0)) {
  163. if ($nick isin %witty.votes [ $+ [ $gettok(%witty.mexico2 [ $+ [ $nick ] ],1,32) ] ]) {
  164. set %witty.votes [ $+ [ $gettok(%witty.mexico2 [ $+ [ $nick ] ],2,32) ] ] $deltok(%witty.votes [ $+ [ $gettok(%witty.mexico2 [ $+ [ $nick ] ],2,32) ] ],$findtok($nick,32),32)
  165. msg $nick You changed your vote to $gettok(%witty.mexico2 [ $+ [ $nick ] ],1,32) $+ !
  166. }
  167. inc %witty.mexico
  168. }
  169. unset %witty.mexico
  170. }
  171. }
  172. }
  173. }
  174. alias endanswer {
  175. if (%witty.number >= 2) {
  176. msg %witty.chan Time is up...
  177. msg %witty.chan 4,1Prompt:4,1 8,1 $+ %witty.prompt
  178. set %witty.count 1
  179. while (%witty.count <= %witty.number) {
  180. tokenize 32 %witty.answer [ $+ [ %witty.count ] ]
  181. msg %witty.chan $+([,%witty.count,]) $+ $2-
  182. inc %witty.count
  183. }
  184. set %witty.stage vote
  185. msg %witty.chan 0,1 $+ Please start voting for the best candidate! You have 60 seconds to vote!
  186. .timer 1 60 endvote
  187. .timer 1 30 /msg %witty.chan Hurry up! Only 30 seconds left to vote!
  188. }
  189. else {
  190. msg %witty.chan 0,1 $+ Two people required to play witty, game over.
  191. unset %witty.*
  192. unset %a
  193. }
  194. }
  195. alias endvote {
  196. if ($me != firebot) { halt }
  197. unset %witty.stage
  198. msg %witty.chan 0,1Voting is over.
  199. msg %witty.chan 4,1Prompt:4,1 8,1 $+ %witty.prompt
  200. set %witty.count 1
  201. while (%witty.count <= %witty.number) {
  202. tokenize 32 %witty.answer [ $+ [ %witty.count ] ]
  203. inc %witty.points [ $+ [ $nick ] ] $numtok(%witty.votes [ $+ [ %witty.count ] ],32)
  204. msg %witty.chan $+([,%witty.count,],[,$1,]) $2- : $numtok(%witty.votes [ $+ [ %witty.count ] ],32)
  205. inc %witty.count }
  206. set %a $calc(%a + 1)
  207. wittygame %witty.chan
  208. }
Advertisement
Add Comment
Please, Sign In to add comment