Paste #8462: Diff note for paste #8461

Date: 2014/08/16 06:21:58 UTC-07:00
Type: Diff Report

View Raw Paste Download This Paste
Copy Link


 World Director:
  type: world
 
  events:
    on 6:00 in world:
    - flag global sleep:!
    - runtask 'loop through' "context:sleep_loop|npcs|global"
-   
    on 19:00 in world:
    - flag global sleep:true
    - runtask 'loop through' "context:sleep_loop|npcs|global"
    
 sleep_loop:
     type: task
     context: npc
     
     script:
     - runtask npcid:<^context.npc> sleep_handler
    
 "Sleep":
   type: assignment
 
   default constants:
     SleepCycle: true
   
   actions:
     on assignment:
     - if !<flag.g:npcs.aslist> contains '<npc.id>' flag global "npcs:->:<npc.id>"
-    
     on spawn:
     - if !<flag.g:npcs.aslist> contains '<npc.id>' flag global "npcs:->:<npc.id>"
-    
     on despawn:
     - if <flag.g:npcs.aslist> contains '<npc.id>' flag global "npcs:<-:<npc.id>"
-    
     on remove:
     - if <flag.g:npcs.aslist> contains '<npc.id>' flag global "npcs:<-:<npc.id>"
-    
     on complete navigation:
     - if <flag.n:sleeping> == true execute as_npc "npc select <npc.id>"
     - if <flag.n:sleeping> == true execute as_npc "npc sleep --anchor:bed"
     
 sleep_handler:
     type: task
     
     script:
     - if <cons:SleepCycle> == "false" queue clear
     - if <flag.g:sleep> == true if !<flag.n:sleeping> pause waypoints
     - if <flag.g:sleep> == true if !<flag.n:sleeping> walkto location:<anchor:bed>
     - if <flag.g:sleep> == true if !<flag.n:sleeping> flag npc sleeping:true
     - if <flag.n:sleeping> == true if !<flag.g:sleep> runtask 'unpause_waypoints' queue:unpause_queue
     - if <flag.n:sleeping> == true if !<flag.g:sleep> flag npc sleeping:!
     
 unpause_waypoints:
   type: task
   
   script:
   - pause duration:1 waypoints
   - wait duration:1