Paste #18292: Now with if is_spawned all over the place =]

Date: 2015/07/17 09:58:05 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


"TeaLocustSkitter":
  type: task
  debug: false
  script:
    - while <npc.is_spawned||false> {
      - flag server <npc.id>LocustSkitter:<queue.id>
      - if <npc.location.find.players.within[16].size.is[MORE].than[0]||false> {
        - if <npc.is_spawned||false> {
          - walk <npc> stop
        }
        - if <npc.is_spawned||false> {
          - run "TeaRatConsumeCropsTask"
        }
        - if <npc.location.find.blocks[crops,7].within[4].size.is[MORE].than[0]||false> {
          - flag <npc> NestLocation:<npc.location.find.blocks[crops,7].within[4].random>
          - if <npc.is_spawned||false> {
            - run TeaRatNestParticles
          }

        }
        - wait 2s
        - if <npc.location.find.players.within[8].size.is[MORE].than[0]||false> {
          - if <npc.location.find.blocks[<npc.constant[EatList]>].within[1].size.is[MORE].than[0]||false> {
            - if <npc.is_spawned||false> {
              - walk <npc> stop
            }
            - wait 1t
            - if <npc.is_spawned||false> {
              - walk <npc> <npc.location.find.blocks[<npc.constant[EatList]>].within[1].random> radius:2 speed:2
            }
          }
          else if <npc.location.find.blocks[<npc.constant[EatList]>].within[16].size.is[MORE].than[0]||false> {
            - if <npc.is_spawned||false> {
              - walk <npc> stop
            }
            - wait 1t
            - if <npc.is_spawned||false> {
              - walk <npc> <npc.location.find.blocks[<npc.constant[EatList]>].within[16].random> radius:2 speed:2
            }
          }
          else {
            - if <npc.is_spawned||false> {
              - walk <npc> stop
            }
            - wait 1t
            - if <npc.is_spawned||false> {
              - walk <npc> <npc.location.find.blocks[air].within[10].random> radius:2 speed:2
            }

          }
        }
        else if <npc.location.find.players.within[16].size.is[MORE].than[0]||false> {
          - if <npc.location.find.blocks[<npc.constant[EatList]>].within[2].size.is[MORE].than[0]||false> {
            - if <npc.is_spawned||false> {
              - walk <npc> stop
            }
            - wait 1t
            - if <npc.is_spawned||false> {
              - walk <npc> <npc.location.find.blocks[<npc.constant[EatList]>].within[2].random> radius:2 speed:2
            }

          }
          else if <npc.location.find.blocks[<npc.constant[EatList]>].within[16].size.is[MORE].than[0]||false> {
            - if <npc.is_spawned||false> {
              - walk <npc> stop
            }
            - wait 1t
            - if <npc.is_spawned||false> {
              - walk <npc> <npc.location.find.blocks[<npc.constant[EatList]>].within[16].random> radius:2 speed:2
            }

          }
          else {
            - if <npc.is_spawned||false> {
              - walk <npc> stop
            }
            - wait 1t
            - if <npc.is_spawned||false> {
              - walk <npc> <npc.location.find.blocks[air].within[10].random> radius:2 speed:2
            }
            - wait 10s
          }
        }
      }
    }