Date: 2014/09/20 19:33:43 UTC-07:00
Type: Denizen Script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
MasterChefNPC:
type: assignment
debug: false
actions:
on assignment:
- run locally assignment instantly
on spawn:
- run locally spawn instantly
on despawn:
- run locally despawn instantly
findFridge:
# The Fridge is 2 ironblocks tall with a stone button on the front of the top block
- define ironBlocks <npc.location.find.blocks[iron_block].within[%range%]||null>
- if <def[ironBlocks].is[!=].to[null]>
&& !<def[ironBlocks].is_empty> {
- define locations li@
- foreach %ironBlocks% {
- define iron '%value%'
- if <def[iron].sub[0,1,0].material.is[!=].to[iron_block]||true> foreach next
- define east '<def[iron].add[1,0,0]>'
- define west '<def[iron].add[-1,0,0]>'
- define north '<def[iron].add[0,0,1]>'
- define south '<def[iron].add[0,0,-1]>'
- define cardinals li@east|west|north|south
- foreach %cardinals% {
- define location '<def[%value%]>'
- if <def[location].material.name.is[==].to[stone_button]>
&& <def[location].sub[0,1,0].material.name.is[==].to[air]>
&& <def[location].sub[0,2,0].material.is_solid> {
- define locations <def[locations].include[<def[location].below>]>
}
}
}
}