Paste #9431: Debugging offensive language script

Date: 2014/09/08 12:10:37 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


#Violet Server World Scripts v0.0001
#By TheGeek007 
#9-8-14 

VioletWorldScript:
    type: world
    events:
        on server start:
        # clear the flag, it saves between reboots
        - flag server naughtywords:!
        #set a server flag a list of naughty words 
        - flag server naughtywords:|:fuck|shit|damn|pussy|cunt|bitch|nigger|ass|dick|penis 
#to add a naughty word /ex flag server naughtywords:->:word 
#to remove a naughty word /ex flag server naughtywords:<-:word 
        on player chats:
        #this line censors the naughty words with "****"
        - determine <context.message.replace[regex:(?i)(<server.flag[naughtywords].as_list.replace[li@]>)].with[****]> 
        #this line checks chats vs a list of naughty words, then punishes them
        #with various misfortunes, and increments a player flag
        #infractions. Once <player.flag[infractions]> reaches a
        #set threshold, mute for 
        - foreach <server.flag[naughtywords].as_list> {
          - if <context.message.contains[%value%]> {
            - flag player infractions:++ duration:30m
            - announce "DEBUG player flag infractions is now <player.flag[infractions]>"
            - random {
              - run MisfortuneJenny
              - run MisfortuneOak
            }
          }
        }
        on player uses portal:
        #Makes players not able to use portals AT ALL!!! (YAY!) 
        - determine CANCELLED

        on portal created:
        - announce "A portal has been created at <context.location> in world <context.world> for reason <context.reason>!"
        #  - if <context.message.contains[regex:(?i)(%value%)]> {

MisfortuneJenny:
    type: task
    script:
    - announce "[Officer Jenny] Offensive words aren't allowed on our server, <player.name>!" 
    - wait 1
    - burn <player> duration:5
    - announce "Officer Jenny's Growlithe used Fire Spin on <player.name> for Bad Language!"
MisfortuneOak:
    type: task
    script:
    - announce "[Professor Oak] This isn't the time to use dirty words <player.name>!"
    - wait 1
    - strike <player.location>
    - announce "A passing Pikachu is offended at <player.name>'s lanugage and used Thunder!"