Paste #14502: Untitled Paste

Date: 2015/03/14 12:35:50 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


CuboiderMenu:
    type: world
    events:
        on cuboider command:
        - narrate ""
        - if <context.args.get[1]> == null {
            - narrate "<yellow>Cuboider od Maweja"
            - narrate "<white> Cuboider je system na pridavanie regionov (cuboidov), a nasledne pridavania akcie pri vstupe"
            - narrate "<yellow> Prikazy<&co>"
            - narrate "<red> /cu p1<&pipe>2 <white> - oznaci 1/2 bod cuboidu, na zaklade polohy"
            - narrate "<red> /cu vytvorit nazov<white> - vytvori cuboid na zaklade bodov"
            - narrate "<red> /cu akcia nazov_cuboidu nazov_akcie hodnota_akcie"
            - narrate "<dark_gray> Dostupne akcie<&co> title, subtitle"
            - narrate "<red> /cu vymazat nazov<white> - vymaze cuboid"
            - narrate "<red> /cu zoznam <white> - vypise zoznam cuboidov"
            }
            else if <context.args.get[1]> == p1 {
            - flag Cuboider_p1:<player.location.simple>
            - narrate "Prva pozicia nastavena na <player.flag[Cuboider_p1]>"
            } 
            else if <context.args.get[1]> == p2 {
            - flag Cuboider_p2:<player.location.simple>
            - narrate "Druha pozicia nastavena na <player.flag[Cuboider_p2]>"
            } 
            else if <context.args.get[1]> == vytvorit {
                - if <player.has_flag[Cuboider_p1]> && <player.has_flag[Cuboider_p2]> {
                    - if <context.args.get[2]> != null {
                        - note cu@<player.flag[Cuboider_p1]>|<player.flag[Cuboider_p2]> as:<context.args.get[2]>
                        - yaml set Cuboidy.<player.world.replace[w@]>.<context.args.get[2]>.pozicia:<player.flag[Cuboider_p1]>|<player.flag[Cuboider_p2]> id:cuboider
                        - yaml set Cuboidy.<player.world.replace[w@]>.<context.args.get[2]>.akcia.title:xxx id:cuboider
                        - yaml set Cuboidy.<player.world.replace[w@]>.<context.args.get[2]>.akcia.subtitle:xxx id:cuboider
                        - flag Cuboider_p1:!
                        - flag Cuboider_p2:!
                        - narrate "<yellow>Region <c.args.get[2]> vytvoreny"
                    } else {
                        - narrate "<red>Prosim upresni nazov cuboidu"
                        } 

                } else {
                    - narrate "<red>Pred vytvorenim cuboidu najprv definuj body (/cu)"
                    } 
            } 
            else if <context.args.get[1]> == akcia {
                - if <c.args.get[2]> != null {
                    - if <c.args.get[3]> != null {
                        - if <c.args.get[4]> != null {
                            - yaml set 'Cuboidy.<player.world.replace[w@]>.<c.args.get[2]>.akcia.<c.args.get[3]>:<c.args.get[4].to[20].replace[li@].replace[|].with[ ]>' id:Cuboider
                            - narrate "<yellow>Hodnota uspesne nastavena!"
                            } else {
                                - narrate "<red>Prosim upresni hodnotu akcie"
                                } 

                        } else {
                            - narrate "<red>Prosim upresni nazov akcie"
                            } 

                    } else {
                        - narrate "<yellow>Prosim upresni nazov cuboidu"
                        } 

            } 
            else if <c.args.get[1]> == zoznam {
                - if <context.args.get[2]> == null {
                    - narrate "<yellow>Prosim upresni svet <white>(<yaml[cuboider].list_keys[Cuboidy].formatted.replace[and].with[a]>)"
                    - narrate "<red>/cu zoznam svet"
                    } else if <yaml[cuboider].contains[Cuboidy.<context.args.get[2]>]> {
                        - narrate "Zoznam cuboidov pre <c.args.get[2]>: <yellow><yaml[cuboider].list_keys[Cuboidy.<c.args.get[2]>].formatted.replace[and].with[a]>"
                        - narrate ""
                        - narrate "<dark_gray>Kompletny zaznam: <yaml[cuboider].read[Cuboidy.<c.args.get[2]>]>"
                    } else narrate "<yellow>Taky svet sa nenachadza v databazi"

            } 
            else if <c.args.get[1]> == vymazat {
                - if <c.args.get[2]> == null  narrate "<yellow>Prosim upresni cuboid"
                     else {
                        - yaml set Cuboidy.<player.world.replace[w@]>.<c.args.get[2]>:! id:cuboider
                        - note remove as:<c.args.get[2]>
                        - narrate "<yellow>Cuboid <c.args.get[2]> vymazany"
                     }
                }
            } 
            else {
                - narrate "<yellow>Zly prikaz. Pre zoznam prikazov napis /cu"
                } 
        - determine fulfilled