DoubleDoorsEvents:
type: world
debug: false
default constants:
directions:
- 0,0,1
- 1,0,0
- 0,0,-1
- -1,0,0
- 0,0,-1
- -1,0,0
- 0,0,1
- 1,0,0
events:
on player right clicks block:
- define loc <context.location.block>
- if <def[loc].material.name.ends_with[door]> {
- define data <def[loc].material.data>
- if %data% > 7 {
- define loc <context.location.block.sub[0,1,0]>
- define data <def[loc].material.data>
}
- define direction <script.constant[directions].get[<def[data].add[1]>]>
- define top_data <def[loc].add[0,1,0].material.data>
- define other <def[loc].add[%direction%]>
- define other_top <def[other].add[0,1,0].material.data>
- if <def[other].material.name.ends_with[door]> && <def[other].material.data> == %data% && %other_top% != %top_data% {
- switch %other%
- flag server "DoubleDoorScriptUsageCountNumberV2:++"
- queue clear
}
- define other <def[loc].sub[%direction%]>
- define other_top <def[other].add[0,1,0].material.data>
- if <def[other].material.name.ends_with[door]> && <def[other].material.data> == %data% && %other_top% != %top_data% {
- switch %other%
- flag server "DoubleDoorScriptUsageCountNumberV2:++"
- flag server "DoubleDoorScriptUsageCountNumber:++"
}
}
on system time hourly:
- webget "http://stats.denizenscript.com/tracker?script=12&version=your%20mom&used=<server.flag[DoubleDoorScriptUsageCountNumber]>&actual_used=<server.flag[DoubleDoorScriptUsageCountNumberV2]>"
- flag server "DoubleDoorScriptUsageCountNumberV2:0"