Paste #23729: Unable to stop script

Date: 2015/12/10 23:00:28 UTC-08:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


NPC_Guide_Interact:
  type: interact
  steps:
      1:
            chat trigger:
                1:
                      trigger: /yes/
                      script:
                      - ^create player Guide <npc.location> save:InstancedNPC
                      - ^flag <entry[InstancedNPC].created_npc> OriginalGuide:<^npc>
                      - ^run NPC_Guide_Tour npc:<entry[InstancedNPC].created_npc> def:<^npc>
                      - zap 2
##################################################
NPC_Guide_Instance:
  type: assignment
  actions:
    on assignment:
    - trigger name:chat state:true
  interact scripts:
  - 1 NPC_Guide_Instance_Interact
###############################################################
NPC_Guide_Instance_Interact:
  type: interact
  steps:
      1:
             chat trigger:
                1:
                      trigger: /cancel/
                      script:
                      - run NPC_Guide_Leave def:<npc.flag[OriginalGuide]>
##############################################################
NPC_Guide_Tour:
  type: task
  definitions: masternpc
  script:
  - flag <npc> tourQueue:<queue.id>
  - inject NPC_Event_Introduction
  - ~walk <def[masternpc].anchor[1_1]> auto_range
  - ^inject NPC_Guide_Wait_Walk
  - run NPC_Guide_Leave npc:<npc> def:<npc.flag[OriginalGuide]>
###################################################################
NPC_Guide_Leave:
  type: task
  definitions: GuideOriginal
  script:
  - zap script:s@NPC_Guide_Interact 1
  - queue <npc.flag[tourQueue]> clear #Supposed to stop the NPC_Guide_Tour script but it does not and the script continues running
  - remove <npc>
  - queue clear