39 from CFTimeOfDay
import TimeOfDay
41 parameters = cjson.decode(Crossfire.WhatIsEvent().Message)
42 inverse =
"inverse" in parameters
and parameters[
"inverse"] ==
True
43 Crossfire.SetReturnValue(
not inverse)
44 if not "match" in parameters:
45 Crossfire.Log(Crossfire.LogError,
"Script filter.py didn't get a 'match' parameter. Only got %s" %parameters)
46 elif parameters[
"match"].lower() ==
"one":
47 if TimeOfDay().matchAny(parameters[
"when"]):
48 Crossfire.SetReturnValue(inverse)
49 elif parameters[
"match"].lower() ==
"all":
50 if TimeOfDay().matchAll(parameters[
"when"]):
51 Crossfire.SetReturnValue(inverse)
53 Crossfire.Log(Crossfire.LogError,
"Script filter.py didn't get a 'match' parameter. Only got %s" %parameters)