Paste #68900: Having trouble iterating lists

Date: 2020/05/12 15:09:00 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


1
2
3
4
5
6
7
8
9
10
11
12
13


# set flag
- flag npc QuestChat:Newbie1|Garden1|Poison1|Garden2|Chicken1

#....

#seems I need a 'li@' here.. but I thought inherently, the above flag was a list already
- foreach li@<npc.flag[QuestChat]>:
  - if <[value]> = Newbie1:
    - debug log "Current Loop Index of: <[value]> is <[loop_index]>"
    - if <[loop_index]> >= <npc.flag[QuestChat].size>:
      - debug log "Can't promote further.
    - else:
      - debug log "promote to next"