Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Witty Game
- ;By Charmander
- ;For Firecape
- on $*:text:/^([!@.]witty)$/i:#: {
- if (%witty != on) {
- set %chan #
- set %witty on
- coconuts
- }
- }
- alias coconuts {
- msg %chan A new round begins!
- msg %chan Get ready...
- set %prompt $read(prompts.txt)
- msg %chan Complete this sentence: %prompt
- msg %chan You have 60 seconds to come up with an answer!
- set %stage answer
- .timer 1 60 endanswer
- .timer 1 30 msg %chan Hurry up! 30 seconds left!
- }
- on *:text:*:?: {
- if (%stage == answer) {
- if ($nick !isin %answered) {
- inc %number
- set %answer [ $+ [ %number ] ] $nick $1-
- msg %chan $+([,%number,]) was submitted.
- msg $nick The answer $+(04,$1-,) was submitted.
- set %answered %answered $nick
- }
- else {
- set %answer [ $+ [ %number ] ] $nick $1-
- msg $nick Your submission was changed to $+(04,$1-,,.)
- }
- }
- if (%stage == vote) {
- tokenize 32 %answer [ $+ [ $1- ] ]
- if ($nick !isin %voted && $nick isin %answered && $1- isnum && $1- <= %number && $2 != $nick) {
- set %voted %voted $nick
- set %votes [ $+ [ $1 ] ] %votes [ $+ [ $1 ] ] $nick
- msg $nick You voted for $+(04,$1,!)
- }
- }
- }
- alias endanswer {
- if (%number >= 2) {
- msg %chan Time is up...
- msg %chan %prompt
- set %count 1
- while (%count <= %number) {
- tokenize 32 %answer [ $+ [ %count ] ]
- msg %chan $+([,%count,]) $2-
- inc %count
- }
- set %stage vote
- msg %chan Please start voting for the best candidate! You have 60 seconds to vote!
- .timer 1 60 endvote
- .timer 1 30 msg %chan Hurry up! Only 30 seconds left to vote!
- }
- else {
- msg %chan Two people required to play witty, game over.
- unset %answer1
- unset %witty
- unset %prompt
- unset %number
- unset %chan
- unset %stage
- unset %answered
- }
- }
- alias endvote {
- unset %stage
- msg %chan Voting is over.
- msg %chan %prompt
- set %count 1
- while (%count <= %number) {
- tokenize 32 %answer [ $+ [ %count ] ]
- set %points [ $+ [ $1 ] ] $iif(%points [ $+ [ $1 ] ],$calc($numtok(%votes [ $+ [ %count ] ],32) + %points [ $+ [ $1 ] ]),$numtok(%votes [ $+ [ %count ] ],32))
- msg %chan $+([,%count,],[,$1,]) $2- : $numtok(%votes [ $+ [ %count ] ],32) votes by $iif(%votes [ $+ [ %count] ],$replace(%votes [ $+ [ %count ] ],$chr(32),$chr(44)),No one.)
- inc %count
- }
- coconuts
- }
Advertisement
Add Comment
Please, Sign In to add comment