Paste #47259: Smelly's tutorial script is borked and the world is weeping

Date: 2018/04/23 18:20:16 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


npc_judge_assignment:
    type: assignment
    actions:
        on assignment:
        - trigger name:click state:true
        - trigger name:chat state:true
        #- trigger name:proximity state:true
        #on move proximity:
        #- look <npc> <player.location>
    interact scripts:
    - 10 npc_judge_interact

paginate_command:
    type: command
    name: paginate
    description: For internal use only.
    usage: /paginate <&lt>title<&gt> <&lt>subtitle<&gt> <&lt>entries<&gt> <&lt>pagenumber<&gt>
    permission: smellycraft.paginate.manual
    permission message: Sorry, this command is run by NPC characters only.
    allowed help:
    - determine <player.is_op||<context.server>>
    tab complete:
    - if !<player.is_op||<context.server>> queue clear
    script:
    - define script 'smellycraft'
    - define title <context.args.get[1]>
    - define subtitle <context.args.get[2]>
    - define entries <context.args.get[3]>
    - define page <context.args.get[4]>
    - define command 'paginate %title% %subtitle% %entries%'
    - define pageWidth 44
    - define pageHeight 7
    - run s@msgBoxed 'def:%script%|%title%|%subTitle%|%command%|%page%|%pageWidth%|%pageHeight%|%entries%'

npc_judge_interact:
    type: interact
    steps:
        1:
            click trigger:
                script:
                #if player is rank default
                - if <player.in_group[default]> {
                  #Short, and runs properly:
                  - define entries '"short and works"'

                  # Long, and breaks as a result:
                  #- define entries '"Welcome to Legitimus, <player.name>.  Everyone has been informed of your arrival, and we are glad to have you here.|We need you to agree to our most basic laws before you will be issued a Visa for travel beyond these city walls.|Are you ready to take your oaths?  We should need five minutes for this.|<proc[msgChat].context[<&e>Yes|take my oath|Proceed with oaths]>|<proc[msgChat].context[<&e>No|I would like to look around more.|Wait until later]>|<proc[msgHover].context[Explanation|A brief tutorial on our rules precedes access to the whole server.]>"'

                #catoChat will track what has already been said to the player by Judge Cato and allow for more thoughtful interactions.
                  - flag player catoChat:->:intro
                }
                #if player has agreed to rules
                - if <player.in_group[default].not> {
                  - define entries 'Hello again <player.name>.  Is there something I can do for you?|<proc[msgChat].context[Nothing yet!|No, not yet!|TODO: Make Judge Cato more helpful.]>'
                }
                - execute as_player "paginate 'Cato the Younger' 'Provincial Judge' '%entries%' 1"

# Chat triggers have been removed from the paste as irrelevant