cfg_quiz: type: data config: time_remind: 10s time_restart: 1s time_expire: 30s questions: q_diamond: ask: What is the name of the <&b>bright blue<&f> ore? # Answers can have spaces in them, and multiple answers can be taken. answer: diamond|diamond ore q_redstone: ask: What is the name of the <&4>magical red<&f> ore? answer: redstone|redstone ore q_stick: ask: What is the most <&a>common item<&f> involved in tool and weapon recipes? answer: stick|sticks q_netherwart: ask: Where can <&4>nether wart<&f> be naturally found? answer: nether|the nether q_herobrine: ask: Who is the <&7>fictional character<&f> constantly potrayed in minecraft creepy pastas? answer: herobrine rewards: items: ironore: item: iron_ore # Min/max quantity quantity: 1|6 emerald: item: emerald quantity: 1|3 dirt: item: dirt quantity: 8|64 money: 1k: 100|1000 10k: 1000|10000 100k: 10000|100000 scripts: # Subscripts in quiz_events - scriptreward_special quiz_prefix: type: format debug: false format: <&f>[<&a>Quiz<&f>]<&r> <[text]> quiz_events: type: world debug: false scripts: scriptreward_special: - narrate - firework random primary:Red fade:white quiz_start: - define ids # Don't run previous questions asked, reset if all used up. - if ]>: - define ids <[ids].exclude[]> - if ]>: - flag SERVER quiz.ids_used: - define ids - define id <[ids].random> - flag SERVER quiz.end:! - flag SERVER quiz.id:<[id]> - flag SERVER quiz.start: - flag SERVER quiz.reminder: - define dur ].from_now> - announce ".ask]><&nl><&c>⏱ <&7><[dur].formatted_words> left to answer!" format:quiz_prefix - stop quiz_remind: - define dur ].from_now> - announce ".ask]><&nl><&c>⏱ <&7><[dur].formatted_words> left to answer!" format:quiz_prefix - flag SERVER quiz.reminder: quiz_expire: - define ans .answer]> - announce "<&c>No one answered the quiz in time! <&nl>The answer was: <&e><[ans].as[list].parse[to_titlecase].separated_by[ <&f>or<&e> ]>" format:quiz_prefix - flag SERVER quiz.end: - flag SERVER quiz.ids_used:->:<[id]> - stop quiz_reward: - define reward_types # Don't give money when it doesn't exist. - define reward_types:<-:money if: - define type <[reward_types].random> - if <[type]> == scripts: - define reward ].random> - else: - define reward ].keys.random> - choose <[type]>: - case items: - define i .<[reward]>.item].as[item].if_null[]> - define quant .<[reward]>.quantity].as[list]> - define quant ].to[<[quant].get[2]>]> - give <[i]> quantity:<[quant]> - narrate "<&a>You recieved <&e><[i].material.translated_name> <&f>(<&d>x<[quant]><&f>)<&a> as a reward!" - case money: - define amt .<[reward]>].as[list]> - define amt ].to[<[amt].get[2]>]> - narrate "<&a>You recieved <&e>]><&a> as a reward!" - case scripts: - inject .scripts.<[reward]> events: on delta time secondly: - define remind_time - define expire_time - define restart_time - if NOT OR ( AND ]>]> ): - inject .scripts.quiz_start - define id - stop if: # Two checks are needed to check on the dot and if the script gets reloaded causing latency, might not be necessary? - if ].from_now.in_seconds> <= 0 or ]>]>: - inject .scripts.quiz_expire - if ].from_now.in_seconds> <= 0 or ]>]>: - inject .scripts.quiz_remind after player chats: - if AND NOT : - define id - define ans .answer]> - if <[ans].as[list].contains_any[]>: - announce "<&e><&a> won the quiz!" format:quiz_prefix - flag SERVER quiz.end: - flag SERVER quiz.ids_used:->:<[id]> - inject .scripts.quiz_reward