- D1 Meta Docs - Denizen Script -
Home Page / Pi to one million places / Contact mcmonkey / Donate / Paste Scripts / Denizen Help /
You are browsing as a guest.
Login | Register


Click here to create your own public paste ~ ~ click to duplicate and edit this paste


TitleUntitled Paste
TypeDenizen Script
Date2017/10/26 10:07:31 UTC-07:00
ByGuest
Other
Paste
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
3200
TRIVIA_BROADCAST: 
    type: world 
    events: 
        on system time minutely: 
        - if <util.random.int[1].to[1]> == 1 { 
            - define question <yaml[Trivia].list_keys[questions].random> 
            - announce "<&7>[<&3>BA<&b>ChatGames<&7>]<&b> <def[question].space_separated>" 
            - define answer <yaml.read[<def[question]>]> 
            - narrate "<&7>Answer: <def[answer]>" 
            - flag server active_question:<def[question]> 
            - flag server active_answer:<def[answer]> 
        } 
        on player chats: 
        - if <context.message> != <server.flag[answer]> 
  
TRIVIA_COMMAND: 
    type: command 
    name: trivia 
    script: 
    - choose <context.args.get[1]>: 
        - case "setup": 
            - if !<server.has_file[dChatGames/Trivia.yml]> { 
                - yaml create id:Trivia 
                - yaml "savefile:dChatGames/Trivia.yml" id:Trivia 
                - narrate "<&a>Trivia has been set up!" 
            } 
        - case "add": 
            - yaml load:dChatGames/Trivia.yml id:Trivia 
            - yaml id:Trivia set questions.<context.args.get[2]>:<context.args.get[3]> 
            - narrate "<&a>Added question<context.args.get[2]> with answer<context.args.get[3]>"
            - yaml "savefile:dChatGames/Trivia.yml" id:Trivia 



RawRaw



Pastes made: 57250