Paste #32774: Untitled Paste

Date: 2016/04/16 07:53:58 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


SYSTEM_COMPETITIONS:
    type: world
    events:
        on player joins:
            - if <player.in_group[Compete].global> {
              - if <player.flag[COMPETING_NOW_0003]> {
                - queue clear
              }
              - flag <player> COMPETING_NOW_0003
              - execute as_op "compadd"
            }
            - wait 5
            - narrate "Competition system is being worked on right now by Axe. Please standby while he finishes up."

        on compopen command:
            - determine passively fulfilled
            - narrate "opening"
            - ~sql id:ADDPLAYERTOCOMPLIST connect:mineassault.com:3306/mineassa_Competition_Details username:mineassa_axepex password:vvvvvvvv

        on compcreate command:
            - determine passively fulfilled
            - narrate "making table"
            - ~sql id:ADDPLAYERTOCOMPLIST connect:mineassault.com:3306/mineassa_Competition_Details username:mineassa_axepex password:vvvvvvvv
            - sql id:ADDPLAYERTOCOMPLIST "update:CREATE table Details(prize1 int,prize2 int,prize3 int);" 
            - sql disconnect id:ADDPLAYERTOCOMPLIST

        on compadd command:
            - determine passively fulfilled
            - narrate "trying to add"
            - ~sql id:ADDPLAYERTOCOMPLIST connect:mineassault.com:3306/mineassa_Competition_Details username:mineassa_axepex password:vvvvvvvv
            - sql id:ADDPLAYERTOCOMPLIST "update:INSERT INTO Details VALUES ('5', '3', '2');" 
            - sql disconnect id:ADDPLAYERTOCOMPLIST

        on compclose command:
            - determine passively fulfilled
            - narrate "closing"
            - sql disconnect id:ADDPLAYERTOCOMPLIST





        on compcreate2 command:
            - determine passively fulfilled
            - narrate "making table"
            - ~sql id:stattrack connect:mineassault.com:3306/mineassa_Competition_Details username:mineassa_axepex password:vvvvvvvv
            - sql id:stattrack "update:CREATE table Stats(Name varchar(255),Score varchar(255));" 
            - sql disconnect id:stattrack

        on compadd2 command:
            - determine passively fulfilled
            - narrate "trying to add"
            - ~sql id:stat<player.name> connect:mineassault.com:3306/mineassa_Competition_Details username:mineassa_axepex password:vvvvvvvv
            - sql id:stat<player.name> "update:INSERT INTO Stats VALUES ('<player.name>', '1');" 
            - sql disconnect id:stat<player.name>

        on compadd3 command:
            - determine passively fulfilled
            - narrate "trying to add"
            - ~sql id:stat<player.name> connect:mineassault.com:3306/mineassa_Competition_Details username:mineassa_axepex password:vvvvvvvv
            - sql id:stat<player.name> "update:UPDATE Stats SET Name='<player.name>',Score='<player.flag[COMP_Counting04]>';" 
            - sql disconnect id:stat<player.name>




        on player breaks gold_ore:
            - if !<player.has_flag[COMP_STARTED_Counting04]> {
              - flag <player> COMP_STARTED_Counting04
              - flag <player> COMP_Counting04:1 
              - define Player_Score '<player.flag[COMP_Counting04]>' 
              - wait 1
              - execute as_player "compadd2"
              - queue clear              
            }
            - flag <player> COMP_Counting04:++
            - narrate "<player.flag[COMP_Counting04]>"
            - if !<player.has_flag[synccooling]> {
              - flag <player> synccooling duration:1
              - execute as_player "compadd3"
            }


        on player places gold_ore:
            - if !<player.has_flag[COMP_STARTED_Counting04]> {
              - flag <player> COMP_STARTED_Counting04
              - flag <player> COMP_Counting04:0
              - define Player_Score '<player.flag[COMP_Counting04]>' 
              - queue clear

            }
            - flag <player> COMP_Counting04:--
            - narrate "<player.flag[COMP_Counting04]>"