Paste #10949: Radio problem 2

Date: 2014/11/02 17:12:07 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


Radio:
    Type: world
    events:
      on server start:
      - inject Sradio
      on radio command:
      - if <context.raw_args> == "" {
        - narrate "To turn on the radio type /radio on and to turn the radio off type /radio off"
        }
      - if <context.raw_args> == "on" {
        - flag player radio
        - narrate "Radio on"
        }
      - if <context.raw_args> == "off" {
        - flag server Radio:<-:<player>
        - narrate "Radio off"
        }
      - if <context.raw_args> == "forcestart" {
        - if !<player.has_permission[Music.Start]> { 
          - narrate 'You must be Madara to use this command!' 
          - queue clear
          }
        - narrate "radio force started"
        - inject Sradio
        }
      on testcmd command:
      - narrate "<server.get_online_players_flagged[radio]> <server.list.ops>"
Sradio:
    Type: task
    script:
    - while true {
      - random {
        - inject Sradio1
        - inject Sradio2
        - inject Sradio3
        - inject Sradio4
        - inject Sradio5
        }
      }
Sradio1:
    Type: task
    script:
    - MIDI file:God <server.get_online_players_flagged[radio]>
    - narrate "We're now playing Declaration of a God" targets:<server.get_online_players_flagged[<radio:on>]>
    - wait 126s
Sradio2:
    Type: task
    script:
    - MIDI file:BlueBird <server.get_online_players_flagged[radio]>
    - narrate "We're now playing Blue Bird" targets:<server.get_online_players_flagged[<radio:on>]>
    - wait 88s
Sradio3:
    Type: task
    script:
    - MIDI file:CF <server.get_online_players_flagged[radio]>
    - narrate "We're now playing Crossing field" targets:<server.get_online_players_flagged[<radio:on>]>
    - wait 86s
Sradio4:
    Type: task
    script:
    - MIDI file:NarutoTheme <server.get_online_players_flagged[radio]>
    - narrate "We're now playing the Naruto theme" targets:<server.get_online_players_flagged[<radio:on>]>
    - wait 42s
Sradio5:
    Type: task
    script:
    - MIDI file:HinataVsNeji <server.get_online_players_flagged[radio]>
    - narrate "We're now playing Hinata vs Neji" targets:<server.get_online_players_flagged[<radio:on>]>
    - wait 189s